@arbocollab/arbo-plugin-item-table 0.1.97 → 0.1.98

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.
@@ -110,7 +110,7 @@ Expected function or array of functions, received type ${typeof e}.`),ls)}functi
110
110
  * Date: 2023-02-28T14:09:41.732Z
111
111
  */function x1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function xg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(n),!0).forEach(function(s){bz(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x1(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function wz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F1(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,P1(s.key),s)}}function Cz(e,t,n){return t&&F1(e.prototype,t),n&&F1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bz(e,t,n){return t=P1(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fg(){return Fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fg.apply(this,arguments)}function Sz(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function P1(e){var t=Sz(e,"string");return typeof t=="symbol"?t:String(t)}var A1={exports:{}};(function(e){typeof window>"u"||function(t){var n=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,s=t.Blob&&function(){try{return!!new Blob}catch{return!1}}(),o=s&&t.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),i=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,r=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(s||i)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(l){var u,c,d,h,f,p,g,v,C;if(u=l.match(r),!u)throw new Error("invalid data URI");for(c=u[2]?u[1]:"text/plain"+(u[3]||";charset=US-ASCII"),d=!!u[4],h=l.slice(u[0].length),d?f=atob(h):f=decodeURIComponent(h),p=new ArrayBuffer(f.length),g=new Uint8Array(p),v=0;v<f.length;v+=1)g[v]=f.charCodeAt(v);return s?new Blob([o?g:p],{type:c}):(C=new i,C.append(p),C.getBlob(c))};t.HTMLCanvasElement&&!n.toBlob&&(n.mozGetAsFile?n.toBlob=function(l,u,c){var d=this;setTimeout(function(){c&&n.toDataURL&&a?l(a(d.toDataURL(u,c))):l(d.mozGetAsFile("blob",u))})}:n.toDataURL&&a&&(n.msToBlob?n.toBlob=function(l,u,c){var d=this;setTimeout(function(){(u&&u!=="image/png"||c)&&n.toDataURL&&a?l(a(d.toDataURL(u,c))):l(d.msToBlob(u))})}:n.toBlob=function(l,u,c){var d=this;setTimeout(function(){l(a(d.toDataURL(u,c)))})})),e.exports?e.exports=a:t.dataURLtoBlob=a}(window)})(A1);var k1=A1.exports,Ez=function(t){return typeof Blob>"u"?!1:t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"},O1={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},_z=typeof window<"u"&&typeof window.document<"u",Aa=_z?window:{},Pg=function(t){return t>0&&t<1/0},Rz=Array.prototype.slice;function yC(e){return Array.from?Array.from(e):Rz.call(e)}var Dz=/^image\/.+$/;function wC(e){return Dz.test(e)}function Tz(e){var t=wC(e)?e.substr(6):"";return t==="jpeg"&&(t="jpg"),".".concat(t)}var M1=String.fromCharCode;function Iz(e,t,n){var s="",o;for(n+=t,o=t;o<n;o+=1)s+=M1(e.getUint8(o));return s}var xz=Aa.btoa;function N1(e,t){for(var n=[],s=8192,o=new Uint8Array(e);o.length>0;)n.push(M1.apply(null,yC(o.subarray(0,s)))),o=o.subarray(s);return"data:".concat(t,";base64,").concat(xz(n.join("")))}function Fz(e){var t=new DataView(e),n;try{var s,o,i;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var r=t.byteLength,a=2;a+1<r;){if(t.getUint8(a)===255&&t.getUint8(a+1)===225){o=a;break}a+=1}if(o){var l=o+4,u=o+10;if(Iz(t,l,4)==="Exif"){var c=t.getUint16(u);if(s=c===18761,(s||c===19789)&&t.getUint16(u+2,s)===42){var d=t.getUint32(u+4,s);d>=8&&(i=u+d)}}}if(i){var h=t.getUint16(i,s),f,p;for(p=0;p<h;p+=1)if(f=i+p*12+2,t.getUint16(f,s)===274){f+=8,n=t.getUint16(f,s),t.setUint16(f,1,s);break}}}catch{n=1}return n}function Pz(e){var t=0,n=1,s=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:s}}var Az=/\.\d*(?:0|9){12}\d*$/;function L1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Az.test(e)?Math.round(e*t)/t:e}function _h(e){var t=e.aspectRatio,n=e.height,s=e.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",i=Pg(s),r=Pg(n);if(i&&r){var a=n*t;(o==="contain"||o==="none")&&a>s||o==="cover"&&a<s?n=s/t:s=n*t}else i?n=s/t:r&&(s=n*t);return{width:s,height:n}}function kz(e){for(var t=yC(new Uint8Array(e)),n=t.length,s=[],o=0;o+3<n;){var i=t[o],r=t[o+1];if(i===255&&r===218)break;if(i===255&&r===216)o+=2;else{var a=t[o+2]*256+t[o+3],l=o+a+2,u=t.slice(o,l);s.push(u),o=l}}return s.reduce(function(c,d){return d[0]===255&&d[1]===225?c.concat(d):c},[])}function Oz(e,t){var n=yC(new Uint8Array(e));if(n[2]!==255||n[3]!==224)return e;var s=n[4]*256+n[5],o=[255,216].concat(t,n.slice(4+s));return new Uint8Array(o)}var Mz=Aa.ArrayBuffer,CC=Aa.FileReader,Vl=Aa.URL||Aa.webkitURL,Nz=/\.\w+$/,Lz=Aa.Compressor,Vz=function(){function e(t,n){wz(this,e),this.file=t,this.exif=[],this.image=new Image,this.options=xg(xg({},O1),n),this.aborted=!1,this.result=null,this.init()}return Cz(e,[{key:"init",value:function(){var n=this,s=this.file,o=this.options;if(!Ez(s)){this.fail(new Error("The first argument must be a File or Blob object."));return}var i=s.type;if(!wC(i)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!Vl||!CC){this.fail(new Error("The current browser does not support image compression."));return}Mz||(o.checkOrientation=!1,o.retainExif=!1);var r=i==="image/jpeg",a=r&&o.checkOrientation,l=r&&o.retainExif;if(Vl&&!a&&!l)this.load({url:Vl.createObjectURL(s)});else{var u=new CC;this.reader=u,u.onload=function(c){var d=c.target,h=d.result,f={},p=1;a&&(p=Fz(h),p>1&&Fg(f,Pz(p))),l&&(n.exif=kz(h)),a||l?!Vl||p>1?f.url=N1(h,i):f.url=Vl.createObjectURL(s):f.url=h,n.load(f)},u.onabort=function(){n.fail(new Error("Aborted to read the image with FileReader."))},u.onerror=function(){n.fail(new Error("Failed to read the image with FileReader."))},u.onloadend=function(){n.reader=null},a||l?u.readAsArrayBuffer(s):u.readAsDataURL(s)}}},{key:"load",value:function(n){var s=this,o=this.file,i=this.image;i.onload=function(){s.draw(xg(xg({},n),{},{naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight}))},i.onabort=function(){s.fail(new Error("Aborted to load the image."))},i.onerror=function(){s.fail(new Error("Failed to load the image."))},Aa.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Aa.navigator.userAgent)&&(i.crossOrigin="anonymous"),i.alt=o.name,i.src=n.url}},{key:"draw",value:function(n){var s=this,o=n.naturalWidth,i=n.naturalHeight,r=n.rotate,a=r===void 0?0:r,l=n.scaleX,u=l===void 0?1:l,c=n.scaleY,d=c===void 0?1:c,h=this.file,f=this.image,p=this.options,g=document.createElement("canvas"),v=g.getContext("2d"),C=Math.abs(a)%180===90,S=(p.resize==="contain"||p.resize==="cover")&&Pg(p.width)&&Pg(p.height),b=Math.max(p.maxWidth,0)||1/0,w=Math.max(p.maxHeight,0)||1/0,_=Math.max(p.minWidth,0)||0,R=Math.max(p.minHeight,0)||0,T=o/i,I=p.width,x=p.height;if(C){var P=[w,b];b=P[0],w=P[1];var D=[R,_];_=D[0],R=D[1];var F=[x,I];I=F[0],x=F[1]}S&&(T=I/x);var k=_h({aspectRatio:T,width:b,height:w},"contain");b=k.width,w=k.height;var O=_h({aspectRatio:T,width:_,height:R},"cover");if(_=O.width,R=O.height,S){var B=_h({aspectRatio:T,width:I,height:x},p.resize);I=B.width,x=B.height}else{var Z=_h({aspectRatio:T,width:I,height:x}),J=Z.width;I=J===void 0?o:J;var ee=Z.height;x=ee===void 0?i:ee}I=Math.floor(L1(Math.min(Math.max(I,_),b))),x=Math.floor(L1(Math.min(Math.max(x,R),w)));var X=-I/2,ve=-x/2,ne=I,L=x,H=[];if(S){var te=0,he=0,me=o,re=i,oe=_h({aspectRatio:T,width:o,height:i},{contain:"cover",cover:"contain"}[p.resize]);me=oe.width,re=oe.height,te=(o-me)/2,he=(i-re)/2,H.push(te,he,me,re)}if(H.push(X,ve,ne,L),C){var z=[x,I];I=z[0],x=z[1]}g.width=I,g.height=x,wC(p.mimeType)||(p.mimeType=h.type);var pe="transparent";h.size>p.convertSize&&p.convertTypes.indexOf(p.mimeType)>=0&&(p.mimeType="image/jpeg");var ie=p.mimeType==="image/jpeg";if(ie&&(pe="#fff"),v.fillStyle=pe,v.fillRect(0,0,I,x),p.beforeDraw&&p.beforeDraw.call(this,v,g),!this.aborted&&(v.save(),v.translate(I/2,x/2),v.rotate(a*Math.PI/180),v.scale(u,d),v.drawImage.apply(v,[f].concat(H)),v.restore(),p.drew&&p.drew.call(this,v,g),!this.aborted)){var be=function(q){if(!s.aborted){var ce=function(ye){return s.done({naturalWidth:o,naturalHeight:i,result:ye})};if(q&&ie&&p.retainExif&&s.exif&&s.exif.length>0){var ke=function(ye){return ce(k1(N1(Oz(ye,s.exif),p.mimeType)))};if(q.arrayBuffer)q.arrayBuffer().then(ke).catch(function(){s.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var Fe=new CC;s.reader=Fe,Fe.onload=function(Le){var ye=Le.target;ke(ye.result)},Fe.onabort=function(){s.fail(new Error("Aborted to read the compressed image with FileReader."))},Fe.onerror=function(){s.fail(new Error("Failed to read the compressed image with FileReader."))},Fe.onloadend=function(){s.reader=null},Fe.readAsArrayBuffer(q)}}else ce(q)}};g.toBlob?g.toBlob(be,p.mimeType,p.quality):be(k1(g.toDataURL(p.mimeType,p.quality)))}}},{key:"done",value:function(n){var s=n.naturalWidth,o=n.naturalHeight,i=n.result,r=this.file,a=this.image,l=this.options;if(Vl&&a.src.indexOf("blob:")===0&&Vl.revokeObjectURL(a.src),i)if(l.strict&&!l.retainExif&&i.size>r.size&&l.mimeType===r.type&&!(l.width>s||l.height>o||l.minWidth>s||l.minHeight>o||l.maxWidth<s||l.maxHeight<o))i=r;else{var u=new Date;i.lastModified=u.getTime(),i.lastModifiedDate=u,i.name=r.name,i.name&&i.type!==r.type&&(i.name=i.name.replace(Nz,Tz(i.type)))}else i=r;this.result=i,l.success&&l.success.call(this,i)}},{key:"fail",value:function(n){var s=this.options;if(s.error)s.error.call(this,n);else throw n}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=Lz,e}},{key:"setDefaults",value:function(n){Fg(O1,n)}}]),e}(),V1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B1={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(V1,function(){var n=function(m,y){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,A){E.__proto__=A}||function(E,A){for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])})(m,y)},s=function(){return(s=Object.assign||function(m){for(var y,E=1,A=arguments.length;E<A;E++)for(var N in y=arguments[E])Object.prototype.hasOwnProperty.call(y,N)&&(m[N]=y[N]);return m}).apply(this,arguments)};function o(m,y,E){for(var A,N=0,W=y.length;N<W;N++)!A&&N in y||((A=A||Array.prototype.slice.call(y,0,N))[N]=y[N]);return m.concat(A||Array.prototype.slice.call(y))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:V1,r=Object.keys,a=Array.isArray;function l(m,y){return typeof y!="object"||r(y).forEach(function(E){m[E]=y[E]}),m}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(m,y){return c.call(m,y)}function h(m,y){typeof y=="function"&&(y=y(u(m))),(typeof Reflect>"u"?r:Reflect.ownKeys)(y).forEach(function(E){p(m,E,y[E])})}var f=Object.defineProperty;function p(m,y,E,A){f(m,y,l(E&&d(E,"get")&&typeof E.get=="function"?{get:E.get,set:E.set,configurable:!0}:{value:E,configurable:!0,writable:!0},A))}function g(m){return{from:function(y){return m.prototype=Object.create(y.prototype),p(m.prototype,"constructor",m),{extend:h.bind(null,m.prototype)}}}}var v=Object.getOwnPropertyDescriptor,C=[].slice;function S(m,y,E){return C.call(m,y,E)}function b(m,y){return y(m)}function w(m){if(!m)throw new Error("Assertion Failed")}function _(m){i.setImmediate?setImmediate(m):setTimeout(m,0)}function R(m,y){if(typeof y=="string"&&d(m,y))return m[y];if(!y)return m;if(typeof y!="string"){for(var E=[],A=0,N=y.length;A<N;++A){var W=R(m,y[A]);E.push(W)}return E}var se=y.indexOf(".");if(se!==-1){var le=m[y.substr(0,se)];return le==null?void 0:R(le,y.substr(se+1))}}function T(m,y,E){if(m&&y!==void 0&&!("isFrozen"in Object&&Object.isFrozen(m)))if(typeof y!="string"&&"length"in y){w(typeof E!="string"&&"length"in E);for(var A=0,N=y.length;A<N;++A)T(m,y[A],E[A])}else{var W,se,le=y.indexOf(".");le!==-1?(W=y.substr(0,le),(se=y.substr(le+1))===""?E===void 0?a(m)&&!isNaN(parseInt(W))?m.splice(W,1):delete m[W]:m[W]=E:T(le=!(le=m[W])||!d(m,W)?m[W]={}:le,se,E)):E===void 0?a(m)&&!isNaN(parseInt(y))?m.splice(y,1):delete m[y]:m[y]=E}}function I(m){var y,E={};for(y in m)d(m,y)&&(E[y]=m[y]);return E}var x=[].concat;function P(m){return x.apply([],m)}var wa="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(P([8,16,32,64].map(function(m){return["Int","Uint","Float"].map(function(y){return y+m+"Array"})}))).filter(function(m){return i[m]}),D=new Set(wa.map(function(m){return i[m]})),F=null;function k(m){return F=new WeakMap,m=function y(E){if(!E||typeof E!="object")return E;var A=F.get(E);if(A)return A;if(a(E)){A=[],F.set(E,A);for(var N=0,W=E.length;N<W;++N)A.push(y(E[N]))}else if(D.has(E.constructor))A=E;else{var se,le=u(E);for(se in A=le===Object.prototype?{}:Object.create(le),F.set(E,A),E)d(E,se)&&(A[se]=y(E[se]))}return A}(m),F=null,m}var O={}.toString;function B(m){return O.call(m).slice(8,-1)}var Z=typeof Symbol<"u"?Symbol.iterator:"@@iterator",J=typeof Z=="symbol"?function(m){var y;return m!=null&&(y=m[Z])&&y.apply(m)}:function(){return null};function ee(m,y){return y=m.indexOf(y),0<=y&&m.splice(y,1),0<=y}var X={};function ve(m){var y,E,A,N;if(arguments.length===1){if(a(m))return m.slice();if(this===X&&typeof m=="string")return[m];if(N=J(m)){for(E=[];!(A=N.next()).done;)E.push(A.value);return E}if(m==null)return[m];if(typeof(y=m.length)!="number")return[m];for(E=new Array(y);y--;)E[y]=m[y];return E}for(y=arguments.length,E=new Array(y);y--;)E[y]=arguments[y];return E}var ne=typeof Symbol<"u"?function(m){return m[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ze=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mi=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ze),L={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function H(m,y){this.name=m,this.message=y}function te(m,y){return m+". Errors: "+Object.keys(y).map(function(E){return y[E].toString()}).filter(function(E,A,N){return N.indexOf(E)===A}).join(`
112
112
  `)}function he(m,y,E,A){this.failures=y,this.failedKeys=A,this.successCount=E,this.message=te(m,y)}function me(m,y){this.name="BulkError",this.failures=Object.keys(y).map(function(E){return y[E]}),this.failuresByPos=y,this.message=te(m,this.failures)}g(H).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(he).from(H),g(me).from(H);var re=mi.reduce(function(m,y){return m[y]=y+"Error",m},{}),oe=H,z=mi.reduce(function(m,y){var E=y+"Error";function A(N,W){this.name=E,N?typeof N=="string"?(this.message="".concat(N).concat(W?`
113
- `+W:""),this.inner=W||null):typeof N=="object"&&(this.message="".concat(N.name," ").concat(N.message),this.inner=N):(this.message=L[y]||E,this.inner=null)}return g(A).from(oe),m[y]=A,m},{});z.Syntax=SyntaxError,z.Type=TypeError,z.Range=RangeError;var pe=ze.reduce(function(m,y){return m[y+"Error"]=z[y],m},{}),ie=mi.reduce(function(m,y){return["Syntax","Type","Range"].indexOf(y)===-1&&(m[y+"Error"]=z[y]),m},{});function be(){}function G(m){return m}function q(m,y){return m==null||m===G?y:function(E){return y(m(E))}}function ce(m,y){return function(){m.apply(this,arguments),y.apply(this,arguments)}}function ke(m,y){return m===be?y:function(){var E=m.apply(this,arguments);E!==void 0&&(arguments[0]=E);var A=this.onsuccess,N=this.onerror;this.onsuccess=null,this.onerror=null;var W=y.apply(this,arguments);return A&&(this.onsuccess=this.onsuccess?ce(A,this.onsuccess):A),N&&(this.onerror=this.onerror?ce(N,this.onerror):N),W!==void 0?W:E}}function Fe(m,y){return m===be?y:function(){m.apply(this,arguments);var E=this.onsuccess,A=this.onerror;this.onsuccess=this.onerror=null,y.apply(this,arguments),E&&(this.onsuccess=this.onsuccess?ce(E,this.onsuccess):E),A&&(this.onerror=this.onerror?ce(A,this.onerror):A)}}function Le(m,y){return m===be?y:function(E){var A=m.apply(this,arguments);l(E,A);var N=this.onsuccess,W=this.onerror;return this.onsuccess=null,this.onerror=null,E=y.apply(this,arguments),N&&(this.onsuccess=this.onsuccess?ce(N,this.onsuccess):N),W&&(this.onerror=this.onerror?ce(W,this.onerror):W),A===void 0?E===void 0?void 0:E:l(A,E)}}function ye(m,y){return m===be?y:function(){return y.apply(this,arguments)!==!1&&m.apply(this,arguments)}}function M(m,y){return m===be?y:function(){var E=m.apply(this,arguments);if(E&&typeof E.then=="function"){for(var A=this,N=arguments.length,W=new Array(N);N--;)W[N]=arguments[N];return E.then(function(){return y.apply(A,W)})}return y.apply(this,arguments)}}ie.ModifyError=he,ie.DexieError=H,ie.BulkError=me;var $=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ae(m){$=m}var Ge={},we=100,wa=typeof Promise>"u"?[]:function(){var m=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[m,u(m),m];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,u(y),m]}(),ze=wa[0],mi=wa[1],wa=wa[2],mi=mi&&mi.then,Ue=ze&&ze.constructor,Ee=!!wa,Ve=function(m,y){yt.push([m,y]),At&&(queueMicrotask(Ir),At=!1)},pt=!0,At=!0,Ut=[],Qt=[],zt=G,Ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:be,pgp:!1,env:{},finalize:be},je=Ne,yt=[],Ot=0,Wt=[];function st(m){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=je;if(typeof m!="function"){if(m!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&pl(this,this._value))}this._state=null,this._value=null,++y.ref,function E(A,N){try{N(function(W){if(A._state===null){if(W===A)throw new TypeError("A promise cannot be resolved with itself.");var se=A._lib&&xr();W&&typeof W.then=="function"?E(A,function(le,Ce){W instanceof st?W._then(le,Ce):W.then(le,Ce)}):(A._state=!0,A._value=W,Co(A)),se&&pi()}},pl.bind(null,A))}catch(W){pl(A,W)}}(this,m)}var ps={get:function(){var m=je,y=Od;function E(A,N){var W=this,se=!m.global&&(m!==je||y!==Od),le=se&&!jt(),Ce=new st(function(Re,Ie){va(W,new Gi(Pr(A,m,se,le),Pr(N,m,se,le),Re,Ie,m))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return E.prototype=Ge,E},set:function(m){p(this,"then",m&&m.prototype===Ge?ps:{get:function(){return m},set:ps.set})}};function Gi(m,y,E,A,N){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.resolve=E,this.reject=A,this.psd=N}function pl(m,y){var E,A;Qt.push(y),m._state===null&&(E=m._lib&&xr(),y=zt(y),m._state=!1,m._value=y,A=m,Ut.some(function(N){return N._value===A._value})||Ut.push(A),Co(m),E&&pi())}function Co(m){var y=m._listeners;m._listeners=[];for(var E=0,A=y.length;E<A;++E)va(m,y[E]);var N=m._PSD;--N.ref||N.finalize(),Ot===0&&(++Ot,Ve(function(){--Ot==0&&Fr()},[]))}function va(m,y){if(m._state!==null){var E=m._state?y.onFulfilled:y.onRejected;if(E===null)return(m._state?y.resolve:y.reject)(m._value);++y.psd.ref,++Ot,Ve(gl,[E,m,y])}else m._listeners.push(y)}function gl(m,y,E){try{var A,N=y._value;!y._state&&Qt.length&&(Qt=[]),A=$&&y._consoleTask?y._consoleTask.run(function(){return m(N)}):m(N),y._state||Qt.indexOf(N)!==-1||function(W){for(var se=Ut.length;se;)if(Ut[--se]._value===W._value)return Ut.splice(se,1)}(y),E.resolve(A)}catch(W){E.reject(W)}finally{--Ot==0&&Fr(),--E.psd.ref||E.psd.finalize()}}function Ir(){bo(Ne,function(){xr()&&pi()})}function xr(){var m=pt;return At=pt=!1,m}function pi(){var m,y,E;do for(;0<yt.length;)for(m=yt,yt=[],E=m.length,y=0;y<E;++y){var A=m[y];A[0].apply(null,A[1])}while(0<yt.length);At=pt=!0}function Fr(){var m=Ut;Ut=[],m.forEach(function(A){A._PSD.onunhandled.call(null,A._value,A)});for(var y=Wt.slice(0),E=y.length;E;)y[--E]()}function Au(m){return new st(Ge,!1,m)}function kn(m,y){var E=je;return function(){var A=xr(),N=je;try{return js(E,!0),m.apply(this,arguments)}catch(W){y&&y(W)}finally{js(N,!1),A&&pi()}}}h(st.prototype,{then:ps,_then:function(m,y){va(this,new Gi(null,null,m,y,je))},catch:function(m){if(arguments.length===1)return this.then(null,m);var y=m,E=arguments[1];return typeof y=="function"?this.then(null,function(A){return(A instanceof y?E:Au)(A)}):this.then(null,function(A){return(A&&A.name===y?E:Au)(A)})},finally:function(m){return this.then(function(y){return st.resolve(m()).then(function(){return y})},function(y){return st.resolve(m()).then(function(){return Au(y)})})},timeout:function(m,y){var E=this;return m<1/0?new st(function(A,N){var W=setTimeout(function(){return N(new z.Timeout(y))},m);E.then(A,N).finally(clearTimeout.bind(null,W))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(st.prototype,Symbol.toStringTag,"Dexie.Promise"),Ne.env=ku(),h(st,{all:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&y([]);var A=m.length;m.forEach(function(N,W){return st.resolve(N).then(function(se){m[W]=se,--A||y(m)},E)})})},resolve:function(m){return m instanceof st?m:m&&typeof m.then=="function"?new st(function(y,E){m.then(y,E)}):new st(Ge,!0,m)},reject:Au,race:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.map(function(A){return st.resolve(A).then(y,E)})})},PSD:{get:function(){return je},set:function(m){return je=m}},totalEchoes:{get:function(){return Od}},newPSD:Ae,usePSD:bo,scheduler:{get:function(){return Ve},set:function(m){Ve=m}},rejectionMapper:{get:function(){return zt},set:function(m){zt=m}},follow:function(m,y){return new st(function(E,A){return Ae(function(N,W){var se=je;se.unhandleds=[],se.onunhandled=W,se.finalize=ce(function(){var le,Ce=this;le=function(){Ce.unhandleds.length===0?N():W(Ce.unhandleds[0])},Wt.push(function Re(){le(),Wt.splice(Wt.indexOf(Re),1)}),++Ot,Ve(function(){--Ot==0&&Fr()},[])},se.finalize),m()},y,E,A)})}}),Ue&&(Ue.allSettled&&p(st,"allSettled",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y){m.length===0&&y([]);var E=m.length,A=new Array(E);m.forEach(function(N,W){return st.resolve(N).then(function(se){return A[W]={status:"fulfilled",value:se}},function(se){return A[W]={status:"rejected",reason:se}}).then(function(){return--E||y(A)})})})}),Ue.any&&typeof AggregateError<"u"&&p(st,"any",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&E(new AggregateError([]));var A=m.length,N=new Array(A);m.forEach(function(W,se){return st.resolve(W).then(function(le){return y(le)},function(le){N[se]=le,--A||E(new AggregateError(N))})})})}),Ue.withResolvers&&(st.withResolvers=Ue.withResolvers));var gs={awaits:0,echoes:0,id:0},__=0,Ad=[],kd=0,Od=0,R_=0;function Ae(m,y,E,A){var N=je,W=Object.create(N);return W.parent=N,W.ref=0,W.global=!1,W.id=++R_,Ne.env,W.env=Ee?{Promise:st,PromiseProp:{value:st,configurable:!0,writable:!0},all:st.all,race:st.race,allSettled:st.allSettled,any:st.any,resolve:st.resolve,reject:st.reject}:{},y&&l(W,y),++N.ref,W.finalize=function(){--this.parent.ref||this.parent.finalize()},A=bo(W,m,E,A),W.ref===0&&W.finalize(),A}function Ye(){return gs.id||(gs.id=++__),++gs.awaits,gs.echoes+=we,gs.id}function jt(){return!!gs.awaits&&(--gs.awaits==0&&(gs.id=0),gs.echoes=gs.awaits*we,!0)}function sn(m){return gs.echoes&&m&&m.constructor===Ue?(Ye(),m.then(function(y){return jt(),y},function(y){return jt(),Kn(y)})):m}function Ui(){var m=Ad[Ad.length-1];Ad.pop(),js(m,!1)}function js(m,y){var E,A=je;(y?!gs.echoes||kd++&&m===je:!kd||--kd&&m===je)||queueMicrotask(y?(function(N){++Od,gs.echoes&&--gs.echoes!=0||(gs.echoes=gs.awaits=gs.id=0),Ad.push(je),js(N,!0)}).bind(null,m):Ui),m!==je&&(je=m,A===Ne&&(Ne.env=ku()),Ee&&(E=Ne.env.Promise,y=m.env,(A.global||m.global)&&(Object.defineProperty(i,"Promise",y.PromiseProp),E.all=y.all,E.race=y.race,E.resolve=y.resolve,E.reject=y.reject,y.allSettled&&(E.allSettled=y.allSettled),y.any&&(E.any=y.any))))}function ku(){var m=i.Promise;return Ee?{Promise:m,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:m.all,race:m.race,allSettled:m.allSettled,any:m.any,resolve:m.resolve,reject:m.reject}:{}}function bo(m,y,E,A,N){var W=je;try{return js(m,!0),y(E,A,N)}finally{js(W,!1)}}function Pr(m,y,E,A){return typeof m!="function"?m:function(){var N=je;E&&Ye(),js(y,!0);try{return m.apply(this,arguments)}finally{js(N,!1),A&&queueMicrotask(jt)}}}function Fy(m){Promise===Ue&&gs.echoes===0?kd===0?m():enqueueNativeMicroTask(m):setTimeout(m,0)}(""+mi).indexOf("[native code]")===-1&&(Ye=jt=be);var Kn=st.reject,ya="￿",gi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ou="String expected.",Md=[],Py="__dbnames",D_="readonly",T_="readwrite";function Mu(m,y){return m?y?function(){return m.apply(this,arguments)&&y.apply(this,arguments)}:m:y}var VB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ay(m){return typeof m!="string"||/\./.test(m)?function(y){return y}:function(y){return y[m]===void 0&&m in y&&delete(y=k(y))[m],y}}function BB(){throw z.Type()}function ln(m,y){try{var E=$B(m),A=$B(y);if(E!==A)return E==="Array"?1:A==="Array"?-1:E==="binary"?1:A==="binary"?-1:E==="string"?1:A==="string"?-1:E==="Date"?1:A!=="Date"?NaN:-1;switch(E){case"number":case"Date":case"string":return y<m?1:m<y?-1:0;case"binary":return function(N,W){for(var se=N.length,le=W.length,Ce=se<le?se:le,Re=0;Re<Ce;++Re)if(N[Re]!==W[Re])return N[Re]<W[Re]?-1:1;return se===le?0:se<le?-1:1}(HB(m),HB(y));case"Array":return function(N,W){for(var se=N.length,le=W.length,Ce=se<le?se:le,Re=0;Re<Ce;++Re){var Ie=ln(N[Re],W[Re]);if(Ie!==0)return Ie}return se===le?0:se<le?-1:1}(m,y)}}catch{}return NaN}function $B(m){var y=typeof m;return y!="object"?y:ArrayBuffer.isView(m)?"binary":(m=B(m),m==="ArrayBuffer"?"binary":m)}function HB(m){return m instanceof Uint8Array?m:ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m)}var GB=($n.prototype._trans=function(m,y,E){var A=this._tx||je.trans,N=this.name,W=$&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(m==="readonly"?"read":"write"," ").concat(this.name));function se(Re,Ie,de){if(!de.schema[N])throw new z.NotFound("Table "+N+" not part of transaction");return y(de.idbtrans,de)}var le=xr();try{var Ce=A&&A.db._novip===this.db._novip?A===je.trans?A._promise(m,se,E):Ae(function(){return A._promise(m,se,E)},{trans:A,transless:je.transless||je}):function Re(Ie,de,Pe,Se){if(Ie.idbdb&&(Ie._state.openComplete||je.letThrough||Ie._vip)){var Te=Ie._createTransaction(de,Pe,Ie._dbSchema);try{Te.create(),Ie._state.PR1398_maxLoop=3}catch(xe){return xe.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,de,Pe,Se)})):Kn(xe)}return Te._promise(de,function(xe,De){return Ae(function(){return je.trans=Te,Se(xe,De,Te)})}).then(function(xe){if(de==="readwrite")try{Te.idbtrans.commit()}catch{}return de==="readonly"?xe:Te._completion.then(function(){return xe})})}if(Ie._state.openComplete)return Kn(new z.DatabaseClosed(Ie._state.dbOpenError));if(!Ie._state.isBeingOpened){if(!Ie._state.autoOpen)return Kn(new z.DatabaseClosed);Ie.open().catch(be)}return Ie._state.dbReadyPromise.then(function(){return Re(Ie,de,Pe,Se)})}(this.db,m,[this.name],se);return W&&(Ce._consoleTask=W,Ce=Ce.catch(function(Re){return console.trace(Re),Kn(Re)})),Ce}finally{le&&pi()}},$n.prototype.get=function(m,y){var E=this;return m&&m.constructor===Object?this.where(m).first(y):m==null?Kn(new z.Type("Invalid argument to Table.get()")):this._trans("readonly",function(A){return E.core.get({trans:A,key:m}).then(function(N){return E.hook.reading.fire(N)})}).then(y)},$n.prototype.where=function(m){if(typeof m=="string")return new this.db.WhereClause(this,m);if(a(m))return new this.db.WhereClause(this,"[".concat(m.join("+"),"]"));var y=r(m);if(y.length===1)return this.where(y[0]).equals(m[y[0]]);var E=this.schema.indexes.concat(this.schema.primKey).filter(function(le){if(le.compound&&y.every(function(Re){return 0<=le.keyPath.indexOf(Re)})){for(var Ce=0;Ce<y.length;++Ce)if(y.indexOf(le.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(le,Ce){return le.keyPath.length-Ce.keyPath.length})[0];if(E&&this.db._maxKey!==ya){var W=E.keyPath.slice(0,y.length);return this.where(W).equals(W.map(function(Ce){return m[Ce]}))}!E&&$&&console.warn("The query ".concat(JSON.stringify(m)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(y.join("+"),"]"));var A=this.schema.idxByName;function N(le,Ce){return ln(le,Ce)===0}var se=y.reduce(function(de,Ce){var Re=de[0],Ie=de[1],de=A[Ce],Pe=m[Ce];return[Re||de,Re||!de?Mu(Ie,de&&de.multi?function(Se){return Se=R(Se,Ce),a(Se)&&Se.some(function(Te){return N(Pe,Te)})}:function(Se){return N(Pe,R(Se,Ce))}):Ie]},[null,null]),W=se[0],se=se[1];return W?this.where(W.name).equals(m[W.keyPath]).filter(se):E?this.filter(se):this.where(y).equals("")},$n.prototype.filter=function(m){return this.toCollection().and(m)},$n.prototype.count=function(m){return this.toCollection().count(m)},$n.prototype.offset=function(m){return this.toCollection().offset(m)},$n.prototype.limit=function(m){return this.toCollection().limit(m)},$n.prototype.each=function(m){return this.toCollection().each(m)},$n.prototype.toArray=function(m){return this.toCollection().toArray(m)},$n.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$n.prototype.orderBy=function(m){return new this.db.Collection(new this.db.WhereClause(this,a(m)?"[".concat(m.join("+"),"]"):m))},$n.prototype.reverse=function(){return this.toCollection().reverse()},$n.prototype.mapToClass=function(m){var y,E=this.db,A=this.name;function N(){return y!==null&&y.apply(this,arguments)||this}(this.schema.mappedClass=m).prototype instanceof BB&&(function(Ce,Re){if(typeof Re!="function"&&Re!==null)throw new TypeError("Class extends value "+String(Re)+" is not a constructor or null");function Ie(){this.constructor=Ce}n(Ce,Re),Ce.prototype=Re===null?Object.create(Re):(Ie.prototype=Re.prototype,new Ie)}(N,y=m),Object.defineProperty(N.prototype,"db",{get:function(){return E},enumerable:!1,configurable:!0}),N.prototype.table=function(){return A},m=N);for(var W=new Set,se=m.prototype;se;se=u(se))Object.getOwnPropertyNames(se).forEach(function(Ce){return W.add(Ce)});function le(Ce){if(!Ce)return Ce;var Re,Ie=Object.create(m.prototype);for(Re in Ce)if(!W.has(Re))try{Ie[Re]=Ce[Re]}catch{}return Ie}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=le,this.hook("reading",le),m},$n.prototype.defineClass=function(){return this.mapToClass(function(m){l(this,m)})},$n.prototype.add=function(m,y){var E=this,A=this.schema.primKey,N=A.auto,W=A.keyPath,se=m;return W&&N&&(se=Ay(W)(m)),this._trans("readwrite",function(le){return E.core.mutate({trans:le,type:"add",keys:y!=null?[y]:null,values:[se]})}).then(function(le){return le.numFailures?st.reject(le.failures[0]):le.lastResult}).then(function(le){if(W)try{T(m,W,le)}catch{}return le})},$n.prototype.update=function(m,y){return typeof m!="object"||a(m)?this.where(":id").equals(m).modify(y):(m=R(m,this.schema.primKey.keyPath),m===void 0?Kn(new z.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(m).modify(y))},$n.prototype.put=function(m,y){var E=this,A=this.schema.primKey,N=A.auto,W=A.keyPath,se=m;return W&&N&&(se=Ay(W)(m)),this._trans("readwrite",function(le){return E.core.mutate({trans:le,type:"put",values:[se],keys:y!=null?[y]:null})}).then(function(le){return le.numFailures?st.reject(le.failures[0]):le.lastResult}).then(function(le){if(W)try{T(m,W,le)}catch{}return le})},$n.prototype.delete=function(m){var y=this;return this._trans("readwrite",function(E){return y.core.mutate({trans:E,type:"delete",keys:[m]})}).then(function(E){return E.numFailures?st.reject(E.failures[0]):void 0})},$n.prototype.clear=function(){var m=this;return this._trans("readwrite",function(y){return m.core.mutate({trans:y,type:"deleteRange",range:VB})}).then(function(y){return y.numFailures?st.reject(y.failures[0]):void 0})},$n.prototype.bulkGet=function(m){var y=this;return this._trans("readonly",function(E){return y.core.getMany({keys:m,trans:E}).then(function(A){return A.map(function(N){return y.hook.reading.fire(N)})})})},$n.prototype.bulkAdd=function(m,y,E){var A=this,N=Array.isArray(y)?y:void 0,W=(E=E||(N?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var Re=A.schema.primKey,le=Re.auto,Re=Re.keyPath;if(Re&&N)throw new z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(N&&N.length!==m.length)throw new z.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&le?m.map(Ay(Re)):m;return A.core.mutate({trans:se,type:"add",keys:N,values:Re,wantResults:W}).then(function(Te){var de=Te.numFailures,Pe=Te.results,Se=Te.lastResult,Te=Te.failures;if(de===0)return W?Pe:Se;throw new me("".concat(A.name,".bulkAdd(): ").concat(de," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkPut=function(m,y,E){var A=this,N=Array.isArray(y)?y:void 0,W=(E=E||(N?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var Re=A.schema.primKey,le=Re.auto,Re=Re.keyPath;if(Re&&N)throw new z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(N&&N.length!==m.length)throw new z.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&le?m.map(Ay(Re)):m;return A.core.mutate({trans:se,type:"put",keys:N,values:Re,wantResults:W}).then(function(Te){var de=Te.numFailures,Pe=Te.results,Se=Te.lastResult,Te=Te.failures;if(de===0)return W?Pe:Se;throw new me("".concat(A.name,".bulkPut(): ").concat(de," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkUpdate=function(m){var y=this,E=this.core,A=m.map(function(se){return se.key}),N=m.map(function(se){return se.changes}),W=[];return this._trans("readwrite",function(se){return E.getMany({trans:se,keys:A,cache:"clone"}).then(function(le){var Ce=[],Re=[];m.forEach(function(de,Pe){var Se=de.key,Te=de.changes,xe=le[Pe];if(xe){for(var De=0,Me=Object.keys(Te);De<Me.length;De++){var $e=Me[De],He=Te[$e];if($e===y.schema.primKey.keyPath){if(ln(He,Se)!==0)throw new z.Constraint("Cannot update primary key in bulkUpdate()")}else T(xe,$e,He)}W.push(Pe),Ce.push(Se),Re.push(xe)}});var Ie=Ce.length;return E.mutate({trans:se,type:"put",keys:Ce,values:Re,updates:{keys:A,changeSpecs:N}}).then(function(de){var Pe=de.numFailures,Se=de.failures;if(Pe===0)return Ie;for(var Te=0,xe=Object.keys(Se);Te<xe.length;Te++){var De,Me=xe[Te],$e=W[Number(Me)];$e!=null&&(De=Se[Me],delete Se[Me],Se[$e]=De)}throw new me("".concat(y.name,".bulkUpdate(): ").concat(Pe," of ").concat(Ie," operations failed"),Se)})})})},$n.prototype.bulkDelete=function(m){var y=this,E=m.length;return this._trans("readwrite",function(A){return y.core.mutate({trans:A,type:"delete",keys:m})}).then(function(se){var N=se.numFailures,W=se.lastResult,se=se.failures;if(N===0)return W;throw new me("".concat(y.name,".bulkDelete(): ").concat(N," of ").concat(E," operations failed"),se)})},$n);function $n(){}function yp(m){function y(se,le){if(le){for(var Ce=arguments.length,Re=new Array(Ce-1);--Ce;)Re[Ce-1]=arguments[Ce];return E[se].subscribe.apply(null,Re),m}if(typeof se=="string")return E[se]}var E={};y.addEventType=W;for(var A=1,N=arguments.length;A<N;++A)W(arguments[A]);return y;function W(se,le,Ce){if(typeof se!="object"){var Re;le=le||ye;var Ie={subscribers:[],fire:Ce=Ce||be,subscribe:function(de){Ie.subscribers.indexOf(de)===-1&&(Ie.subscribers.push(de),Ie.fire=le(Ie.fire,de))},unsubscribe:function(de){Ie.subscribers=Ie.subscribers.filter(function(Pe){return Pe!==de}),Ie.fire=Ie.subscribers.reduce(le,Ce)}};return E[se]=y[se]=Ie}r(Re=se).forEach(function(de){var Pe=Re[de];if(a(Pe))W(de,Re[de][0],Re[de][1]);else{if(Pe!=="asap")throw new z.InvalidArgument("Invalid event config");var Se=W(de,G,function(){for(var Te=arguments.length,xe=new Array(Te);Te--;)xe[Te]=arguments[Te];Se.subscribers.forEach(function(De){_(function(){De.apply(null,xe)})})})}})}}function wp(m,y){return g(y).from({prototype:m}),y}function Nd(m,y){return!(m.filter||m.algorithm||m.or)&&(y?m.justLimit:!m.replayFilter)}function I_(m,y){m.filter=Mu(m.filter,y)}function x_(m,y,E){var A=m.replayFilter;m.replayFilter=A?function(){return Mu(A(),y())}:y,m.justLimit=E&&!A}function ky(m,y){if(m.isPrimKey)return y.primaryKey;var E=y.getIndexByKeyPath(m.index);if(!E)throw new z.Schema("KeyPath "+m.index+" on object store "+y.name+" is not indexed");return E}function UB(m,y,E){var A=ky(m,y.schema);return y.openCursor({trans:E,values:!m.keysOnly,reverse:m.dir==="prev",unique:!!m.unique,query:{index:A,range:m.range}})}function Oy(m,y,E,A){var N=m.replayFilter?Mu(m.filter,m.replayFilter()):m.filter;if(m.or){var W={},se=function(le,Ce,Re){var Ie,de;N&&!N(Ce,Re,function(Pe){return Ce.stop(Pe)},function(Pe){return Ce.fail(Pe)})||((de=""+(Ie=Ce.primaryKey))=="[object ArrayBuffer]"&&(de=""+new Uint8Array(Ie)),d(W,de)||(W[de]=!0,y(le,Ce,Re)))};return Promise.all([m.or._iterate(se,E),WB(UB(m,A,E),m.algorithm,se,!m.keysOnly&&m.valueMapper)])}return WB(UB(m,A,E),Mu(m.algorithm,N),y,!m.keysOnly&&m.valueMapper)}function WB(m,y,E,A){var N=kn(A?function(W,se,le){return E(A(W),se,le)}:E);return m.then(function(W){if(W)return W.start(function(){var se=function(){return W.continue()};y&&!y(W,function(le){return se=le},function(le){W.stop(le),se=be},function(le){W.fail(le),se=be})||N(W.value,W,function(le){return se=le}),se()})})}var wa=Symbol(),Cp=(zB.prototype.execute=function(m){if(this.add!==void 0){var y=this.add;if(a(y))return o(o([],a(m)?m:[],!0),y).sort();if(typeof y=="number")return(Number(m)||0)+y;if(typeof y=="bigint")try{return BigInt(m)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(this.remove!==void 0){var E=this.remove;if(a(E))return a(m)?m.filter(function(A){return!E.includes(A)}).sort():[];if(typeof E=="number")return Number(m)-E;if(typeof E=="bigint")try{return BigInt(m)-E}catch{return BigInt(0)-E}throw new TypeError("Invalid subtrahend ".concat(E))}return y=(y=this.replacePrefix)===null||y===void 0?void 0:y[0],y&&typeof m=="string"&&m.startsWith(y)?this.replacePrefix[1]+m.substring(y.length):m},zB);function zB(m){Object.assign(this,m)}var sbe=(mn.prototype._read=function(m,y){var E=this._ctx;return E.error?E.table._trans(null,Kn.bind(null,E.error)):E.table._trans("readonly",m).then(y)},mn.prototype._write=function(m){var y=this._ctx;return y.error?y.table._trans(null,Kn.bind(null,y.error)):y.table._trans("readwrite",m,"locked")},mn.prototype._addAlgorithm=function(m){var y=this._ctx;y.algorithm=Mu(y.algorithm,m)},mn.prototype._iterate=function(m,y){return Oy(this._ctx,m,y,this._ctx.table.core)},mn.prototype.clone=function(m){var y=Object.create(this.constructor.prototype),E=Object.create(this._ctx);return m&&l(E,m),y._ctx=E,y},mn.prototype.raw=function(){return this._ctx.valueMapper=null,this},mn.prototype.each=function(m){var y=this._ctx;return this._read(function(E){return Oy(y,m,E,y.table.core)})},mn.prototype.count=function(m){var y=this;return this._read(function(E){var A=y._ctx,N=A.table.core;if(Nd(A,!0))return N.count({trans:E,query:{index:ky(A,N.schema),range:A.range}}).then(function(se){return Math.min(se,A.limit)});var W=0;return Oy(A,function(){return++W,!1},E,N).then(function(){return W})}).then(m)},mn.prototype.sortBy=function(m,y){var E=m.split(".").reverse(),A=E[0],N=E.length-1;function W(Ce,Re){return Re?W(Ce[E[Re]],Re-1):Ce[A]}var se=this._ctx.dir==="next"?1:-1;function le(Ce,Re){return ln(W(Ce,N),W(Re,N))*se}return this.toArray(function(Ce){return Ce.sort(le)}).then(y)},mn.prototype.toArray=function(m){var y=this;return this._read(function(E){var A=y._ctx;if(A.dir==="next"&&Nd(A,!0)&&0<A.limit){var N=A.valueMapper,W=ky(A,A.table.core.schema);return A.table.core.query({trans:E,limit:A.limit,values:!0,query:{index:W,range:A.range}}).then(function(le){return le=le.result,N?le.map(N):le})}var se=[];return Oy(A,function(le){return se.push(le)},E,A.table.core).then(function(){return se})},m)},mn.prototype.offset=function(m){var y=this._ctx;return m<=0||(y.offset+=m,Nd(y)?x_(y,function(){var E=m;return function(A,N){return E===0||(E===1?--E:N(function(){A.advance(E),E=0}),!1)}}):x_(y,function(){var E=m;return function(){return--E<0}})),this},mn.prototype.limit=function(m){return this._ctx.limit=Math.min(this._ctx.limit,m),x_(this._ctx,function(){var y=m;return function(E,A,N){return--y<=0&&A(N),0<=y}},!0),this},mn.prototype.until=function(m,y){return I_(this._ctx,function(E,A,N){return!m(E.value)||(A(N),y)}),this},mn.prototype.first=function(m){return this.limit(1).toArray(function(y){return y[0]}).then(m)},mn.prototype.last=function(m){return this.reverse().first(m)},mn.prototype.filter=function(m){var y;return I_(this._ctx,function(E){return m(E.value)}),(y=this._ctx).isMatch=Mu(y.isMatch,m),this},mn.prototype.and=function(m){return this.filter(m)},mn.prototype.or=function(m){return new this.db.WhereClause(this._ctx.table,m,this)},mn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mn.prototype.desc=function(){return this.reverse()},mn.prototype.eachKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.key,A)})},mn.prototype.eachUniqueKey=function(m){return this._ctx.unique="unique",this.eachKey(m)},mn.prototype.eachPrimaryKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.primaryKey,A)})},mn.prototype.keys=function(m){var y=this._ctx;y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,N){E.push(N.key)}).then(function(){return E}).then(m)},mn.prototype.primaryKeys=function(m){var y=this._ctx;if(y.dir==="next"&&Nd(y,!0)&&0<y.limit)return this._read(function(A){var N=ky(y,y.table.core.schema);return y.table.core.query({trans:A,values:!1,limit:y.limit,query:{index:N,range:y.range}})}).then(function(A){return A.result}).then(m);y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,N){E.push(N.primaryKey)}).then(function(){return E}).then(m)},mn.prototype.uniqueKeys=function(m){return this._ctx.unique="unique",this.keys(m)},mn.prototype.firstKey=function(m){return this.limit(1).keys(function(y){return y[0]}).then(m)},mn.prototype.lastKey=function(m){return this.reverse().firstKey(m)},mn.prototype.distinct=function(){var m=this._ctx,m=m.index&&m.table.schema.idxByName[m.index];if(!m||!m.multi)return this;var y={};return I_(this._ctx,function(N){var A=N.primaryKey.toString(),N=d(y,A);return y[A]=!0,!N}),this},mn.prototype.modify=function(m){var y=this,E=this._ctx;return this._write(function(A){var N,W,se;se=typeof m=="function"?m:(N=r(m),W=N.length,function(De){for(var Me=!1,$e=0;$e<W;++$e){var He=N[$e],Ze=m[He],ot=R(De,He);Ze instanceof Cp?(T(De,He,Ze.execute(ot)),Me=!0):ot!==Ze&&(T(De,He,Ze),Me=!0)}return Me});var le=E.table.core,de=le.schema.primaryKey,Ce=de.outbound,Re=de.extractKey,Ie=200,de=y.db._options.modifyChunkSize;de&&(Ie=typeof de=="object"?de[le.name]||de["*"]||200:de);function Pe(De,He){var $e=He.failures,He=He.numFailures;Te+=De-He;for(var Ze=0,ot=r($e);Ze<ot.length;Ze++){var gt=ot[Ze];Se.push($e[gt])}}var Se=[],Te=0,xe=[];return y.clone().primaryKeys().then(function(De){function Me(He){var Ze=Math.min(Ie,De.length-He);return le.getMany({trans:A,keys:De.slice(He,He+Ze),cache:"immutable"}).then(function(ot){for(var gt=[],it=[],at=Ce?[]:null,St=[],ht=0;ht<Ze;++ht){var Rt=ot[ht],Zt={value:k(Rt),primKey:De[He+ht]};se.call(Zt,Zt.value,Zt)!==!1&&(Zt.value==null?St.push(De[He+ht]):Ce||ln(Re(Rt),Re(Zt.value))===0?(it.push(Zt.value),Ce&&at.push(De[He+ht])):(St.push(De[He+ht]),gt.push(Zt.value)))}return Promise.resolve(0<gt.length&&le.mutate({trans:A,type:"add",values:gt}).then(function(on){for(var rn in on.failures)St.splice(parseInt(rn),1);Pe(gt.length,on)})).then(function(){return(0<it.length||$e&&typeof m=="object")&&le.mutate({trans:A,type:"put",keys:at,values:it,criteria:$e,changeSpec:typeof m!="function"&&m,isAdditionalChunk:0<He}).then(function(on){return Pe(it.length,on)})}).then(function(){return(0<St.length||$e&&m===F_)&&le.mutate({trans:A,type:"delete",keys:St,criteria:$e,isAdditionalChunk:0<He}).then(function(on){return Pe(St.length,on)})}).then(function(){return De.length>He+Ze&&Me(He+Ie)})})}var $e=Nd(E)&&E.limit===1/0&&(typeof m!="function"||m===F_)&&{index:E.index,range:E.range};return Me(0).then(function(){if(0<Se.length)throw new he("Error modifying one or more objects",Se,Te,xe);return De.length})})})},mn.prototype.delete=function(){var m=this._ctx,y=m.range;return Nd(m)&&(m.isPrimKey||y.type===3)?this._write(function(E){var A=m.table.core.schema.primaryKey,N=y;return m.table.core.count({trans:E,query:{index:A,range:N}}).then(function(W){return m.table.core.mutate({trans:E,type:"deleteRange",range:N}).then(function(se){var le=se.failures;if(se.lastResult,se.results,se=se.numFailures,se)throw new he("Could not delete some values",Object.keys(le).map(function(Ce){return le[Ce]}),W-se);return W-se})})}):this.modify(F_)},mn);function mn(){}var F_=function(m,y){return y.value=null};function obe(m,y){return m<y?-1:m===y?0:1}function ibe(m,y){return y<m?-1:m===y?0:1}function Uo(m,y,E){return m=m instanceof KB?new m.Collection(m):m,m._ctx.error=new(E||TypeError)(y),m}function Ld(m){return new m.Collection(m,function(){return jB("")}).limit(0)}function My(m,y,E,A){var N,W,se,le,Ce,Re,Ie,de=E.length;if(!E.every(function(Te){return typeof Te=="string"}))return Uo(m,Ou);function Pe(Te){N=Te==="next"?function(De){return De.toUpperCase()}:function(De){return De.toLowerCase()},W=Te==="next"?function(De){return De.toLowerCase()}:function(De){return De.toUpperCase()},se=Te==="next"?obe:ibe;var xe=E.map(function(De){return{lower:W(De),upper:N(De)}}).sort(function(De,Me){return se(De.lower,Me.lower)});le=xe.map(function(De){return De.upper}),Ce=xe.map(function(De){return De.lower}),Ie=(Re=Te)==="next"?"":A}Pe("next"),m=new m.Collection(m,function(){return ml(le[0],Ce[de-1]+A)}),m._ondirectionchange=function(Te){Pe(Te)};var Se=0;return m._addAlgorithm(function(Te,xe,De){var Me=Te.key;if(typeof Me!="string")return!1;var $e=W(Me);if(y($e,Ce,Se))return!0;for(var He=null,Ze=Se;Ze<de;++Ze){var ot=function(gt,it,at,St,ht,Rt){for(var Zt=Math.min(gt.length,St.length),on=-1,rn=0;rn<Zt;++rn){var Wo=it[rn];if(Wo!==St[rn])return ht(gt[rn],at[rn])<0?gt.substr(0,rn)+at[rn]+at.substr(rn+1):ht(gt[rn],St[rn])<0?gt.substr(0,rn)+St[rn]+at.substr(rn+1):0<=on?gt.substr(0,on)+it[on]+at.substr(on+1):null;ht(gt[rn],Wo)<0&&(on=rn)}return Zt<St.length&&Rt==="next"?gt+at.substr(gt.length):Zt<gt.length&&Rt==="prev"?gt.substr(0,at.length):on<0?null:gt.substr(0,on)+St[on]+at.substr(on+1)}(Me,$e,le[Ze],Ce[Ze],se,Re);ot===null&&He===null?Se=Ze+1:(He===null||0<se(He,ot))&&(He=ot)}return xe(He!==null?function(){Te.continue(He+Ie)}:De),!1}),m}function ml(m,y,E,A){return{type:2,lower:m,upper:y,lowerOpen:E,upperOpen:A}}function jB(m){return{type:1,lower:m,upper:m}}var KB=(Object.defineProperty(Is.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Is.prototype.between=function(m,y,E,A){E=E!==!1,A=A===!0;try{return 0<this._cmp(m,y)||this._cmp(m,y)===0&&(E||A)&&(!E||!A)?Ld(this):new this.Collection(this,function(){return ml(m,y,!E,!A)})}catch{return Uo(this,gi)}},Is.prototype.equals=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return jB(m)})},Is.prototype.above=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!0)})},Is.prototype.aboveOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!1)})},Is.prototype.below=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m,!1,!0)})},Is.prototype.belowOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m)})},Is.prototype.startsWith=function(m){return typeof m!="string"?Uo(this,Ou):this.between(m,m+ya,!0,!0)},Is.prototype.startsWithIgnoreCase=function(m){return m===""?this.startsWith(m):My(this,function(y,E){return y.indexOf(E[0])===0},[m],ya)},Is.prototype.equalsIgnoreCase=function(m){return My(this,function(y,E){return y===E[0]},[m],"")},Is.prototype.anyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.indexOf(y)!==-1},m,"")},Is.prototype.startsWithAnyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.some(function(A){return y.indexOf(A)===0})},m,ya)},Is.prototype.anyOf=function(){var m=this,y=ve.apply(X,arguments),E=this._cmp;try{y.sort(E)}catch{return Uo(this,gi)}if(y.length===0)return Ld(this);var A=new this.Collection(this,function(){return ml(y[0],y[y.length-1])});A._ondirectionchange=function(W){E=W==="next"?m._ascending:m._descending,y.sort(E)};var N=0;return A._addAlgorithm(function(W,se,le){for(var Ce=W.key;0<E(Ce,y[N]);)if(++N===y.length)return se(le),!1;return E(Ce,y[N])===0||(se(function(){W.continue(y[N])}),!1)}),A},Is.prototype.notEqual=function(m){return this.inAnyRange([[-1/0,m],[m,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Is.prototype.noneOf=function(){var m=ve.apply(X,arguments);if(m.length===0)return new this.Collection(this);try{m.sort(this._ascending)}catch{return Uo(this,gi)}var y=m.reduce(function(E,A){return E?E.concat([[E[E.length-1][1],A]]):[[-1/0,A]]},null);return y.push([m[m.length-1],this.db._maxKey]),this.inAnyRange(y,{includeLowers:!1,includeUppers:!1})},Is.prototype.inAnyRange=function(Me,y){var E=this,A=this._cmp,N=this._ascending,W=this._descending,se=this._min,le=this._max;if(Me.length===0)return Ld(this);if(!Me.every(function($e){return $e[0]!==void 0&&$e[1]!==void 0&&N($e[0],$e[1])<=0}))return Uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",z.InvalidArgument);var Ce=!y||y.includeLowers!==!1,Re=y&&y.includeUppers===!0,Ie,de=N;function Pe($e,He){return de($e[0],He[0])}try{(Ie=Me.reduce(function($e,He){for(var Ze=0,ot=$e.length;Ze<ot;++Ze){var gt=$e[Ze];if(A(He[0],gt[1])<0&&0<A(He[1],gt[0])){gt[0]=se(gt[0],He[0]),gt[1]=le(gt[1],He[1]);break}}return Ze===ot&&$e.push(He),$e},[])).sort(Pe)}catch{return Uo(this,gi)}var Se=0,Te=Re?function($e){return 0<N($e,Ie[Se][1])}:function($e){return 0<=N($e,Ie[Se][1])},xe=Ce?function($e){return 0<W($e,Ie[Se][0])}:function($e){return 0<=W($e,Ie[Se][0])},De=Te,Me=new this.Collection(this,function(){return ml(Ie[0][0],Ie[Ie.length-1][1],!Ce,!Re)});return Me._ondirectionchange=function($e){de=$e==="next"?(De=Te,N):(De=xe,W),Ie.sort(Pe)},Me._addAlgorithm(function($e,He,Ze){for(var ot,gt=$e.key;De(gt);)if(++Se===Ie.length)return He(Ze),!1;return!Te(ot=gt)&&!xe(ot)||(E._cmp(gt,Ie[Se][1])===0||E._cmp(gt,Ie[Se][0])===0||He(function(){de===N?$e.continue(Ie[Se][0]):$e.continue(Ie[Se][1])}),!1)}),Me},Is.prototype.startsWithAnyOf=function(){var m=ve.apply(X,arguments);return m.every(function(y){return typeof y=="string"})?m.length===0?Ld(this):this.inAnyRange(m.map(function(y){return[y,y+ya]})):Uo(this,"startsWithAnyOf() only works with strings")},Is);function Is(){}function Ar(m){return kn(function(y){return bp(y),m(y.target.error),!1})}function bp(m){m.stopPropagation&&m.stopPropagation(),m.preventDefault&&m.preventDefault()}var Sp="storagemutated",P_="x-storagemutated-1",vl=yp(null,Sp),rbe=(kr.prototype._lock=function(){return w(!je.global),++this._reculock,this._reculock!==1||je.global||(je.lockOwnerFor=this),this},kr.prototype._unlock=function(){if(w(!je.global),--this._reculock==0)for(je.global||(je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var m=this._blockedFuncs.shift();try{bo(m[1],m[0])}catch{}}return this},kr.prototype._locked=function(){return this._reculock&&je.lockOwnerFor!==this},kr.prototype.create=function(m){var y=this;if(!this.mode)return this;var E=this.db.idbdb,A=this.db._state.dbOpenError;if(w(!this.idbtrans),!m&&!E)switch(A&&A.name){case"DatabaseClosedError":throw new z.DatabaseClosed(A);case"MissingAPIError":throw new z.MissingAPI(A.message,A);default:throw new z.OpenFailed(A)}if(!this.active)throw new z.TransactionInactive;return w(this._completion._state===null),(m=this.idbtrans=m||(this.db.core||E).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=kn(function(N){bp(N),y._reject(m.error)}),m.onabort=kn(function(N){bp(N),y.active&&y._reject(new z.Abort(m.error)),y.active=!1,y.on("abort").fire(N)}),m.oncomplete=kn(function(){y.active=!1,y._resolve(),"mutatedParts"in m&&vl.storagemutated.fire(m.mutatedParts)}),this},kr.prototype._promise=function(m,y,E){var A=this;if(m==="readwrite"&&this.mode!=="readwrite")return Kn(new z.ReadOnly("Transaction is readonly"));if(!this.active)return Kn(new z.TransactionInactive);if(this._locked())return new st(function(W,se){A._blockedFuncs.push([function(){A._promise(m,y,E).then(W,se)},je])});if(E)return Ae(function(){var W=new st(function(se,le){A._lock();var Ce=y(se,le,A);Ce&&Ce.then&&Ce.then(se,le)});return W.finally(function(){return A._unlock()}),W._lib=!0,W});var N=new st(function(W,se){var le=y(W,se,A);le&&le.then&&le.then(W,se)});return N._lib=!0,N},kr.prototype._root=function(){return this.parent?this.parent._root():this},kr.prototype.waitFor=function(m){var y,E=this._root(),A=st.resolve(m);E._waitingFor?E._waitingFor=E._waitingFor.then(function(){return A}):(E._waitingFor=A,E._waitingQueue=[],y=E.idbtrans.objectStore(E.storeNames[0]),function W(){for(++E._spinCount;E._waitingQueue.length;)E._waitingQueue.shift()();E._waitingFor&&(y.get(-1/0).onsuccess=W)}());var N=E._waitingFor;return new st(function(W,se){A.then(function(le){return E._waitingQueue.push(kn(W.bind(null,le)))},function(le){return E._waitingQueue.push(kn(se.bind(null,le)))}).finally(function(){E._waitingFor===N&&(E._waitingFor=null)})})},kr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new z.Abort))},kr.prototype.table=function(m){var y=this._memoizedTables||(this._memoizedTables={});if(d(y,m))return y[m];var E=this.schema[m];if(!E)throw new z.NotFound("Table "+m+" not part of transaction");return E=new this.db.Table(m,E,this),E.core=this.db.core.table(m),y[m]=E},kr);function kr(){}function A_(m,y,E,A,N,W,se){return{name:m,keyPath:y,unique:E,multi:A,auto:N,compound:W,src:(E&&!se?"&":"")+(A?"*":"")+(N?"++":"")+qB(y)}}function qB(m){return typeof m=="string"?m:m?"["+[].join.call(m,"+")+"]":""}function k_(m,y,E){return{name:m,primKey:y,indexes:E,mappedClass:null,idxByName:(A=function(N){return[N.name,N]},E.reduce(function(N,W,se){return se=A(W,se),se&&(N[se[0]]=se[1]),N},{}))};var A}var Ep=function(m){try{return m.only([[]]),Ep=function(){return[[]]},[[]]}catch{return Ep=function(){return ya},ya}};function O_(m){return m==null?function(){}:typeof m=="string"?(y=m).split(".").length===1?function(E){return E[y]}:function(E){return R(E,y)}:function(E){return R(E,m)};var y}function YB(m){return[].slice.call(m)}var abe=0;function _p(m){return m==null?":id":typeof m=="string"?m:"[".concat(m.join("+"),"]")}function lbe(m,y,Ce){function A(De){if(De.type===3)return null;if(De.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var Se=De.lower,Te=De.upper,xe=De.lowerOpen,De=De.upperOpen;return Se===void 0?Te===void 0?null:y.upperBound(Te,!!De):Te===void 0?y.lowerBound(Se,!!xe):y.bound(Se,Te,!!xe,!!De)}function N(Pe){var Se,Te=Pe.name;return{name:Te,schema:Pe,mutate:function(xe){var De=xe.trans,Me=xe.type,$e=xe.keys,He=xe.values,Ze=xe.range;return new Promise(function(ot,gt){ot=kn(ot);var it=De.objectStore(Te),at=it.keyPath==null,St=Me==="put"||Me==="add";if(!St&&Me!=="delete"&&Me!=="deleteRange")throw new Error("Invalid operation type: "+Me);var ht,Rt=($e||He||{length:1}).length;if($e&&He&&$e.length!==He.length)throw new Error("Given keys array must have same length as given values array.");if(Rt===0)return ot({numFailures:0,failures:{},results:[],lastResult:void 0});function Zt(oo){++Wo,bp(oo)}var on=[],rn=[],Wo=0;if(Me==="deleteRange"){if(Ze.type===4)return ot({numFailures:Wo,failures:rn,results:[],lastResult:void 0});Ze.type===3?on.push(ht=it.clear()):on.push(ht=it.delete(A(Ze)))}else{var at=St?at?[He,$e]:[He,null]:[$e,null],Kt=at[0],qs=at[1];if(St)for(var Ys=0;Ys<Rt;++Ys)on.push(ht=qs&&qs[Ys]!==void 0?it[Me](Kt[Ys],qs[Ys]):it[Me](Kt[Ys])),ht.onerror=Zt;else for(Ys=0;Ys<Rt;++Ys)on.push(ht=it[Me](Kt[Ys])),ht.onerror=Zt}function qy(oo){oo=oo.target.result,on.forEach(function(Vu,J_){return Vu.error!=null&&(rn[J_]=Vu.error)}),ot({numFailures:Wo,failures:rn,results:Me==="delete"?$e:on.map(function(Vu){return Vu.result}),lastResult:oo})}ht.onerror=function(oo){Zt(oo),qy(oo)},ht.onsuccess=qy})},getMany:function(xe){var De=xe.trans,Me=xe.keys;return new Promise(function($e,He){$e=kn($e);for(var Ze,ot=De.objectStore(Te),gt=Me.length,it=new Array(gt),at=0,St=0,ht=function(on){on=on.target,it[on._pos]=on.result,++St===at&&$e(it)},Rt=Ar(He),Zt=0;Zt<gt;++Zt)Me[Zt]!=null&&((Ze=ot.get(Me[Zt]))._pos=Zt,Ze.onsuccess=ht,Ze.onerror=Rt,++at);at===0&&$e(it)})},get:function(xe){var De=xe.trans,Me=xe.key;return new Promise(function($e,He){$e=kn($e);var Ze=De.objectStore(Te).get(Me);Ze.onsuccess=function(ot){return $e(ot.target.result)},Ze.onerror=Ar(He)})},query:(Se=Re,function(xe){return new Promise(function(De,Me){De=kn(De);var $e,He,Ze,at=xe.trans,ot=xe.values,gt=xe.limit,ht=xe.query,it=gt===1/0?void 0:gt,St=ht.index,ht=ht.range,at=at.objectStore(Te),St=St.isPrimaryKey?at:at.index(St.name),ht=A(ht);if(gt===0)return De({result:[]});Se?((it=ot?St.getAll(ht,it):St.getAllKeys(ht,it)).onsuccess=function(Rt){return De({result:Rt.target.result})},it.onerror=Ar(Me)):($e=0,He=!ot&&"openKeyCursor"in St?St.openKeyCursor(ht):St.openCursor(ht),Ze=[],He.onsuccess=function(Rt){var Zt=He.result;return Zt?(Ze.push(ot?Zt.value:Zt.primaryKey),++$e===gt?De({result:Ze}):void Zt.continue()):De({result:Ze})},He.onerror=Ar(Me))})}),openCursor:function(xe){var De=xe.trans,Me=xe.values,$e=xe.query,He=xe.reverse,Ze=xe.unique;return new Promise(function(ot,gt){ot=kn(ot);var St=$e.index,it=$e.range,at=De.objectStore(Te),at=St.isPrimaryKey?at:at.index(St.name),St=He?Ze?"prevunique":"prev":Ze?"nextunique":"next",ht=!Me&&"openKeyCursor"in at?at.openKeyCursor(A(it),St):at.openCursor(A(it),St);ht.onerror=Ar(gt),ht.onsuccess=kn(function(Rt){var Zt,on,rn,Wo,Kt=ht.result;Kt?(Kt.___id=++abe,Kt.done=!1,Zt=Kt.continue.bind(Kt),on=(on=Kt.continuePrimaryKey)&&on.bind(Kt),rn=Kt.advance.bind(Kt),Wo=function(){throw new Error("Cursor not stopped")},Kt.trans=De,Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=function(){throw new Error("Cursor not started")},Kt.fail=kn(gt),Kt.next=function(){var qs=this,Ys=1;return this.start(function(){return Ys--?qs.continue():qs.stop()}).then(function(){return qs})},Kt.start=function(qs){function Ys(){if(ht.result)try{qs()}catch(oo){Kt.fail(oo)}else Kt.done=!0,Kt.start=function(){throw new Error("Cursor behind last entry")},Kt.stop()}var qy=new Promise(function(oo,Vu){oo=kn(oo),ht.onerror=Ar(Vu),Kt.fail=Vu,Kt.stop=function(J_){Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=Wo,oo(J_)}});return ht.onsuccess=kn(function(oo){ht.onsuccess=Ys,Ys()}),Kt.continue=Zt,Kt.continuePrimaryKey=on,Kt.advance=rn,Ys(),qy},ot(Kt)):ot(null)},gt)})},count:function(xe){var De=xe.query,Me=xe.trans,$e=De.index,He=De.range;return new Promise(function(Ze,ot){var gt=Me.objectStore(Te),it=$e.isPrimaryKey?gt:gt.index($e.name),gt=A(He),it=gt?it.count(gt):it.count();it.onsuccess=kn(function(at){return Ze(at.target.result)}),it.onerror=Ar(ot)})}}}var W,se,le,Ie=(se=Ce,le=YB((W=m).objectStoreNames),{schema:{name:W.name,tables:le.map(function(Pe){return se.objectStore(Pe)}).map(function(Pe){var Se=Pe.keyPath,De=Pe.autoIncrement,Te=a(Se),xe={},De={name:Pe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Se==null,compound:Te,keyPath:Se,autoIncrement:De,unique:!0,extractKey:O_(Se)},indexes:YB(Pe.indexNames).map(function(Me){return Pe.index(Me)}).map(function(Ze){var $e=Ze.name,He=Ze.unique,ot=Ze.multiEntry,Ze=Ze.keyPath,ot={name:$e,compound:a(Ze),keyPath:Ze,unique:He,multiEntry:ot,extractKey:O_(Ze)};return xe[_p(Ze)]=ot}),getIndexByKeyPath:function(Me){return xe[_p(Me)]}};return xe[":id"]=De.primaryKey,Se!=null&&(xe[_p(Se)]=De.primaryKey),De})},hasGetAll:0<le.length&&"getAll"in se.objectStore(le[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=Ie.schema,Re=Ie.hasGetAll,Ie=Ce.tables.map(N),de={};return Ie.forEach(function(Pe){return de[Pe.name]=Pe}),{stack:"dbcore",transaction:m.transaction.bind(m),table:function(Pe){if(!de[Pe])throw new Error("Table '".concat(Pe,"' not found"));return de[Pe]},MIN_KEY:-1/0,MAX_KEY:Ep(y),schema:Ce}}function ube(m,y,E,A){var N=E.IDBKeyRange;return E.indexedDB,{dbcore:(A=lbe(y,N,A),m.dbcore.reduce(function(W,se){return se=se.create,s(s({},W),se(W))},A))}}function Ny(m,A){var E=A.db,A=ube(m._middlewares,E,m._deps,A);m.core=A.dbcore,m.tables.forEach(function(N){var W=N.name;m.core.schema.tables.some(function(se){return se.name===W})&&(N.core=m.core.table(W),m[W]instanceof m.Table&&(m[W].core=N.core))})}function Ly(m,y,E,A){E.forEach(function(N){var W=A[N];y.forEach(function(se){var le=function Ce(Re,Ie){return v(Re,Ie)||(Re=u(Re))&&Ce(Re,Ie)}(se,N);(!le||"value"in le&&le.value===void 0)&&(se===m.Transaction.prototype||se instanceof m.Transaction?p(se,N,{get:function(){return this.table(N)},set:function(Ce){f(this,N,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):se[N]=new m.Table(N,W))})})}function M_(m,y){y.forEach(function(E){for(var A in E)E[A]instanceof m.Table&&delete E[A]})}function cbe(m,y){return m._cfg.version-y._cfg.version}function dbe(m,y,E,A){var N=m._dbSchema;E.objectStoreNames.contains("$meta")&&!N.$meta&&(N.$meta=k_("$meta",XB("")[0],[]),m._storeNames.push("$meta"));var W=m._createTransaction("readwrite",m._storeNames,N);W.create(E),W._completion.catch(A);var se=W._reject.bind(W),le=je.transless||je;Ae(function(){return je.trans=W,je.transless=le,y!==0?(Ny(m,E),Re=y,((Ce=W).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(Ie){return Ie??Re}):st.resolve(Re)).then(function(Ie){return Pe=Ie,Se=W,Te=E,xe=[],Ie=(de=m)._versions,De=de._dbSchema=By(0,de.idbdb,Te),(Ie=Ie.filter(function(Me){return Me._cfg.version>=Pe})).length!==0?(Ie.forEach(function(Me){xe.push(function(){var $e=De,He=Me._cfg.dbschema;$y(de,$e,Te),$y(de,He,Te),De=de._dbSchema=He;var Ze=N_($e,He);Ze.add.forEach(function(St){L_(Te,St[0],St[1].primKey,St[1].indexes)}),Ze.change.forEach(function(St){if(St.recreate)throw new z.Upgrade("Not yet support for changing primary key");var ht=Te.objectStore(St.name);St.add.forEach(function(Rt){return Vy(ht,Rt)}),St.change.forEach(function(Rt){ht.deleteIndex(Rt.name),Vy(ht,Rt)}),St.del.forEach(function(Rt){return ht.deleteIndex(Rt)})});var ot=Me._cfg.contentUpgrade;if(ot&&Me._cfg.version>Pe){Ny(de,Te),Se._memoizedTables={};var gt=I(He);Ze.del.forEach(function(St){gt[St]=$e[St]}),M_(de,[de.Transaction.prototype]),Ly(de,[de.Transaction.prototype],r(gt),gt),Se.schema=gt;var it,at=ne(ot);return at&&Ye(),Ze=st.follow(function(){var St;(it=ot(Se))&&at&&(St=jt.bind(null,null),it.then(St,St))}),it&&typeof it.then=="function"?st.resolve(it):Ze.then(function(){return it})}}),xe.push(function($e){var He,Ze,ot=Me._cfg.dbschema;He=ot,Ze=$e,[].slice.call(Ze.db.objectStoreNames).forEach(function(gt){return He[gt]==null&&Ze.db.deleteObjectStore(gt)}),M_(de,[de.Transaction.prototype]),Ly(de,[de.Transaction.prototype],de._storeNames,de._dbSchema),Se.schema=de._dbSchema}),xe.push(function($e){de.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(de.idbdb.version/10)===Me._cfg.version?(de.idbdb.deleteObjectStore("$meta"),delete de._dbSchema.$meta,de._storeNames=de._storeNames.filter(function(He){return He!=="$meta"})):$e.objectStore("$meta").put(Me._cfg.version,"version"))})}),function Me(){return xe.length?st.resolve(xe.shift()(Se.idbtrans)).then(Me):st.resolve()}().then(function(){ZB(De,Te)})):st.resolve();var de,Pe,Se,Te,xe,De}).catch(se)):(r(N).forEach(function(Ie){L_(E,Ie,N[Ie].primKey,N[Ie].indexes)}),Ny(m,E),void st.follow(function(){return m.on.populate.fire(W)}).catch(se));var Ce,Re})}function hbe(m,y){ZB(m._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var E=By(0,m.idbdb,y);$y(m,m._dbSchema,y);for(var A=0,N=N_(E,m._dbSchema).change;A<N.length;A++){var W=function(se){if(se.change.length||se.recreate)return console.warn("Unable to patch indexes of table ".concat(se.name," because it has changes on the type of index or primary key.")),{value:void 0};var le=y.objectStore(se.name);se.add.forEach(function(Ce){$&&console.debug("Dexie upgrade patch: Creating missing index ".concat(se.name,".").concat(Ce.src)),Vy(le,Ce)})}(N[A]);if(typeof W=="object")return W.value}}function N_(m,y){var E,A={del:[],add:[],change:[]};for(E in m)y[E]||A.del.push(E);for(E in y){var N=m[E],W=y[E];if(N){var se={name:E,def:W,recreate:!1,del:[],add:[],change:[]};if(""+(N.primKey.keyPath||"")!=""+(W.primKey.keyPath||"")||N.primKey.auto!==W.primKey.auto)se.recreate=!0,A.change.push(se);else{var le=N.idxByName,Ce=W.idxByName,Re=void 0;for(Re in le)Ce[Re]||se.del.push(Re);for(Re in Ce){var Ie=le[Re],de=Ce[Re];Ie?Ie.src!==de.src&&se.change.push(de):se.add.push(de)}(0<se.del.length||0<se.add.length||0<se.change.length)&&A.change.push(se)}}else A.add.push([E,W])}return A}function L_(m,y,E,A){var N=m.db.createObjectStore(y,E.keyPath?{keyPath:E.keyPath,autoIncrement:E.auto}:{autoIncrement:E.auto});return A.forEach(function(W){return Vy(N,W)}),N}function ZB(m,y){r(m).forEach(function(E){y.db.objectStoreNames.contains(E)||($&&console.debug("Dexie: Creating missing table",E),L_(y,E,m[E].primKey,m[E].indexes))})}function Vy(m,y){m.createIndex(y.name,y.keyPath,{unique:y.unique,multiEntry:y.multi})}function By(m,y,E){var A={};return S(y.objectStoreNames,0).forEach(function(N){for(var W=E.objectStore(N),se=A_(qB(Re=W.keyPath),Re||"",!0,!1,!!W.autoIncrement,Re&&typeof Re!="string",!0),le=[],Ce=0;Ce<W.indexNames.length;++Ce){var Ie=W.index(W.indexNames[Ce]),Re=Ie.keyPath,Ie=A_(Ie.name,Re,!!Ie.unique,!!Ie.multiEntry,!1,Re&&typeof Re!="string",!1);le.push(Ie)}A[N]=k_(N,se,le)}),A}function $y(m,y,E){for(var A=E.db.objectStoreNames,N=0;N<A.length;++N){var W=A[N],se=E.objectStore(W);m._hasGetAll="getAll"in se;for(var le=0;le<se.indexNames.length;++le){var Ce=se.indexNames[le],Re=se.index(Ce).keyPath,Ie=typeof Re=="string"?Re:"["+S(Re).join("+")+"]";!y[W]||(Re=y[W].idxByName[Ie])&&(Re.name=Ce,delete y[W].idxByName[Ie],y[W].idxByName[Ce]=Re)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(m._hasGetAll=!1)}function XB(m){return m.split(",").map(function(y,E){var A=(y=y.trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(A)?A.match(/^\[(.*)\]$/)[1].split("+"):A;return A_(A,N||null,/\&/.test(y),/\*/.test(y),/\+\+/.test(y),a(N),E===0)})}var fbe=(Hy.prototype._parseStoresSpec=function(m,y){r(m).forEach(function(E){if(m[E]!==null){var A=XB(m[E]),N=A.shift();if(N.unique=!0,N.multi)throw new z.Schema("Primary key cannot be multi-valued");A.forEach(function(W){if(W.auto)throw new z.Schema("Only primary key can be marked as autoIncrement (++)");if(!W.keyPath)throw new z.Schema("Index must have a name and cannot be an empty string")}),y[E]=k_(E,N,A)}})},Hy.prototype.stores=function(E){var y=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,E):E;var E=y._versions,A={},N={};return E.forEach(function(W){l(A,W._cfg.storesSource),N=W._cfg.dbschema={},W._parseStoresSpec(A,N)}),y._dbSchema=N,M_(y,[y._allTables,y,y.Transaction.prototype]),Ly(y,[y._allTables,y,y.Transaction.prototype,this._cfg.tables],r(N),N),y._storeNames=r(N),this},Hy.prototype.upgrade=function(m){return this._cfg.contentUpgrade=M(this._cfg.contentUpgrade||be,m),this},Hy);function Hy(){}function V_(m,y){var E=m._dbNamesDB;return E||(E=m._dbNamesDB=new Ca(Py,{addons:[],indexedDB:m,IDBKeyRange:y})).version(1).stores({dbnames:"name"}),E.table("dbnames")}function B_(m){return m&&typeof m.databases=="function"}function $_(m){return Ae(function(){return je.letThrough=!0,m()})}function H_(m){return!("from"in m)}var Ks=function(m,y){if(!this){var E=new Ks;return m&&"d"in m&&l(E,m),E}l(this,arguments.length?{d:1,from:m,to:1<arguments.length?y:m}:{d:0})};function Rp(m,y,E){var A=ln(y,E);if(!isNaN(A)){if(0<A)throw RangeError();if(H_(m))return l(m,{from:y,to:E,d:1});var N=m.l,A=m.r;if(ln(E,m.from)<0)return N?Rp(N,y,E):m.l={from:y,to:E,d:1,l:null,r:null},QB(m);if(0<ln(y,m.to))return A?Rp(A,y,E):m.r={from:y,to:E,d:1,l:null,r:null},QB(m);ln(y,m.from)<0&&(m.from=y,m.l=null,m.d=A?A.d+1:1),0<ln(E,m.to)&&(m.to=E,m.r=null,m.d=m.l?m.l.d+1:1),E=!m.r,N&&!m.l&&Dp(m,N),A&&E&&Dp(m,A)}}function Dp(m,y){H_(y)||function E(A,Ce){var W=Ce.from,se=Ce.to,le=Ce.l,Ce=Ce.r;Rp(A,W,se),le&&E(A,le),Ce&&E(A,Ce)}(m,y)}function JB(m,y){var E=Gy(y),A=E.next();if(A.done)return!1;for(var N=A.value,W=Gy(m),se=W.next(N.from),le=se.value;!A.done&&!se.done;){if(ln(le.from,N.to)<=0&&0<=ln(le.to,N.from))return!0;ln(N.from,le.from)<0?N=(A=E.next(le.from)).value:le=(se=W.next(N.from)).value}return!1}function Gy(m){var y=H_(m)?null:{s:0,n:m};return{next:function(E){for(var A=0<arguments.length;y;)switch(y.s){case 0:if(y.s=1,A)for(;y.n.l&&ln(E,y.n.from)<0;)y={up:y,n:y.n.l,s:1};else for(;y.n.l;)y={up:y,n:y.n.l,s:1};case 1:if(y.s=2,!A||ln(E,y.n.to)<=0)return{value:y.n,done:!1};case 2:if(y.n.r){y.s=3,y={up:y,n:y.n.r,s:0};continue}case 3:y=y.up}return{done:!0}}}}function QB(m){var y,E,A=(((y=m.r)===null||y===void 0?void 0:y.d)||0)-(((E=m.l)===null||E===void 0?void 0:E.d)||0),N=1<A?"r":A<-1?"l":"";N&&(y=N=="r"?"l":"r",E=s({},m),A=m[N],m.from=A.from,m.to=A.to,m[N]=A[N],E[N]=A[y],(m[y]=E).d=e$(E)),m.d=e$(m)}function e$(E){var y=E.r,E=E.l;return(y?E?Math.max(y.d,E.d):y.d:E?E.d:0)+1}function Uy(m,y){return r(y).forEach(function(E){m[E]?Dp(m[E],y[E]):m[E]=function A(N){var W,se,le={};for(W in N)d(N,W)&&(se=N[W],le[W]=!se||typeof se!="object"||D.has(se.constructor)?se:A(se));return le}(y[E])}),m}function G_(m,y){return m.all||y.all||Object.keys(m).some(function(E){return y[E]&&JB(y[E],m[E])})}h(Ks.prototype,((mi={add:function(m){return Dp(this,m),this},addKey:function(m){return Rp(this,m,m),this},addKeys:function(m){var y=this;return m.forEach(function(E){return Rp(y,E,E)}),this},hasKey:function(m){var y=Gy(this).next(m).value;return y&&ln(y.from,m)<=0&&0<=ln(y.to,m)}})[Z]=function(){return Gy(this)},mi));var Nu={},U_={},W_=!1;function Wy(m){Uy(U_,m),W_||(W_=!0,setTimeout(function(){W_=!1,z_(U_,!(U_={}))},0))}function z_(m,y){y===void 0&&(y=!1);var E=new Set;if(m.all)for(var A=0,N=Object.values(Nu);A<N.length;A++)t$(se=N[A],m,E,y);else for(var W in m){var se,le=/^idb\:\/\/(.*)\/(.*)\//.exec(W);le&&(W=le[1],le=le[2],(se=Nu["idb://".concat(W,"/").concat(le)])&&t$(se,m,E,y))}E.forEach(function(Ce){return Ce()})}function t$(m,y,E,A){for(var N=[],W=0,se=Object.entries(m.queries.query);W<se.length;W++){for(var le=se[W],Ce=le[0],Re=[],Ie=0,de=le[1];Ie<de.length;Ie++){var Pe=de[Ie];G_(y,Pe.obsSet)?Pe.subscribers.forEach(function(De){return E.add(De)}):A&&Re.push(Pe)}A&&N.push([Ce,Re])}if(A)for(var Se=0,Te=N;Se<Te.length;Se++){var xe=Te[Se],Ce=xe[0],Re=xe[1];m.queries.query[Ce]=Re}}function pbe(m){var y=m._state,E=m._deps.indexedDB;if(y.isBeingOpened||m.idbdb)return y.dbReadyPromise.then(function(){return y.dbOpenError?Kn(y.dbOpenError):m});y.isBeingOpened=!0,y.dbOpenError=null,y.openComplete=!1;var A=y.openCanceller,N=Math.round(10*m.verno),W=!1;function se(){if(y.openCanceller!==A)throw new z.DatabaseClosed("db.open() was cancelled")}function le(){return new st(function(Pe,Se){if(se(),!E)throw new z.MissingAPI;var Te=m.name,xe=y.autoSchema||!N?E.open(Te):E.open(Te,N);if(!xe)throw new z.MissingAPI;xe.onerror=Ar(Se),xe.onblocked=kn(m._fireOnBlocked),xe.onupgradeneeded=kn(function(De){var Me;Ie=xe.transaction,y.autoSchema&&!m._options.allowEmptyDB?(xe.onerror=bp,Ie.abort(),xe.result.close(),(Me=E.deleteDatabase(Te)).onsuccess=Me.onerror=kn(function(){Se(new z.NoSuchDatabase("Database ".concat(Te," doesnt exist")))})):(Ie.onerror=Ar(Se),De=De.oldVersion>Math.pow(2,62)?0:De.oldVersion,de=De<1,m.idbdb=xe.result,W&&hbe(m,Ie),dbe(m,De/10,Ie,Se))},Se),xe.onsuccess=kn(function(){Ie=null;var De,Me,$e,He,Ze,ot=m.idbdb=xe.result,gt=S(ot.objectStoreNames);if(0<gt.length)try{var it=ot.transaction((He=gt).length===1?He[0]:He,"readonly");if(y.autoSchema)Me=ot,$e=it,(De=m).verno=Me.version/10,$e=De._dbSchema=By(0,Me,$e),De._storeNames=S(Me.objectStoreNames,0),Ly(De,[De._allTables],r($e),$e);else if($y(m,m._dbSchema,it),((Ze=N_(By(0,(Ze=m).idbdb,it),Ze._dbSchema)).add.length||Ze.change.some(function(at){return at.add.length||at.change.length}))&&!W)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ot.close(),N=ot.version+1,W=!0,Pe(le());Ny(m,it)}catch{}Md.push(m),ot.onversionchange=kn(function(at){y.vcFired=!0,m.on("versionchange").fire(at)}),ot.onclose=kn(function(at){m.on("close").fire(at)}),de&&(Ze=m._deps,it=Te,ot=Ze.indexedDB,Ze=Ze.IDBKeyRange,B_(ot)||it===Py||V_(ot,Ze).put({name:it}).catch(be)),Pe()},Se)}).catch(function(Pe){switch(Pe==null?void 0:Pe.name){case"UnknownError":if(0<y.PR1398_maxLoop)return y.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),le();break;case"VersionError":if(0<N)return N=0,le()}return st.reject(Pe)})}var Ce,Re=y.dbReadyResolve,Ie=null,de=!1;return st.race([A,(typeof navigator>"u"?st.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Pe){function Se(){return indexedDB.databases().finally(Pe)}Ce=setInterval(Se,100),Se()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(le)]).then(function(){return se(),y.onReadyBeingFired=[],st.resolve($_(function(){return m.on.ready.fire(m.vip)})).then(function Pe(){if(0<y.onReadyBeingFired.length){var Se=y.onReadyBeingFired.reduce(M,be);return y.onReadyBeingFired=[],st.resolve($_(function(){return Se(m.vip)})).then(Pe)}})}).finally(function(){y.openCanceller===A&&(y.onReadyBeingFired=null,y.isBeingOpened=!1)}).catch(function(Pe){y.dbOpenError=Pe;try{Ie&&Ie.abort()}catch{}return A===y.openCanceller&&m._close(),Kn(Pe)}).finally(function(){y.openComplete=!0,Re()}).then(function(){var Pe;return de&&(Pe={},m.tables.forEach(function(Se){Se.schema.indexes.forEach(function(Te){Te.name&&(Pe["idb://".concat(m.name,"/").concat(Se.name,"/").concat(Te.name)]=new Ks(-1/0,[[[]]]))}),Pe["idb://".concat(m.name,"/").concat(Se.name,"/")]=Pe["idb://".concat(m.name,"/").concat(Se.name,"/:dels")]=new Ks(-1/0,[[[]]])}),vl(Sp).fire(Pe),z_(Pe,!0)),m})}function j_(m){function y(W){return m.next(W)}var E=N(y),A=N(function(W){return m.throw(W)});function N(W){return function(Ce){var le=W(Ce),Ce=le.value;return le.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(E,A):a(Ce)?Promise.all(Ce).then(E,A):E(Ce)}}return N(y)()}function zy(m,y,E){for(var A=a(m)?m.slice():[m],N=0;N<E;++N)A.push(y);return A}var gbe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema,N={},W=[];function se(de,Pe,Se){var Te=_p(de),xe=N[Te]=N[Te]||[],De=de==null?0:typeof de=="string"?1:de.length,Me=0<Pe,Me=s(s({},Se),{name:Me?"".concat(Te,"(virtual-from:").concat(Se.name,")"):Se.name,lowLevelIndex:Se,isVirtual:Me,keyTail:Pe,keyLength:De,extractKey:O_(de),unique:!Me&&Se.unique});return xe.push(Me),Me.isPrimaryKey||W.push(Me),1<De&&se(De===2?de[0]:de.slice(0,De-1),Pe+1,Se),xe.sort(function($e,He){return $e.keyTail-He.keyTail}),Me}y=se(A.primaryKey.keyPath,0,A.primaryKey),N[":id"]=[y];for(var le=0,Ce=A.indexes;le<Ce.length;le++){var Re=Ce[le];se(Re.keyPath,0,Re)}function Ie(de){var Pe,Se=de.query.index;return Se.isVirtual?s(s({},de),{query:{index:Se.lowLevelIndex,range:(Pe=de.query.range,Se=Se.keyTail,{type:Pe.type===1?2:Pe.type,lower:zy(Pe.lower,Pe.lowerOpen?m.MAX_KEY:m.MIN_KEY,Se),lowerOpen:!0,upper:zy(Pe.upper,Pe.upperOpen?m.MIN_KEY:m.MAX_KEY,Se),upperOpen:!0})}}):de}return s(s({},E),{schema:s(s({},A),{primaryKey:y,indexes:W,getIndexByKeyPath:function(de){return(de=N[_p(de)])&&de[0]}}),count:function(de){return E.count(Ie(de))},query:function(de){return E.query(Ie(de))},openCursor:function(de){var Pe=de.query.index,Se=Pe.keyTail,Te=Pe.isVirtual,xe=Pe.keyLength;return Te?E.openCursor(Ie(de)).then(function(Me){return Me&&De(Me)}):E.openCursor(de);function De(Me){return Object.create(Me,{continue:{value:function($e){$e!=null?Me.continue(zy($e,de.reverse?m.MAX_KEY:m.MIN_KEY,Se)):de.unique?Me.continue(Me.key.slice(0,xe).concat(de.reverse?m.MIN_KEY:m.MAX_KEY,Se)):Me.continue()}},continuePrimaryKey:{value:function($e,He){Me.continuePrimaryKey(zy($e,m.MAX_KEY,Se),He)}},primaryKey:{get:function(){return Me.primaryKey}},key:{get:function(){var $e=Me.key;return xe===1?$e[0]:$e.slice(0,xe)}},value:{get:function(){return Me.value}}})}}})}})}};function K_(m,y,E,A){return E=E||{},A=A||"",r(m).forEach(function(N){var W,se,le;d(y,N)?(W=m[N],se=y[N],typeof W=="object"&&typeof se=="object"&&W&&se?(le=B(W))!==B(se)?E[A+N]=y[N]:le==="Object"?K_(W,se,E,A+N+"."):W!==se&&(E[A+N]=y[N]):W!==se&&(E[A+N]=y[N])):E[A+N]=void 0}),r(y).forEach(function(N){d(m,N)||(E[A+N]=y[N])}),E}function q_(m,y){return y.type==="delete"?y.keys:y.keys||y.values.map(m.extractKey)}var mbe={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema.primaryKey;return s(s({},E),{mutate:function(N){var W=je.trans,se=W.table(y).hook,le=se.deleting,Ce=se.creating,Re=se.updating;switch(N.type){case"add":if(Ce.fire===be)break;return W._promise("readwrite",function(){return Ie(N)},!0);case"put":if(Ce.fire===be&&Re.fire===be)break;return W._promise("readwrite",function(){return Ie(N)},!0);case"delete":if(le.fire===be)break;return W._promise("readwrite",function(){return Ie(N)},!0);case"deleteRange":if(le.fire===be)break;return W._promise("readwrite",function(){return function de(Pe,Se,Te){return E.query({trans:Pe,values:!1,query:{index:A,range:Se},limit:Te}).then(function(xe){var De=xe.result;return Ie({type:"delete",keys:De,trans:Pe}).then(function(Me){return 0<Me.numFailures?Promise.reject(Me.failures[0]):De.length<Te?{failures:[],numFailures:0,lastResult:void 0}:de(Pe,s(s({},Se),{lower:De[De.length-1],lowerOpen:!0}),Te)})})}(N.trans,N.range,1e4)},!0)}return E.mutate(N);function Ie(de){var Pe,Se,Te,xe=je.trans,De=de.keys||q_(A,de);if(!De)throw new Error("Keys missing");return(de=de.type==="add"||de.type==="put"?s(s({},de),{keys:De}):s({},de)).type!=="delete"&&(de.values=o([],de.values)),de.keys&&(de.keys=o([],de.keys)),Pe=E,Te=De,((Se=de).type==="add"?Promise.resolve([]):Pe.getMany({trans:Se.trans,keys:Te,cache:"immutable"})).then(function(Me){var $e=De.map(function(He,Ze){var ot,gt,it,at=Me[Ze],St={onerror:null,onsuccess:null};return de.type==="delete"?le.fire.call(St,He,at,xe):de.type==="add"||at===void 0?(ot=Ce.fire.call(St,He,de.values[Ze],xe),He==null&&ot!=null&&(de.keys[Ze]=He=ot,A.outbound||T(de.values[Ze],A.keyPath,He))):(ot=K_(at,de.values[Ze]),(gt=Re.fire.call(St,ot,He,at,xe))&&(it=de.values[Ze],Object.keys(gt).forEach(function(ht){d(it,ht)?it[ht]=gt[ht]:T(it,ht,gt[ht])}))),St});return E.mutate(de).then(function(He){for(var Ze=He.failures,ot=He.results,gt=He.numFailures,He=He.lastResult,it=0;it<De.length;++it){var at=(ot||De)[it],St=$e[it];at==null?St.onerror&&St.onerror(Ze[it]):St.onsuccess&&St.onsuccess(de.type==="put"&&Me[it]?de.values[it]:at)}return{failures:Ze,results:ot,numFailures:gt,lastResult:He}}).catch(function(He){return $e.forEach(function(Ze){return Ze.onerror&&Ze.onerror(He)}),Promise.reject(He)})})}}})}})}};function n$(m,y,E){try{if(!y||y.keys.length<m.length)return null;for(var A=[],N=0,W=0;N<y.keys.length&&W<m.length;++N)ln(y.keys[N],m[W])===0&&(A.push(E?k(y.values[N]):y.values[N]),++W);return A.length===m.length?A:null}catch{return null}}var vbe={stack:"dbcore",level:-1,create:function(m){return{table:function(y){var E=m.table(y);return s(s({},E),{getMany:function(A){if(!A.cache)return E.getMany(A);var N=n$(A.keys,A.trans._cache,A.cache==="clone");return N?st.resolve(N):E.getMany(A).then(function(W){return A.trans._cache={keys:A.keys,values:A.cache==="clone"?k(W):W},W})},mutate:function(A){return A.type!=="add"&&(A.trans._cache=null),E.mutate(A)}})}}}};function s$(m,y){return m.trans.mode==="readonly"&&!!m.subscr&&!m.trans.explicit&&m.trans.db._options.cache!=="disabled"&&!y.schema.primaryKey.outbound}function o$(m,y){switch(m){case"query":return y.values&&!y.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ybe={stack:"dbcore",level:0,name:"Observability",create:function(m){var y=m.schema.name,E=new Ks(m.MIN_KEY,m.MAX_KEY);return s(s({},m),{transaction:function(A,N,W){if(je.subscr&&N!=="readonly")throw new z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(je.querier));return m.transaction(A,N,W)},table:function(A){var N=m.table(A),W=N.schema,se=W.primaryKey,de=W.indexes,le=se.extractKey,Ce=se.outbound,Re=se.autoIncrement&&de.filter(function(Se){return Se.compound&&Se.keyPath.includes(se.keyPath)}),Ie=s(s({},N),{mutate:function(Se){function Te(ht){return ht="idb://".concat(y,"/").concat(A,"/").concat(ht),He[ht]||(He[ht]=new Ks)}var xe,De,Me,$e=Se.trans,He=Se.mutatedParts||(Se.mutatedParts={}),Ze=Te(""),ot=Te(":dels"),gt=Se.type,St=Se.type==="deleteRange"?[Se.range]:Se.type==="delete"?[Se.keys]:Se.values.length<50?[q_(se,Se).filter(function(ht){return ht}),Se.values]:[],it=St[0],at=St[1],St=Se.trans._cache;return a(it)?(Ze.addKeys(it),(St=gt==="delete"||it.length===at.length?n$(it,St):null)||ot.addKeys(it),(St||at)&&(xe=Te,De=St,Me=at,W.indexes.forEach(function(ht){var Rt=xe(ht.name||"");function Zt(rn){return rn!=null?ht.extractKey(rn):null}function on(rn){return ht.multiEntry&&a(rn)?rn.forEach(function(Wo){return Rt.addKey(Wo)}):Rt.addKey(rn)}(De||Me).forEach(function(rn,qs){var Kt=De&&Zt(De[qs]),qs=Me&&Zt(Me[qs]);ln(Kt,qs)!==0&&(Kt!=null&&on(Kt),qs!=null&&on(qs))})}))):it?(at={from:(at=it.lower)!==null&&at!==void 0?at:m.MIN_KEY,to:(at=it.upper)!==null&&at!==void 0?at:m.MAX_KEY},ot.add(at),Ze.add(at)):(Ze.add(E),ot.add(E),W.indexes.forEach(function(ht){return Te(ht.name).add(E)})),N.mutate(Se).then(function(ht){return!it||Se.type!=="add"&&Se.type!=="put"||(Ze.addKeys(ht.results),Re&&Re.forEach(function(Rt){for(var Zt=Se.values.map(function(Kt){return Rt.extractKey(Kt)}),on=Rt.keyPath.findIndex(function(Kt){return Kt===se.keyPath}),rn=0,Wo=ht.results.length;rn<Wo;++rn)Zt[rn][on]=ht.results[rn];Te(Rt.name).addKeys(Zt)})),$e.mutatedParts=Uy($e.mutatedParts||{},He),ht})}}),de=function(Te){var xe=Te.query,Te=xe.index,xe=xe.range;return[Te,new Ks((Te=xe.lower)!==null&&Te!==void 0?Te:m.MIN_KEY,(xe=xe.upper)!==null&&xe!==void 0?xe:m.MAX_KEY)]},Pe={get:function(Se){return[se,new Ks(Se.key)]},getMany:function(Se){return[se,new Ks().addKeys(Se.keys)]},count:de,query:de,openCursor:de};return r(Pe).forEach(function(Se){Ie[Se]=function(Te){var xe=je.subscr,De=!!xe,Me=s$(je,N)&&o$(Se,Te)?Te.obsSet={}:xe;if(De){var $e=function(at){return at="idb://".concat(y,"/").concat(A,"/").concat(at),Me[at]||(Me[at]=new Ks)},He=$e(""),Ze=$e(":dels"),xe=Pe[Se](Te),De=xe[0],xe=xe[1];if((Se==="query"&&De.isPrimaryKey&&!Te.values?Ze:$e(De.name||"")).add(xe),!De.isPrimaryKey){if(Se!=="count"){var ot=Se==="query"&&Ce&&Te.values&&N.query(s(s({},Te),{values:!1}));return N[Se].apply(this,arguments).then(function(at){if(Se==="query"){if(Ce&&Te.values)return ot.then(function(Zt){return Zt=Zt.result,He.addKeys(Zt),at});var St=Te.values?at.result.map(le):at.result;(Te.values?He:Ze).addKeys(St)}else if(Se==="openCursor"){var ht=at,Rt=Te.values;return ht&&Object.create(ht,{key:{get:function(){return Ze.addKey(ht.primaryKey),ht.key}},primaryKey:{get:function(){var Zt=ht.primaryKey;return Ze.addKey(Zt),Zt}},value:{get:function(){return Rt&&He.addKey(ht.primaryKey),ht.value}}})}return at})}Ze.add(E)}}return N[Se].apply(this,arguments)}}),Ie}})}};function i$(m,y,E){if(E.numFailures===0)return y;if(y.type==="deleteRange")return null;var A=y.keys?y.keys.length:"values"in y&&y.values?y.values.length:1;return E.numFailures===A?null:(y=s({},y),a(y.keys)&&(y.keys=y.keys.filter(function(N,W){return!(W in E.failures)})),"values"in y&&a(y.values)&&(y.values=y.values.filter(function(N,W){return!(W in E.failures)})),y)}function Y_(m,y){return E=m,((A=y).lower===void 0||(A.lowerOpen?0<ln(E,A.lower):0<=ln(E,A.lower)))&&(m=m,(y=y).upper===void 0||(y.upperOpen?ln(m,y.upper)<0:ln(m,y.upper)<=0));var E,A}function r$(m,y,Pe,A,N,W){if(!Pe||Pe.length===0)return m;var se=y.query.index,le=se.multiEntry,Ce=y.query.range,Re=A.schema.primaryKey.extractKey,Ie=se.extractKey,de=(se.lowLevelIndex||se).extractKey,Pe=Pe.reduce(function(Se,Te){var xe=Se,De=[];if(Te.type==="add"||Te.type==="put")for(var Me=new Ks,$e=Te.values.length-1;0<=$e;--$e){var He,Ze=Te.values[$e],ot=Re(Ze);Me.hasKey(ot)||(He=Ie(Ze),(le&&a(He)?He.some(function(ht){return Y_(ht,Ce)}):Y_(He,Ce))&&(Me.addKey(ot),De.push(Ze)))}switch(Te.type){case"add":var gt=new Ks().addKeys(y.values?Se.map(function(Rt){return Re(Rt)}):Se),xe=Se.concat(y.values?De.filter(function(Rt){return Rt=Re(Rt),!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}):De.map(function(Rt){return Re(Rt)}).filter(function(Rt){return!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}));break;case"put":var it=new Ks().addKeys(Te.values.map(function(Rt){return Re(Rt)}));xe=Se.filter(function(Rt){return!it.hasKey(y.values?Re(Rt):Rt)}).concat(y.values?De:De.map(function(Rt){return Re(Rt)}));break;case"delete":var at=new Ks().addKeys(Te.keys);xe=Se.filter(function(Rt){return!at.hasKey(y.values?Re(Rt):Rt)});break;case"deleteRange":var St=Te.range;xe=Se.filter(function(Rt){return!Y_(Re(Rt),St)})}return xe},m);return Pe===m?m:(Pe.sort(function(Se,Te){return ln(de(Se),de(Te))||ln(Re(Se),Re(Te))}),y.limit&&y.limit<1/0&&(Pe.length>y.limit?Pe.length=y.limit:m.length===y.limit&&Pe.length<y.limit&&(N.dirty=!0)),W?Object.freeze(Pe):Pe)}function a$(m,y){return ln(m.lower,y.lower)===0&&ln(m.upper,y.upper)===0&&!!m.lowerOpen==!!y.lowerOpen&&!!m.upperOpen==!!y.upperOpen}function wbe(m,y){return function(E,A,N,W){if(E===void 0)return A!==void 0?-1:0;if(A===void 0)return 1;if((A=ln(E,A))===0){if(N&&W)return 0;if(N)return 1;if(W)return-1}return A}(m.lower,y.lower,m.lowerOpen,y.lowerOpen)<=0&&0<=function(E,A,N,W){if(E===void 0)return A!==void 0?1:0;if(A===void 0)return-1;if((A=ln(E,A))===0){if(N&&W)return 0;if(N)return-1;if(W)return 1}return A}(m.upper,y.upper,m.upperOpen,y.upperOpen)}function Cbe(m,y,E,A){m.subscribers.add(E),A.addEventListener("abort",function(){var N,W;m.subscribers.delete(E),m.subscribers.size===0&&(N=m,W=y,setTimeout(function(){N.subscribers.size===0&&ee(W,N)},3e3))})}var bbe={stack:"dbcore",level:0,name:"Cache",create:function(m){var y=m.schema.name;return s(s({},m),{transaction:function(E,A,N){var W,se,le=m.transaction(E,A,N);return A==="readwrite"&&(se=(W=new AbortController).signal,N=function(Ce){return function(){if(W.abort(),A==="readwrite"){for(var Re=new Set,Ie=0,de=E;Ie<de.length;Ie++){var Pe=de[Ie],Se=Nu["idb://".concat(y,"/").concat(Pe)];if(Se){var Te=m.table(Pe),xe=Se.optimisticOps.filter(function(Rt){return Rt.trans===le});if(le._explicit&&Ce&&le.mutatedParts)for(var De=0,Me=Object.values(Se.queries.query);De<Me.length;De++)for(var $e=0,He=(gt=Me[De]).slice();$e<He.length;$e++)G_((it=He[$e]).obsSet,le.mutatedParts)&&(ee(gt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)}));else if(0<xe.length){Se.optimisticOps=Se.optimisticOps.filter(function(Rt){return Rt.trans!==le});for(var Ze=0,ot=Object.values(Se.queries.query);Ze<ot.length;Ze++)for(var gt,it,at,St=0,ht=(gt=ot[Ze]).slice();St<ht.length;St++)(it=ht[St]).res!=null&&le.mutatedParts&&(Ce&&!it.dirty?(at=Object.isFrozen(it.res),at=r$(it.res,it.req,xe,Te,it,at),it.dirty?(ee(gt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})):at!==it.res&&(it.res=at,it.promise=st.resolve({result:at}))):(it.dirty&&ee(gt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})))}}}Re.forEach(function(Rt){return Rt()})}}},le.addEventListener("abort",N(!1),{signal:se}),le.addEventListener("error",N(!1),{signal:se}),le.addEventListener("complete",N(!0),{signal:se})),le},table:function(E){var A=m.table(E),N=A.schema.primaryKey;return s(s({},A),{mutate:function(W){var se=je.trans;if(N.outbound||se.db._options.cache==="disabled"||se.explicit||se.idbtrans.mode!=="readwrite")return A.mutate(W);var le=Nu["idb://".concat(y,"/").concat(E)];return le?(se=A.mutate(W),W.type!=="add"&&W.type!=="put"||!(50<=W.values.length||q_(N,W).some(function(Ce){return Ce==null}))?(le.optimisticOps.push(W),W.mutatedParts&&Wy(W.mutatedParts),se.then(function(Ce){0<Ce.numFailures&&(ee(le.optimisticOps,W),(Ce=i$(0,W,Ce))&&le.optimisticOps.push(Ce),W.mutatedParts&&Wy(W.mutatedParts))}),se.catch(function(){ee(le.optimisticOps,W),W.mutatedParts&&Wy(W.mutatedParts)})):se.then(function(Ce){var Re=i$(0,s(s({},W),{values:W.values.map(function(Ie,de){var Pe;return Ce.failures[de]?Ie:(Ie=(Pe=N.keyPath)!==null&&Pe!==void 0&&Pe.includes(".")?k(Ie):s({},Ie),T(Ie,N.keyPath,Ce.results[de]),Ie)})}),Ce);le.optimisticOps.push(Re),queueMicrotask(function(){return W.mutatedParts&&Wy(W.mutatedParts)})}),se):A.mutate(W)},query:function(W){if(!s$(je,A)||!o$("query",W))return A.query(W);var se=((Re=je.trans)===null||Re===void 0?void 0:Re.db._options.cache)==="immutable",de=je,le=de.requery,Ce=de.signal,Re=function(Te,xe,De,Me){var $e=Nu["idb://".concat(Te,"/").concat(xe)];if(!$e)return[];if(!(xe=$e.queries[De]))return[null,!1,$e,null];var He=xe[(Me.query?Me.query.index.name:null)||""];if(!He)return[null,!1,$e,null];switch(De){case"query":var Ze=He.find(function(ot){return ot.req.limit===Me.limit&&ot.req.values===Me.values&&a$(ot.req.query.range,Me.query.range)});return Ze?[Ze,!0,$e,He]:[He.find(function(ot){return("limit"in ot.req?ot.req.limit:1/0)>=Me.limit&&(!Me.values||ot.req.values)&&wbe(ot.req.query.range,Me.query.range)}),!1,$e,He];case"count":return Ze=He.find(function(ot){return a$(ot.req.query.range,Me.query.range)}),[Ze,!!Ze,$e,He]}}(y,E,"query",W),Ie=Re[0],de=Re[1],Pe=Re[2],Se=Re[3];return Ie&&de?Ie.obsSet=W.obsSet:(de=A.query(W).then(function(Te){var xe=Te.result;if(Ie&&(Ie.res=xe),se){for(var De=0,Me=xe.length;De<Me;++De)Object.freeze(xe[De]);Object.freeze(xe)}else Te.result=k(xe);return Te}).catch(function(Te){return Se&&Ie&&ee(Se,Ie),Promise.reject(Te)}),Ie={obsSet:W.obsSet,promise:de,subscribers:new Set,type:"query",req:W,dirty:!1},Se?Se.push(Ie):(Se=[Ie],(Pe=Pe||(Nu["idb://".concat(y,"/").concat(E)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[W.query.index.name||""]=Se)),Cbe(Ie,Se,le,Ce),Ie.promise.then(function(Te){return{result:r$(Te.result,W,Pe==null?void 0:Pe.optimisticOps,A,Ie,se)}})}})}})}};function jy(m,y){return new Proxy(m,{get:function(E,A,N){return A==="db"?y:Reflect.get(E,A,N)}})}var Ca=(as.prototype.version=function(m){if(isNaN(m)||m<.1)throw new z.Type("Given version is not a positive number");if(m=Math.round(10*m)/10,this.idbdb||this._state.isBeingOpened)throw new z.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,m);var y=this._versions,E=y.filter(function(A){return A._cfg.version===m})[0];return E||(E=new this.Version(m),y.push(E),y.sort(cbe),E.stores({}),this._state.autoSchema=!1,E)},as.prototype._whenReady=function(m){var y=this;return this.idbdb&&(this._state.openComplete||je.letThrough||this._vip)?m():new st(function(E,A){if(y._state.openComplete)return A(new z.DatabaseClosed(y._state.dbOpenError));if(!y._state.isBeingOpened){if(!y._state.autoOpen)return void A(new z.DatabaseClosed);y.open().catch(be)}y._state.dbReadyPromise.then(E,A)}).then(m)},as.prototype.use=function(m){var y=m.stack,E=m.create,A=m.level,N=m.name;return N&&this.unuse({stack:y,name:N}),m=this._middlewares[y]||(this._middlewares[y]=[]),m.push({stack:y,create:E,level:A??10,name:N}),m.sort(function(W,se){return W.level-se.level}),this},as.prototype.unuse=function(m){var y=m.stack,E=m.name,A=m.create;return y&&this._middlewares[y]&&(this._middlewares[y]=this._middlewares[y].filter(function(N){return A?N.create!==A:!!E&&N.name!==E})),this},as.prototype.open=function(){var m=this;return bo(Ne,function(){return pbe(m)})},as.prototype._close=function(){var m=this._state,y=Md.indexOf(this);if(0<=y&&Md.splice(y,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}m.isBeingOpened||(m.dbReadyPromise=new st(function(E){m.dbReadyResolve=E}),m.openCanceller=new st(function(E,A){m.cancelOpen=A}))},as.prototype.close=function(E){var y=(E===void 0?{disableAutoOpen:!0}:E).disableAutoOpen,E=this._state;y?(E.isBeingOpened&&E.cancelOpen(new z.DatabaseClosed),this._close(),E.autoOpen=!1,E.dbOpenError=new z.DatabaseClosed):(this._close(),E.autoOpen=this._options.autoOpen||E.isBeingOpened,E.openComplete=!1,E.dbOpenError=null)},as.prototype.delete=function(m){var y=this;m===void 0&&(m={disableAutoOpen:!0});var E=0<arguments.length&&typeof arguments[0]!="object",A=this._state;return new st(function(N,W){function se(){y.close(m);var le=y._deps.indexedDB.deleteDatabase(y.name);le.onsuccess=kn(function(){var Ce,Re,Ie;Ce=y._deps,Re=y.name,Ie=Ce.indexedDB,Ce=Ce.IDBKeyRange,B_(Ie)||Re===Py||V_(Ie,Ce).delete(Re).catch(be),N()}),le.onerror=Ar(W),le.onblocked=y._fireOnBlocked}if(E)throw new z.InvalidArgument("Invalid closeOptions argument to db.delete()");A.isBeingOpened?A.dbReadyPromise.then(se):se()})},as.prototype.backendDB=function(){return this.idbdb},as.prototype.isOpen=function(){return this.idbdb!==null},as.prototype.hasBeenClosed=function(){var m=this._state.dbOpenError;return m&&m.name==="DatabaseClosed"},as.prototype.hasFailed=function(){return this._state.dbOpenError!==null},as.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(as.prototype,"tables",{get:function(){var m=this;return r(this._allTables).map(function(y){return m._allTables[y]})},enumerable:!1,configurable:!0}),as.prototype.transaction=function(){var m=(function(y,E,A){var N=arguments.length;if(N<2)throw new z.InvalidArgument("Too few arguments");for(var W=new Array(N-1);--N;)W[N-1]=arguments[N];return A=W.pop(),[y,P(W),A]}).apply(this,arguments);return this._transaction.apply(this,m)},as.prototype._transaction=function(m,y,E){var A=this,N=je.trans;N&&N.db===this&&m.indexOf("!")===-1||(N=null);var W,se,le=m.indexOf("?")!==-1;m=m.replace("!","").replace("?","");try{if(se=y.map(function(Re){if(Re=Re instanceof A.Table?Re.name:Re,typeof Re!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Re}),m=="r"||m===D_)W=D_;else{if(m!="rw"&&m!=T_)throw new z.InvalidArgument("Invalid transaction mode: "+m);W=T_}if(N){if(N.mode===D_&&W===T_){if(!le)throw new z.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");N=null}N&&se.forEach(function(Re){if(N&&N.storeNames.indexOf(Re)===-1){if(!le)throw new z.SubTransaction("Table "+Re+" not included in parent transaction.");N=null}}),le&&N&&!N.active&&(N=null)}}catch(Re){return N?N._promise(null,function(Ie,de){de(Re)}):Kn(Re)}var Ce=(function Re(Ie,de,Pe,Se,Te){return st.resolve().then(function(){var xe=je.transless||je,De=Ie._createTransaction(de,Pe,Ie._dbSchema,Se);if(De.explicit=!0,xe={trans:De,transless:xe},Se)De.idbtrans=Se.idbtrans;else try{De.create(),De.idbtrans._explicit=!0,Ie._state.PR1398_maxLoop=3}catch(He){return He.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,de,Pe,null,Te)})):Kn(He)}var Me,$e=ne(Te);return $e&&Ye(),xe=st.follow(function(){var He;(Me=Te.call(De,De))&&($e?(He=jt.bind(null,null),Me.then(He,He)):typeof Me.next=="function"&&typeof Me.throw=="function"&&(Me=j_(Me)))},xe),(Me&&typeof Me.then=="function"?st.resolve(Me).then(function(He){return De.active?He:Kn(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Me})).then(function(He){return Se&&De._resolve(),De._completion.then(function(){return He})}).catch(function(He){return De._reject(He),Kn(He)})})}).bind(null,this,W,se,N,E);return N?N._promise(W,Ce,"lock"):je.trans?bo(je.transless,function(){return A._whenReady(Ce)}):this._whenReady(Ce)},as.prototype.table=function(m){if(!d(this._allTables,m))throw new z.InvalidTable("Table ".concat(m," does not exist"));return this._allTables[m]},as);function as(m,y){var E=this;this._middlewares={},this.verno=0;var A=as.dependencies;this._options=y=s({addons:as.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned"},y),this._deps={indexedDB:y.indexedDB,IDBKeyRange:y.IDBKeyRange},A=y.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var N,W,se,le,Ce,Re={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:be,dbReadyPromise:null,cancelOpen:be,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:y.autoOpen};Re.dbReadyPromise=new st(function(de){Re.dbReadyResolve=de}),Re.openCanceller=new st(function(de,Pe){Re.cancelOpen=Pe}),this._state=Re,this.name=m,this.on=yp(this,"populate","blocked","versionchange","close",{ready:[M,be]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(de){return function(Pe,Se){as.vip(function(){var Te,xe=E._state;xe.openComplete?(xe.dbOpenError||st.resolve().then(Pe),Se&&de(Pe)):xe.onReadyBeingFired?(xe.onReadyBeingFired.push(Pe),Se&&de(Pe)):(de(Pe),Te=E,Se||de(function De(){Te.on.ready.unsubscribe(Pe),Te.on.ready.unsubscribe(De)}))})}}),this.Collection=(N=this,wp(sbe.prototype,function(Me,De){this.db=N;var Se=VB,Te=null;if(De)try{Se=De()}catch($e){Te=$e}var xe=Me._ctx,De=xe.table,Me=De.hook.reading.fire;this._ctx={table:De,index:xe.index,isPrimKey:!xe.index||De.schema.primKey.keyPath&&xe.index===De.schema.primKey.name,range:Se,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Te,or:xe.or,valueMapper:Me!==G?Me:null}})),this.Table=(W=this,wp(GB.prototype,function(de,Pe,Se){this.db=W,this._tx=Se,this.name=de,this.schema=Pe,this.hook=W._allTables[de]?W._allTables[de].hook:yp(null,{creating:[ke,be],reading:[q,G],updating:[Le,be],deleting:[Fe,be]})})),this.Transaction=(se=this,wp(rbe.prototype,function(de,Pe,Se,Te,xe){var De=this;this.db=se,this.mode=de,this.storeNames=Pe,this.schema=Se,this.chromeTransactionDurability=Te,this.idbtrans=null,this.on=yp(this,"complete","error","abort"),this.parent=xe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new st(function(Me,$e){De._resolve=Me,De._reject=$e}),this._completion.then(function(){De.active=!1,De.on.complete.fire()},function(Me){var $e=De.active;return De.active=!1,De.on.error.fire(Me),De.parent?De.parent._reject(Me):$e&&De.idbtrans&&De.idbtrans.abort(),Kn(Me)})})),this.Version=(le=this,wp(fbe.prototype,function(de){this.db=le,this._cfg={version:de,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,wp(KB.prototype,function(de,Pe,Se){if(this.db=Ce,this._ctx={table:de,index:Pe===":id"?null:Pe,or:Se},this._cmp=this._ascending=ln,this._descending=function(Te,xe){return ln(xe,Te)},this._max=function(Te,xe){return 0<ln(Te,xe)?Te:xe},this._min=function(Te,xe){return ln(Te,xe)<0?Te:xe},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new z.MissingAPI})),this.on("versionchange",function(de){0<de.newVersion?console.warn("Another connection wants to upgrade database '".concat(E.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(E.name,"'. Closing db now to resume the delete request.")),E.close({disableAutoOpen:!1})}),this.on("blocked",function(de){!de.newVersion||de.newVersion<de.oldVersion?console.warn("Dexie.delete('".concat(E.name,"') was blocked")):console.warn("Upgrade '".concat(E.name,"' blocked by other connection holding version ").concat(de.oldVersion/10))}),this._maxKey=Ep(y.IDBKeyRange),this._createTransaction=function(de,Pe,Se,Te){return new E.Transaction(de,Pe,Se,E._options.chromeTransactionDurability,Te)},this._fireOnBlocked=function(de){E.on("blocked").fire(de),Md.filter(function(Pe){return Pe.name===E.name&&Pe!==E&&!Pe._state.vcFired}).map(function(Pe){return Pe.on("versionchange").fire(de)})},this.use(vbe),this.use(bbe),this.use(ybe),this.use(gbe),this.use(mbe);var Ie=new Proxy(this,{get:function(de,Pe,Se){if(Pe==="_vip")return!0;if(Pe==="table")return function(xe){return jy(E.table(xe),Ie)};var Te=Reflect.get(de,Pe,Se);return Te instanceof GB?jy(Te,Ie):Pe==="tables"?Te.map(function(xe){return jy(xe,Ie)}):Pe==="_createTransaction"?function(){return jy(Te.apply(this,arguments),Ie)}:Te}});this.vip=Ie,A.forEach(function(de){return de(E)})}var Ky,mi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Sbe=(Z_.prototype.subscribe=function(m,y,E){return this._subscribe(m&&typeof m!="function"?m:{next:m,error:y,complete:E})},Z_.prototype[mi]=function(){return this},Z_);function Z_(m){this._subscribe=m}try{Ky={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Ky={indexedDB:null,IDBKeyRange:null}}function l$(m){var y,E=!1,A=new Sbe(function(N){var W=ne(m),se,le=!1,Ce={},Re={},Ie={get closed(){return le},unsubscribe:function(){le||(le=!0,se&&se.abort(),de&&vl.storagemutated.unsubscribe(Se))}};N.start&&N.start(Ie);var de=!1,Pe=function(){return Fy(Te)},Se=function(xe){Uy(Ce,xe),G_(Re,Ce)&&Pe()},Te=function(){var xe,De,Me;!le&&Ky.indexedDB&&(Ce={},xe={},se&&se.abort(),se=new AbortController,Me=function($e){var He=xr();try{W&&Ye();var Ze=Ae(m,$e);return Ze=W?Ze.finally(jt):Ze}finally{He&&pi()}}(De={subscr:xe,signal:se.signal,requery:Pe,querier:m,trans:null}),Promise.resolve(Me).then(function($e){E=!0,y=$e,le||De.signal.aborted||(Ce={},function(He){for(var Ze in He)if(d(He,Ze))return;return 1}(Re=xe)||de||(vl(Sp,Se),de=!0),Fy(function(){return!le&&N.next&&N.next($e)}))},function($e){E=!1,["DatabaseClosedError","AbortError"].includes($e==null?void 0:$e.name)||le||Fy(function(){le||N.error&&N.error($e)})}))};return setTimeout(Pe,0),Ie});return A.hasValue=function(){return E},A.getValue=function(){return y},A}var Lu=Ca;function X_(m){var y=yl;try{yl=!0,vl.storagemutated.fire(m),z_(m,!0)}finally{yl=y}}h(Lu,s(s({},ie),{delete:function(m){return new Lu(m,{addons:[]}).delete()},exists:function(m){return new Lu(m,{addons:[]}).open().then(function(y){return y.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(m){try{return y=Lu.dependencies,E=y.indexedDB,y=y.IDBKeyRange,(B_(E)?Promise.resolve(E.databases()).then(function(A){return A.map(function(N){return N.name}).filter(function(N){return N!==Py})}):V_(E,y).toCollection().primaryKeys()).then(m)}catch{return Kn(new z.MissingAPI)}var y,E},defineClass:function(){return function(m){l(this,m)}},ignoreTransaction:function(m){return je.trans?bo(je.transless,m):m()},vip:$_,async:function(m){return function(){try{var y=j_(m.apply(this,arguments));return y&&typeof y.then=="function"?y:st.resolve(y)}catch(E){return Kn(E)}}},spawn:function(m,y,E){try{var A=j_(m.apply(E,y||[]));return A&&typeof A.then=="function"?A:st.resolve(A)}catch(N){return Kn(N)}},currentTransaction:{get:function(){return je.trans||null}},waitFor:function(m,y){return y=st.resolve(typeof m=="function"?Lu.ignoreTransaction(m):m).timeout(y||6e4),je.trans?je.trans.waitFor(y):y},Promise:st,debug:{get:function(){return $},set:function(m){ae(m)}},derive:g,extend:l,props:h,override:b,Events:yp,on:vl,liveQuery:l$,extendObservabilitySet:Uy,getByKeyPath:R,setByKeyPath:T,delByKeyPath:function(m,y){typeof y=="string"?T(m,y,void 0):"length"in y&&[].map.call(y,function(E){T(m,E,void 0)})},shallowClone:I,deepClone:k,getObjectDiff:K_,cmp:ln,asap:_,minKey:-1/0,addons:[],connections:Md,errnames:re,dependencies:Ky,cache:Nu,semVer:"4.0.10",version:"4.0.10".split(".").map(function(m){return parseInt(m)}).reduce(function(m,y,E){return m+y/Math.pow(10,2*E)})})),Lu.maxKey=Ep(Lu.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(vl(Sp,function(m){yl||(m=new CustomEvent(P_,{detail:m}),yl=!0,dispatchEvent(m),yl=!1)}),addEventListener(P_,function(m){m=m.detail,yl||X_(m)}));var Vd,yl=!1,u$=function(){};return typeof BroadcastChannel<"u"&&((u$=function(){(Vd=new BroadcastChannel(P_)).onmessage=function(m){return m.data&&X_(m.data)}})(),typeof Vd.unref=="function"&&Vd.unref(),vl(Sp,function(m){yl||Vd.postMessage(m)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(m){if(!Ca.disableBfCache&&m.persisted){$&&console.debug("Dexie: handling persisted pagehide"),Vd!=null&&Vd.close();for(var y=0,E=Md;y<E.length;y++)E[y].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(m){!Ca.disableBfCache&&m.persisted&&($&&console.debug("Dexie: handling persisted pageshow"),u$(),X_({all:new Ks(-1/0,[[]])}))})),st.rejectionMapper=function(m,y){return!m||m instanceof H||m instanceof TypeError||m instanceof SyntaxError||!m.name||!pe[m.name]?m:(y=new pe[m.name](y||m.message,m),"stack"in m&&p(y,"stack",{get:function(){return this.inner.stack}}),y)},ae($),s(Ca,Object.freeze({__proto__:null,Dexie:Ca,liveQuery:l$,Entity:BB,cmp:ln,PropModSymbol:wa,PropModification:Cp,replacePrefix:function(m,y){return new Cp({replacePrefix:[m,y]})},add:function(m){return new Cp({add:m})},remove:function(m){return new Cp({remove:m})},default:Ca,RangeSet:Ks,mergeRanges:Dp,rangesOverlap:JB}),{default:Ca}),Ca})})(B1);var $z=B1.exports;const bC=Bz($z),$1=Symbol.for("Dexie"),Rh=globalThis[$1]||(globalThis[$1]=bC);if(bC.semVer!==Rh.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${bC.semVer} and ${Rh.semVer}`);const{liveQuery:Lbe,mergeRanges:Vbe,rangesOverlap:Bbe,RangeSet:$be,cmp:Hbe,Entity:Gbe,PropModSymbol:Ube,PropModification:Wbe,replacePrefix:zbe,add:jbe,remove:Kbe}=Rh;class H1 extends Rh{constructor(n){super(n);es(this,"icons");es(this,"visuals");es(this,"users");es(this,"columns");es(this,"general");this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(n){return this[n]?this[n]:this.general}}const Ag=new Map,Hz=async e=>{if(!Ag.has(e)){const t=new H1(e);try{await t.open(),Ag.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await Rh.delete(e);const s=new H1(e);await s.open(),Ag.set(e,s)}catch(s){throw console.error("Failed to delete and recreate database:",s),s}}}return Ag.get(e)},Dh=({dbName:e,storeName:t})=>{const n=async()=>(await Hz(e)).getTable(t);return{getCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}const d=await c.get(u);return d==null?void 0:d.value}catch(c){console.error("Failed to get cached value:",c);return}},setCachedValue:async(u,c)=>{try{const d=await n();if(!d){console.error(`Store is undefined, cannot cache key: ${u}`);return}await d.put({key:u,value:c,timestamp:Date.now()})}catch(d){console.error("Failed to cache value:",d)}},deleteCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined, cannot delete key: ${u}`);return}await c.delete(u)}catch(c){console.error("Failed to delete cached value:",c)}},clearCache:async()=>{try{const u=await n();if(!u){console.error("Store is undefined, cannot clear cache");return}await u.clear()}catch(u){console.error("Failed to clear cache:",u)}},getAllKeys:async()=>{try{const u=await n();return u?(await u.toArray()).map(d=>d.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(u){return console.error("Failed to get all keys:",u),[]}},getCachedValueWithTimestamp:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}return await c.get(u)}catch(c){console.error("Failed to get cached value with timestamp:",c);return}}}},Gz="AvatarCache",Uz="images",Bl={},kg={},Wz=()=>{const{getCachedValue:e,setCachedValue:t}=Dh({dbName:Gz,storeName:Uz}),n=a=>new Promise((l,u)=>{const c=new FileReader;c.onloadend=()=>l(c.result),c.onerror=u,c.readAsDataURL(a)}),s=async a=>{try{if(Bl[a])return Bl[a];if(kg[a])return await kg[a];const l=(async()=>{try{const u=await e(a);if(!u||!(u instanceof Blob))return null;const c=await n(u);return Bl[a]=c,c}catch(u){return console.warn(`Failed to get cached image for key: ${a}`,u),null}})();return kg[a]=l,l.finally(()=>{delete kg[a]}),await l}catch(l){return console.error(`Error in getCachedImage for key: ${a}`,l),null}},o=a=>new Promise((l,u)=>{new Vz(a,{width:96,height:96,quality:1,success(c){l(c)},error(c){console.error("Image compression failed:",c.message),u(c)}})});return{getCachedImage:s,setCachedImage:async(a,l)=>{try{const u=await o(l);await t(a,u);const c=await n(u);Bl[a]=c}catch(u){throw console.error(`Failed to cache image for key: ${a}`,u),u}},clearMemoryCache:a=>{try{a?delete Bl[a]:Object.keys(Bl).forEach(l=>delete Bl[l])}catch(l){console.error("Error clearing memory cache:",l)}}}},Th=new Map,sr=new Map,ic=new Map,zz=5*60*1e3,G1=100;function jz(){const e=Date.now(),t=[];ic.forEach((n,s)=>{e-n>zz&&t.push(s)}),t.forEach(n=>{Th.delete(n),ic.delete(n),sr.delete(n)})}function Kz(){if(ic.size<=G1)return;const e=Array.from(ic.entries()).sort((n,s)=>n[1]-s[1]);e.slice(0,e.length-G1).forEach(([n])=>{Th.delete(n),ic.delete(n),sr.delete(n)})}const qz=(e,t)=>{const n=sr.get(e);return n==null||n.forEach(s=>s(t)),sr.delete(e),t};async function Yz({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:s}){let o=e;if(t)try{const d=new URL(t,"http://localhost").pathname.split("/").pop();d?o=`${e}_${d}`:o=t}catch{o=t||e}const i=await n.getCachedImage(o),r=Th.has(o),a=sr.has(o);if(i)return qz(o,i);if(jz(),r)return new Promise(c=>{a||sr.set(o,[]),sr.get(o).push(c)});const l=(async()=>{let c=null,d=null;try{const h=Math.random()*300;await new Promise(p=>setTimeout(p,h)),s==null||s(!0);const f=await fetch(t,{cache:"no-cache"});if(!f.ok)throw new Error("Failed to fetch image");return c=await f.blob(),await n.setCachedImage(o,c),d=URL.createObjectURL(c),d}catch(h){throw console.error("Error loading avatar image:",h),h}finally{c=null,s==null||s(!1),ic.set(o,Date.now()),setTimeout(()=>{Th.delete(o),Kz()},100)}})();Th.set(o,l);const u=await l;return sr.has(o)&&(sr.get(o).forEach(d=>d(u)),sr.delete(o)),u}const Zz=(e,t=3,n=1e3)=>{const s=V(0),o=V(!1),i=V(!1),r=async()=>{try{await e()}catch(a){if(s.value<t)return s.value++,i.value=!0,await new Promise(l=>setTimeout(l,n)),r();throw o.value=!0,a}};return{retry:r,currentAttempt:s,errorRetry:o,isRetrying:i}};function xs(e,t){Xz(e)&&(e="100%");const n=Jz(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Og(e){return Math.min(1,Math.max(0,e))}function Xz(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Jz(e){return typeof e=="string"&&e.indexOf("%")!==-1}function U1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mg(e){return Number(e)<=1?`${Number(e)*100}%`:e}function $l(e){return e.length===1?"0"+e:String(e)}function Qz(e,t,n){return{r:xs(e,255)*255,g:xs(t,255)*255,b:xs(n,255)*255}}function W1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0,r=0;const a=(s+o)/2;if(s===o)r=0,i=0;else{const l=s-o;switch(r=a>.5?l/(2-s-o):l/(s+o),s){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:r,l:a}}function SC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function e3(e,t,n){let s,o,i;if(e=xs(e,360),t=xs(t,100),n=xs(n,100),t===0)o=n,i=n,s=n;else{const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=SC(a,r,e+1/3),o=SC(a,r,e),i=SC(a,r,e-1/3)}return{r:s*255,g:o*255,b:i*255}}function z1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0;const r=s,a=s-o,l=s===0?0:a/s;if(s===o)i=0;else{switch(s){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break}i/=6}return{h:i,s:l,v:r}}function t3(e,t,n){e=xs(e,360)*6,t=xs(t,100),n=xs(n,100);const s=Math.floor(e),o=e-s,i=n*(1-t),r=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6,u=[n,r,i,i,a,n][l],c=[a,n,n,r,i,i][l],d=[i,i,a,n,n,r][l];return{r:u*255,g:c*255,b:d*255}}function j1(e,t,n,s){const o=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function n3(e,t,n,s,o){const i=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16)),$l(o3(s))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function s3(e,t,n,s){const o=e/100,i=t/100,r=n/100,a=s/100,l=255*(1-o)*(1-a),u=255*(1-i)*(1-a),c=255*(1-r)*(1-a);return{r:l,g:u,b:c}}function K1(e,t,n){let s=1-e/255,o=1-t/255,i=1-n/255,r=Math.min(s,o,i);return r===1?(s=0,o=0,i=0):(s=(s-r)/(1-r)*100,o=(o-r)/(1-r)*100,i=(i-r)/(1-r)*100),r*=100,{c:Math.round(s),m:Math.round(o),y:Math.round(i),k:Math.round(r)}}function o3(e){return Math.round(parseFloat(e)*255).toString(16)}function q1(e){return Po(e)/255}function Po(e){return parseInt(e,16)}function i3(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const EC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function r3(e){let t={r:0,g:0,b:0},n=1,s=null,o=null,i=null,r=!1,a=!1;return typeof e=="string"&&(e=a3(e)),typeof e=="object"&&(Ao(e.r)&&Ao(e.g)&&Ao(e.b)?(t=Qz(e.r,e.g,e.b),r=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ao(e.h)&&Ao(e.s)&&Ao(e.v)?(s=Mg(e.s),o=Mg(e.v),t=t3(e.h,s,o),r=!0,a="hsv"):Ao(e.h)&&Ao(e.s)&&Ao(e.l)?(s=Mg(e.s),i=Mg(e.l),t=e3(e.h,s,i),r=!0,a="hsl"):Ao(e.c)&&Ao(e.m)&&Ao(e.y)&&Ao(e.k)&&(t=s3(e.c,e.m,e.y,e.k),r=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=U1(n),{ok:r,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const ka="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",_C="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Ng="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Zo={CSS_UNIT:new RegExp(ka),rgb:new RegExp("rgb"+_C),rgba:new RegExp("rgba"+Ng),hsl:new RegExp("hsl"+_C),hsla:new RegExp("hsla"+Ng),hsv:new RegExp("hsv"+_C),hsva:new RegExp("hsva"+Ng),cmyk:new RegExp("cmyk"+Ng),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function a3(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(EC[e])e=EC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=Zo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Zo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Zo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Zo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Zo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Zo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Zo.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Zo.hex8.exec(e),n?{r:Po(n[1]),g:Po(n[2]),b:Po(n[3]),a:q1(n[4]),format:t?"name":"hex8"}:(n=Zo.hex6.exec(e),n?{r:Po(n[1]),g:Po(n[2]),b:Po(n[3]),format:t?"name":"hex"}:(n=Zo.hex4.exec(e),n?{r:Po(n[1]+n[1]),g:Po(n[2]+n[2]),b:Po(n[3]+n[3]),a:q1(n[4]+n[4]),format:t?"name":"hex8"}:(n=Zo.hex3.exec(e),n?{r:Po(n[1]+n[1]),g:Po(n[2]+n[2]),b:Po(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function Ao(e){return typeof e=="number"?!Number.isNaN(e):Zo.CSS_UNIT.test(e)}class Nn{constructor(t="",n={}){if(t instanceof Nn)return t;typeof t=="number"&&(t=i3(t)),this.originalInput=t;const s=r3(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,s,o;const i=t.r/255,r=t.g/255,a=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*s+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=U1(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=z1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=z1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${s}%, ${o}%)`:`hsva(${n}, ${s}%, ${o}%, ${this.roundA})`}toHsl(){const t=W1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=W1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${s}%, ${o}%)`:`hsla(${n}, ${s}%, ${o}%, ${this.roundA})`}toHex(t=!1){return j1(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return n3(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),s=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${s})`:`rgba(${t}, ${n}, ${s}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(xs(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(xs(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...K1(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:s,k:o}=K1(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${s}, ${o})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+j1(this.r,this.g,this.b,!1);for(const[n,s]of Object.entries(EC))if(t===s)return n;return!1}toString(t){const n=!!t;t=t??this.format;let s=!1;const o=this.a<1&&this.a>=0;return!n&&o&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),t==="cmyk"&&(s=this.toCmykString()),s||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Nn(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Og(n.l),new Nn(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Nn(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Og(n.l),new Nn(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Og(n.s),new Nn(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Og(n.s),new Nn(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,new Nn(n)}mix(t,n=50){const s=this.toRgb(),o=new Nn(t).toRgb(),i=n/100,r={r:(o.r-s.r)*i+s.r,g:(o.g-s.g)*i+s.g,b:(o.b-s.b)*i+s.b,a:(o.a-s.a)*i+s.a};return new Nn(r)}analogous(t=6,n=30){const s=this.toHsl(),o=360/n,i=[this];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,i.push(new Nn(s));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Nn(t)}monochromatic(t=6){const n=this.toHsv(),{h:s}=n,{s:o}=n;let{v:i}=n;const r=[],a=1/t;for(;t--;)r.push(new Nn({h:s,s:o,v:i})),i=(i+a)%1;return r}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Nn({h:(n+72)%360,s:t.s,l:t.l}),new Nn({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),s=new Nn(t).toRgb(),o=n.a+s.a*(1-n.a);return new Nn({r:(n.r*n.a+s.r*s.a*(1-n.a))/o,g:(n.g*n.a+s.g*s.a*(1-n.a))/o,b:(n.b*n.a+s.b*s.a*(1-n.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:s}=n,o=[this],i=360/t;for(let r=1;r<t;r++)o.push(new Nn({h:(s+r*i)%360,s:n.s,l:n.l}));return o}equals(t){const n=new Nn(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function Y1(e){return new Nn(e||"").isValid}function Lg(e,t){const{c1:n,c2:s}={c1:new Nn(e),c2:new Nn(t)};return n.equals(s)}const l3=["src","alt"],Ih=_t(rt({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=V(""),s=V(!1),o=V(null),i=V(!1),r=Y(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),a=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.bgColor)||"#CCCCCC";return Y1(w)?w:"#CCCCCC"}),l=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.textColor)||"var(--background-color)";return Y1(w)?w:"var(--background-color)"}),u=Y(()=>{if(!t.isUseShortLabel)return"";const{initial:w,name:_}=r.value;if(typeof w=="string"&&w.trim())return w.trim();if(!(_!=null&&_.trim()))return"";const R=_.trim().split(/\s+/).filter(Boolean);return R.length===1?R[0].slice(0,2).toUpperCase():(R[0][0]+R[1][0]).toUpperCase()}),c=Y(()=>r.value.profile_image?"image":"text"),d=Y(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":a.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":l.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),h=()=>{n.value="",i.value=!0},{getCachedImage:f,setCachedImage:p}=Wz(),g=async()=>{if(o.value&&o.value.abort(),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),!r.value.id||!r.value.profile_image){n.value="";return}o.value=new AbortController;const w=o.value;try{const _=await Yz({userId:r.value.id,avatarUrl:r.value.profile_image,cacheInterface:{getCachedImage:f,setCachedImage:p},onLoadingChange:R=>{w.signal.aborted||(s.value=R)}});if(!w.signal.aborted&&(n.value=_,_.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),h(),new Error("Empty image source")}catch(_){w.signal.aborted||(console.error("Failed to load avatar:",_),n.value="")}},{retry:v,errorRetry:C,isRetrying:S}=Zz(g,3,2e3),b=tt(()=>[r.value.id,r.value.profile_image],v,{immediate:!0});return vs(()=>{b(),o.value&&(o.value.abort(),o.value=null),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),n.value="",s.value=!1}),(w,_)=>(j(),ue("div",{class:Q([w.$style["avatar-wrapper"],{[w.$style.me]:e.isMe,[w.$style.loading]:s.value,[w.$style.disabled]:e.disabled,[w.$style.readOnly]:t.readOnly}]),style:dn(d.value)},[s.value||U(S)?(j(),ue("div",{key:0,class:Q(w.$style["skeleton-loader"])},null,2)):(j(),ue(xt,{key:1},[c.value==="text"||U(C)||i.value?(j(),ue("div",{key:0,class:Q(w.$style["short-label"])},wt(u.value),3)):n.value.length>0||r.value.profile_image?(j(),ue("img",{key:1,src:n.value||r.value.profile_image||"",alt:r.value.name||"Avatar",loading:"lazy"},null,8,l3)):Je("",!0)],64))],6))}}),[["__cssModules",{$style:{"avatar-wrapper":"_avatar-wrapper_1pd1f_1",me:"_me_1pd1f_17","short-label":"_short-label_1pd1f_20",action:"_action_1pd1f_38",loading:"_loading_1pd1f_56",disabled:"_disabled_1pd1f_59",readOnly:"_readOnly_1pd1f_62"}}]]),u3=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],c3=["UploadInProgress"],Pu=class Pu{constructor(){es(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"});Object.values(this.KEY_PAIR).every(n=>{const s=sessionStorage.getItem(n);return(s==null||s==="")&&console.error(`[SessionStorageHelper] Key "${n}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return Pu.instance||(Pu.instance=new Pu),Pu.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(s){console.error("Error setting sessionStorage item:",s)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};es(Pu,"instance");let En=Pu;const Vg={},Oa={},Z1=(e,t,n,s,o="base64")=>{const i=V(""),r=V(""),a=V(!0),l=Y(()=>`${t}:${e.value.name}`),u=g=>new Promise((v,C)=>{const S=new FileReader;S.onload=()=>v(S.result),S.onerror=C,S.readAsDataURL(g)}),c=g=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,d=async(g,v)=>{if(Oa[v])return Oa[v];if(v in Vg){const b=await Vg[v];return b&&(Oa[v]=b),b}const C=await s(l.value);if(C&&typeof C=="string")return Oa[v]=C,C;const S=(async()=>{try{const b=await fetch(g,{cache:"no-cache"});if(!b.ok)throw new Error("Failed to fetch visual");const w=b.headers.get("Content-Type")||"";let _;if(w.includes("svg")||w.includes("xml")){const R=await b.text();if(!R.trim())throw new Error("Empty SVG content");_=o==="svg"?R:c(R),Oa[v]=_}else if(w.match(/image\/(jpeg|jpg|png|gif|webp)/)){const R=await b.blob();if(!R.size)throw new Error("Empty image blob");_=await u(R),Oa[v]=_}else throw new Error(`Unsupported content type: ${w}`);return await n(l.value,_),_}catch(b){return console.error("Error fetching visual:",b),""}})();return Vg[v]=S,S.finally(()=>{delete Vg[v]}),await S},h=async g=>{a.value=!0;try{if(Oa[l.value]){const _=Oa[l.value];i.value=_,_.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(_.split(",")[1]):(_.startsWith("<svg")||_.includes("<svg"))&&(r.value=_),a.value=!1;return}const v=En.getInstance().getItem("ASSET_URL")||"",C={icon:`${v}/icon/tess/TESSRAPP_Icon_${g}`,visual:`${v}/icon/visual/TESSRAPP_Visual_${g}`,ratting:`${v}/icon/tess/rating/TESSRAPP_Icon_${g}_Outline`,flag:`${v}/icon/flags/4x3/${g}`},S=u3.includes(g)?"png":c3.includes(g)?"gif":"svg",b=`${C[t]}.${S}`,w=await d(b,l.value);w&&(i.value=w,w.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(w.split(",")[1]):(w.startsWith("<svg")||w.includes("<svg"))&&(r.value=w))}catch(v){console.error("Error fetching remote visual:",v)}finally{a.value=!1}},f=async()=>{i.value="",r.value="",e.value.name&&(a.value=!0,await h(e.value.name),a.value=!1)},p=Y(()=>r.value?r.value:"");return tt(()=>e,()=>{f()},{deep:!0,immediate:!0}),{svgContent:p,url:i,loading:a}},d3=["innerHTML","about"],h3="IconCache",f3="icons",lt=_t(rt({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){jG(h=>({v1555daee:h.size+"px"}));const t=e,n=h=>{if(typeof h=="number")return h;switch(h){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof h=="string"?Number.parseInt(h,10):14}},s=Y(()=>n(t.size)),o=Y(()=>({width:s.value+"px",height:s.value+"px",color:t.color})),{getCachedValue:i,setCachedValue:r}=Dh({dbName:h3,storeName:f3}),a=async h=>{const f=await i(h);if(typeof f=="string")return f},l=async(h,f)=>{await r(h,f)},u=Y(()=>t.source==="rating"?"ratting":"icon"),c=Y(()=>({name:t.src,size:s.value,color:t.color||"currentColor"})),{svgContent:d}=Z1(c,u.value,l,a,"svg");return(h,f)=>(j(),ue("div",{class:Q(h.$style.iconWrapper),innerHTML:U(d),style:dn(o.value),about:t.src,"data-icon":"true"},null,14,d3))}}),[["__cssModules",{$style:{iconWrapper:"_iconWrapper_1n0y9_1"}}]]),p3={review:"{reviewDomain}/{ws_code}",review_take:"{reviewDomain}/{ws_code}?id={take_id}",review_scene:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",review_rendition:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",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}",review_rendition_comment:"{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}",review_comment:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",review_multiple_scenes:"{reviewDomain}/{ws_code}?scene_ids={scene_ids}",scene_hub:"{baseDomain}/{ws_code}/{scene_id}?o=st",hub_rendition:"{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",hub_comment:"{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",people_insight:"{baseDomain}/{ws_code}/{user_id}?o=pt",people_detail:"{baseDomain}/{ws_code}/ws/ppl/{display_name}-${user_id}",project:"{baseDomain}/{ws_code}/pl/dir/{entity_id}",woohoo:"{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",update:"{baseDomain}/{ws_code}/pl/au?id={entity_id}",core:"{baseDomain}/{ws_code}",project_focusMode:"{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",access_setting:"{baseDomain}/{ws_code}/pl/dir?f={entity_id}&o=as"},co=({type:e,config:t})=>{const n=[];try{const s=p3[e];if(!s)throw new Error(`Link template for link type "${e}" not found`);const o=s.replace(/{(.*?)}/g,(i,r)=>{const a=t[String(r)];if(a!==void 0)return a;n.push(r)});return n.length>0?{url:o,hasError:!0,error:`Missing required keys: ${n.join(", ")}`,missingKeys:n}:{url:o,hasError:!1,error:void 0}}catch(s){return console.error("Link Creator ERROR at:",s),{url:"",hasError:!0,error:s instanceof Error?s.message:`Missing required keys: ${n.join(", ")}`}}};var X1=typeof global=="object"&&global&&global.Object===Object&&global,g3=typeof self=="object"&&self&&self.Object===Object&&self,Ri=X1||g3||Function("return this")(),Xo=Ri.Symbol,J1=Object.prototype,m3=J1.hasOwnProperty,v3=J1.toString,xh=Xo?Xo.toStringTag:void 0;function y3(e){var t=m3.call(e,xh),n=e[xh];try{e[xh]=void 0;var s=!0}catch{}var o=v3.call(e);return s&&(t?e[xh]=n:delete e[xh]),o}var w3=Object.prototype,C3=w3.toString;function b3(e){return C3.call(e)}var S3="[object Null]",E3="[object Undefined]",Q1=Xo?Xo.toStringTag:void 0;function rc(e){return e==null?e===void 0?E3:S3:Q1&&Q1 in Object(e)?y3(e):b3(e)}function jr(e){return e!=null&&typeof e=="object"}var _3="[object Symbol]";function Bg(e){return typeof e=="symbol"||jr(e)&&rc(e)==_3}function R3(e,t){for(var n=-1,s=e==null?0:e.length,o=Array(s);++n<s;)o[n]=t(e[n],n,e);return o}var Jo=Array.isArray,eI=Xo?Xo.prototype:void 0,tI=eI?eI.toString:void 0;function nI(e){if(typeof e=="string")return e;if(Jo(e))return R3(e,nI)+"";if(Bg(e))return tI?tI.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var D3=/\s/;function T3(e){for(var t=e.length;t--&&D3.test(e.charAt(t)););return t}var I3=/^\s+/;function x3(e){return e&&e.slice(0,T3(e)+1).replace(I3,"")}function Ma(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sI=NaN,F3=/^[-+]0x[0-9a-f]+$/i,P3=/^0b[01]+$/i,A3=/^0o[0-7]+$/i,k3=parseInt;function RC(e){if(typeof e=="number")return e;if(Bg(e))return sI;if(Ma(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ma(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=x3(e);var n=P3.test(e);return n||A3.test(e)?k3(e.slice(2),n?2:8):F3.test(e)?sI:+e}var oI=1/0,O3=17976931348623157e292;function M3(e){if(!e)return e===0?e:0;if(e=RC(e),e===oI||e===-oI){var t=e<0?-1:1;return t*O3}return e===e?e:0}function N3(e){var t=M3(e),n=t%1;return t===t?n?t-n:t:0}function DC(e){return e}var L3="[object AsyncFunction]",V3="[object Function]",B3="[object GeneratorFunction]",$3="[object Proxy]";function iI(e){if(!Ma(e))return!1;var t=rc(e);return t==V3||t==B3||t==L3||t==$3}var TC=Ri["__core-js_shared__"],rI=function(){var e=/[^.]+$/.exec(TC&&TC.keys&&TC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function H3(e){return!!rI&&rI in e}var G3=Function.prototype,U3=G3.toString;function Hl(e){if(e!=null){try{return U3.call(e)}catch{}try{return e+""}catch{}}return""}var W3=/[\\^$.*+?()[\]{}|]/g,z3=/^\[object .+?Constructor\]$/,j3=Function.prototype,K3=Object.prototype,q3=j3.toString,Y3=K3.hasOwnProperty,Z3=RegExp("^"+q3.call(Y3).replace(W3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X3(e){if(!Ma(e)||H3(e))return!1;var t=iI(e)?Z3:z3;return t.test(Hl(e))}function J3(e,t){return e==null?void 0:e[t]}function Gl(e,t){var n=J3(e,t);return X3(n)?n:void 0}var IC=Gl(Ri,"WeakMap"),aI=Object.create,Q3=function(){function e(){}return function(t){if(!Ma(t))return{};if(aI)return aI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function e6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function t6(){}var n6=800,s6=16,o6=Date.now;function i6(e){var t=0,n=0;return function(){var s=o6(),o=s6-(s-n);if(n=s,o>0){if(++t>=n6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function r6(e){return function(){return e}}var $g=function(){try{var e=Gl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),a6=$g?function(e,t){return $g(e,"toString",{configurable:!0,enumerable:!1,value:r6(t),writable:!0})}:DC,l6=i6(a6);function u6(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}function c6(e,t,n,s){for(var o=e.length,i=n+-1;++i<o;)if(t(e[i],i,e))return i;return-1}function d6(e){return e!==e}function h6(e,t,n){for(var s=n-1,o=e.length;++s<o;)if(e[s]===t)return s;return-1}function f6(e,t,n){return t===t?h6(e,t,n):c6(e,d6,n)}function p6(e,t){var n=e==null?0:e.length;return!!n&&f6(e,t,0)>-1}var g6=9007199254740991,m6=/^(?:0|[1-9]\d*)$/;function lI(e,t){var n=typeof e;return t=t??g6,!!t&&(n=="number"||n!="symbol"&&m6.test(e))&&e>-1&&e%1==0&&e<t}function v6(e,t,n){t=="__proto__"&&$g?$g(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xC(e,t){return e===t||e!==e&&t!==t}var y6=Object.prototype,w6=y6.hasOwnProperty;function C6(e,t,n){var s=e[t];(!(w6.call(e,t)&&xC(s,n))||n===void 0&&!(t in e))&&v6(e,t,n)}var uI=Math.max;function b6(e,t,n){return t=uI(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,i=uI(s.length-t,0),r=Array(i);++o<i;)r[o]=s[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=s[o];return a[t]=n(r),e6(e,this,a)}}function S6(e,t){return l6(b6(e,t,DC),e+"")}var E6=9007199254740991;function FC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=E6}function PC(e){return e!=null&&FC(e.length)&&!iI(e)}var _6=Object.prototype;function AC(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_6;return e===n}function R6(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var D6="[object Arguments]";function cI(e){return jr(e)&&rc(e)==D6}var dI=Object.prototype,T6=dI.hasOwnProperty,I6=dI.propertyIsEnumerable,Hg=cI(function(){return arguments}())?cI:function(e){return jr(e)&&T6.call(e,"callee")&&!I6.call(e,"callee")};function x6(){return!1}var hI=typeof On=="object"&&On&&!On.nodeType&&On,fI=hI&&typeof module=="object"&&module&&!module.nodeType&&module,F6=fI&&fI.exports===hI,pI=F6?Ri.Buffer:void 0,P6=pI?pI.isBuffer:void 0,Fh=P6||x6,A6="[object Arguments]",k6="[object Array]",O6="[object Boolean]",M6="[object Date]",N6="[object Error]",L6="[object Function]",V6="[object Map]",B6="[object Number]",$6="[object Object]",H6="[object RegExp]",G6="[object Set]",U6="[object String]",W6="[object WeakMap]",z6="[object ArrayBuffer]",j6="[object DataView]",K6="[object Float32Array]",q6="[object Float64Array]",Y6="[object Int8Array]",Z6="[object Int16Array]",X6="[object Int32Array]",J6="[object Uint8Array]",Q6="[object Uint8ClampedArray]",e4="[object Uint16Array]",t4="[object Uint32Array]",Ln={};Ln[K6]=Ln[q6]=Ln[Y6]=Ln[Z6]=Ln[X6]=Ln[J6]=Ln[Q6]=Ln[e4]=Ln[t4]=!0,Ln[A6]=Ln[k6]=Ln[z6]=Ln[O6]=Ln[j6]=Ln[M6]=Ln[N6]=Ln[L6]=Ln[V6]=Ln[B6]=Ln[$6]=Ln[H6]=Ln[G6]=Ln[U6]=Ln[W6]=!1;function n4(e){return jr(e)&&FC(e.length)&&!!Ln[rc(e)]}function kC(e){return function(t){return e(t)}}var gI=typeof On=="object"&&On&&!On.nodeType&&On,Ph=gI&&typeof module=="object"&&module&&!module.nodeType&&module,s4=Ph&&Ph.exports===gI,OC=s4&&X1.process,ac=function(){try{var e=Ph&&Ph.require&&Ph.require("util").types;return e||OC&&OC.binding&&OC.binding("util")}catch{}}(),mI=ac&&ac.isTypedArray,MC=mI?kC(mI):n4,o4=Object.prototype,i4=o4.hasOwnProperty;function r4(e,t){var n=Jo(e),s=!n&&Hg(e),o=!n&&!s&&Fh(e),i=!n&&!s&&!o&&MC(e),r=n||s||o||i,a=r?R6(e.length,String):[],l=a.length;for(var u in e)i4.call(e,u)&&!(r&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lI(u,l)))&&a.push(u);return a}function vI(e,t){return function(n){return e(t(n))}}var a4=vI(Object.keys,Object),l4=Object.prototype,u4=l4.hasOwnProperty;function yI(e){if(!AC(e))return a4(e);var t=[];for(var n in Object(e))u4.call(e,n)&&n!="constructor"&&t.push(n);return t}function wI(e){return PC(e)?r4(e):yI(e)}var c4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d4=/^\w*$/;function NC(e,t){if(Jo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bg(e)?!0:d4.test(e)||!c4.test(e)||t!=null&&e in Object(t)}var Ah=Gl(Object,"create");function h4(){this.__data__=Ah?Ah(null):{},this.size=0}function f4(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p4="__lodash_hash_undefined__",g4=Object.prototype,m4=g4.hasOwnProperty;function v4(e){var t=this.__data__;if(Ah){var n=t[e];return n===p4?void 0:n}return m4.call(t,e)?t[e]:void 0}var y4=Object.prototype,w4=y4.hasOwnProperty;function C4(e){var t=this.__data__;return Ah?t[e]!==void 0:w4.call(t,e)}var b4="__lodash_hash_undefined__";function S4(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ah&&t===void 0?b4:t,this}function Ul(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ul.prototype.clear=h4,Ul.prototype.delete=f4,Ul.prototype.get=v4,Ul.prototype.has=C4,Ul.prototype.set=S4;function E4(){this.__data__=[],this.size=0}function Gg(e,t){for(var n=e.length;n--;)if(xC(e[n][0],t))return n;return-1}var _4=Array.prototype,R4=_4.splice;function D4(e){var t=this.__data__,n=Gg(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():R4.call(t,n,1),--this.size,!0}function T4(e){var t=this.__data__,n=Gg(t,e);return n<0?void 0:t[n][1]}function I4(e){return Gg(this.__data__,e)>-1}function x4(e,t){var n=this.__data__,s=Gg(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function Kr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Kr.prototype.clear=E4,Kr.prototype.delete=D4,Kr.prototype.get=T4,Kr.prototype.has=I4,Kr.prototype.set=x4;var kh=Gl(Ri,"Map");function F4(){this.size=0,this.__data__={hash:new Ul,map:new(kh||Kr),string:new Ul}}function P4(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ug(e,t){var n=e.__data__;return P4(t)?n[typeof t=="string"?"string":"hash"]:n.map}function A4(e){var t=Ug(this,e).delete(e);return this.size-=t?1:0,t}function k4(e){return Ug(this,e).get(e)}function O4(e){return Ug(this,e).has(e)}function M4(e,t){var n=Ug(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function qr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}qr.prototype.clear=F4,qr.prototype.delete=A4,qr.prototype.get=k4,qr.prototype.has=O4,qr.prototype.set=M4;var N4="Expected a function";function LC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(N4);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],i=n.cache;if(i.has(o))return i.get(o);var r=e.apply(this,s);return n.cache=i.set(o,r)||i,r};return n.cache=new(LC.Cache||qr),n}LC.Cache=qr;var L4=500;function V4(e){var t=LC(e,function(s){return n.size===L4&&n.clear(),s}),n=t.cache;return t}var B4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$4=/\\(\\)?/g,H4=V4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(B4,function(n,s,o,i){t.push(o?i.replace($4,"$1"):s||n)}),t});function G4(e){return e==null?"":nI(e)}function CI(e,t){return Jo(e)?e:NC(e,t)?[e]:H4(G4(e))}function Wg(e){if(typeof e=="string"||Bg(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bI(e,t){t=CI(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[Wg(t[n++])];return n&&n==s?e:void 0}function U4(e,t,n){var s=e==null?void 0:bI(e,t);return s===void 0?n:s}function SI(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var EI=Xo?Xo.isConcatSpreadable:void 0;function W4(e){return Jo(e)||Hg(e)||!!(EI&&e&&e[EI])}function z4(e,t,n,s,o){var i=-1,r=e.length;for(n||(n=W4),o||(o=[]);++i<r;){var a=e[i];n(a)&&SI(o,a)}return o}var j4=vI(Object.getPrototypeOf,Object);function K4(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++s<o;)i[s]=e[s+t];return i}var q4=Math.ceil,Y4=Math.max;function Z4(e,t,n){t===void 0?t=1:t=Y4(N3(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,i=0,r=Array(q4(s/t));o<s;)r[i++]=K4(e,o,o+=t);return r}function X4(){this.__data__=new Kr,this.size=0}function J4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Q4(e){return this.__data__.get(e)}function e5(e){return this.__data__.has(e)}var t5=200;function n5(e,t){var n=this.__data__;if(n instanceof Kr){var s=n.__data__;if(!kh||s.length<t5-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new qr(s)}return n.set(e,t),this.size=n.size,this}function or(e){var t=this.__data__=new Kr(e);this.size=t.size}or.prototype.clear=X4,or.prototype.delete=J4,or.prototype.get=Q4,or.prototype.has=e5,or.prototype.set=n5;var _I=typeof On=="object"&&On&&!On.nodeType&&On,RI=_I&&typeof module=="object"&&module&&!module.nodeType&&module,s5=RI&&RI.exports===_I,DI=s5?Ri.Buffer:void 0;DI&&DI.allocUnsafe;function o5(e,t){return e.slice()}function i5(e,t){for(var n=-1,s=e==null?0:e.length,o=0,i=[];++n<s;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function r5(){return[]}var a5=Object.prototype,l5=a5.propertyIsEnumerable,TI=Object.getOwnPropertySymbols,u5=TI?function(e){return e==null?[]:(e=Object(e),i5(TI(e),function(t){return l5.call(e,t)}))}:r5;function c5(e,t,n){var s=t(e);return Jo(e)?s:SI(s,n(e))}function VC(e){return c5(e,wI,u5)}var BC=Gl(Ri,"DataView"),$C=Gl(Ri,"Promise"),lc=Gl(Ri,"Set"),II="[object Map]",d5="[object Object]",xI="[object Promise]",FI="[object Set]",PI="[object WeakMap]",AI="[object DataView]",h5=Hl(BC),f5=Hl(kh),p5=Hl($C),g5=Hl(lc),m5=Hl(IC),Qo=rc;(BC&&Qo(new BC(new ArrayBuffer(1)))!=AI||kh&&Qo(new kh)!=II||$C&&Qo($C.resolve())!=xI||lc&&Qo(new lc)!=FI||IC&&Qo(new IC)!=PI)&&(Qo=function(e){var t=rc(e),n=t==d5?e.constructor:void 0,s=n?Hl(n):"";if(s)switch(s){case h5:return AI;case f5:return II;case p5:return xI;case g5:return FI;case m5:return PI}return t});var v5=Object.prototype,y5=v5.hasOwnProperty;function w5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&y5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var zg=Ri.Uint8Array;function HC(e){var t=new e.constructor(e.byteLength);return new zg(t).set(new zg(e)),t}function C5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var b5=/\w*$/;function S5(e){var t=new e.constructor(e.source,b5.exec(e));return t.lastIndex=e.lastIndex,t}var kI=Xo?Xo.prototype:void 0,OI=kI?kI.valueOf:void 0;function E5(e){return OI?Object(OI.call(e)):{}}function _5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var R5="[object Boolean]",D5="[object Date]",T5="[object Map]",I5="[object Number]",x5="[object RegExp]",F5="[object Set]",P5="[object String]",A5="[object Symbol]",k5="[object ArrayBuffer]",O5="[object DataView]",M5="[object Float32Array]",N5="[object Float64Array]",L5="[object Int8Array]",V5="[object Int16Array]",B5="[object Int32Array]",$5="[object Uint8Array]",H5="[object Uint8ClampedArray]",G5="[object Uint16Array]",U5="[object Uint32Array]";function W5(e,t,n){var s=e.constructor;switch(t){case k5:return HC(e);case R5:case D5:return new s(+e);case O5:return C5(e);case M5:case N5:case L5:case V5:case B5:case $5:case H5:case G5:case U5:return _5(e);case T5:return new s;case I5:case P5:return new s(e);case x5:return S5(e);case F5:return new s;case A5:return E5(e)}}function z5(e){return typeof e.constructor=="function"&&!AC(e)?Q3(j4(e)):{}}var j5="[object Map]";function K5(e){return jr(e)&&Qo(e)==j5}var MI=ac&&ac.isMap,q5=MI?kC(MI):K5,Y5="[object Set]";function Z5(e){return jr(e)&&Qo(e)==Y5}var NI=ac&&ac.isSet,X5=NI?kC(NI):Z5,LI="[object Arguments]",J5="[object Array]",Q5="[object Boolean]",e8="[object Date]",t8="[object Error]",VI="[object Function]",n8="[object GeneratorFunction]",s8="[object Map]",o8="[object Number]",BI="[object Object]",i8="[object RegExp]",r8="[object Set]",a8="[object String]",l8="[object Symbol]",u8="[object WeakMap]",c8="[object ArrayBuffer]",d8="[object DataView]",h8="[object Float32Array]",f8="[object Float64Array]",p8="[object Int8Array]",g8="[object Int16Array]",m8="[object Int32Array]",v8="[object Uint8Array]",y8="[object Uint8ClampedArray]",w8="[object Uint16Array]",C8="[object Uint32Array]",Fn={};Fn[LI]=Fn[J5]=Fn[c8]=Fn[d8]=Fn[Q5]=Fn[e8]=Fn[h8]=Fn[f8]=Fn[p8]=Fn[g8]=Fn[m8]=Fn[s8]=Fn[o8]=Fn[BI]=Fn[i8]=Fn[r8]=Fn[a8]=Fn[l8]=Fn[v8]=Fn[y8]=Fn[w8]=Fn[C8]=!0,Fn[t8]=Fn[VI]=Fn[u8]=!1;function jg(e,t,n,s,o,i){var r;if(r!==void 0)return r;if(!Ma(e))return e;var a=Jo(e);if(a)r=w5(e);else{var l=Qo(e),u=l==VI||l==n8;if(Fh(e))return o5(e);if(l==BI||l==LI||u&&!o)r=u?{}:z5(e);else{if(!Fn[l])return o?e:{};r=W5(e,l)}}i||(i=new or);var c=i.get(e);if(c)return c;i.set(e,r),X5(e)?e.forEach(function(f){r.add(jg(f,t,n,f,e,i))}):q5(e)&&e.forEach(function(f,p){r.set(p,jg(f,t,n,p,e,i))});var d=VC,h=a?void 0:d(e);return u6(h||e,function(f,p){h&&(p=f,f=e[p]),C6(r,p,jg(f,t,n,p,e,i))}),r}var b8=1,S8=4;function $I(e){return jg(e,b8|S8)}var E8="__lodash_hash_undefined__";function _8(e){return this.__data__.set(e,E8),this}function R8(e){return this.__data__.has(e)}function Oh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new qr;++t<n;)this.add(e[t])}Oh.prototype.add=Oh.prototype.push=_8,Oh.prototype.has=R8;function D8(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function HI(e,t){return e.has(t)}var T8=1,I8=2;function GI(e,t,n,s,o,i){var r=n&T8,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=n&I8?new Oh:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var p=e[d],g=t[d];if(s)var v=r?s(g,p,d,t,e,i):s(p,g,d,e,t,i);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!D8(t,function(C,S){if(!HI(f,S)&&(p===C||o(p,C,n,s,i)))return f.push(S)})){h=!1;break}}else if(!(p===g||o(p,g,n,s,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function x8(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function GC(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var F8=1,P8=2,A8="[object Boolean]",k8="[object Date]",O8="[object Error]",M8="[object Map]",N8="[object Number]",L8="[object RegExp]",V8="[object Set]",B8="[object String]",$8="[object Symbol]",H8="[object ArrayBuffer]",G8="[object DataView]",UI=Xo?Xo.prototype:void 0,UC=UI?UI.valueOf:void 0;function U8(e,t,n,s,o,i,r){switch(n){case G8:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case H8:return!(e.byteLength!=t.byteLength||!i(new zg(e),new zg(t)));case A8:case k8:case N8:return xC(+e,+t);case O8:return e.name==t.name&&e.message==t.message;case L8:case B8:return e==t+"";case M8:var a=x8;case V8:var l=s&F8;if(a||(a=GC),e.size!=t.size&&!l)return!1;var u=r.get(e);if(u)return u==t;s|=P8,r.set(e,t);var c=GI(a(e),a(t),s,o,i,r);return r.delete(e),c;case $8:if(UC)return UC.call(e)==UC.call(t)}return!1}var W8=1,z8=Object.prototype,j8=z8.hasOwnProperty;function K8(e,t,n,s,o,i){var r=n&W8,a=VC(e),l=a.length,u=VC(t),c=u.length;if(l!=c&&!r)return!1;for(var d=l;d--;){var h=a[d];if(!(r?h in t:j8.call(t,h)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=r;++d<l;){h=a[d];var C=e[h],S=t[h];if(s)var b=r?s(S,C,h,t,e,i):s(C,S,h,e,t,i);if(!(b===void 0?C===S||o(C,S,n,s,i):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return i.delete(e),i.delete(t),g}var q8=1,WI="[object Arguments]",zI="[object Array]",Kg="[object Object]",Y8=Object.prototype,jI=Y8.hasOwnProperty;function Z8(e,t,n,s,o,i){var r=Jo(e),a=Jo(t),l=r?zI:Qo(e),u=a?zI:Qo(t);l=l==WI?Kg:l,u=u==WI?Kg:u;var c=l==Kg,d=u==Kg,h=l==u;if(h&&Fh(e)){if(!Fh(t))return!1;r=!0,c=!1}if(h&&!c)return i||(i=new or),r||MC(e)?GI(e,t,n,s,o,i):U8(e,t,l,n,s,o,i);if(!(n&q8)){var f=c&&jI.call(e,"__wrapped__"),p=d&&jI.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return i||(i=new or),o(g,v,n,s,i)}}return h?(i||(i=new or),K8(e,t,n,s,o,i)):!1}function WC(e,t,n,s,o){return e===t?!0:e==null||t==null||!jr(e)&&!jr(t)?e!==e&&t!==t:Z8(e,t,n,s,WC,o)}var X8=1,J8=2;function Q8(e,t,n,s){var o=n.length,i=o;if(e==null)return!i;for(e=Object(e);o--;){var r=n[o];if(r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){r=n[o];var a=r[0],l=e[a],u=r[1];if(r[2]){if(l===void 0&&!(a in e))return!1}else{var c=new or,d;if(!(d===void 0?WC(u,l,X8|J8,s,c):d))return!1}}return!0}function KI(e){return e===e&&!Ma(e)}function ej(e){for(var t=wI(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,KI(o)]}return t}function qI(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function tj(e){var t=ej(e);return t.length==1&&t[0][2]?qI(t[0][0],t[0][1]):function(n){return n===e||Q8(n,e,t)}}function nj(e,t){return e!=null&&t in Object(e)}function sj(e,t,n){t=CI(t,e);for(var s=-1,o=t.length,i=!1;++s<o;){var r=Wg(t[s]);if(!(i=e!=null&&n(e,r)))break;e=e[r]}return i||++s!=o?i:(o=e==null?0:e.length,!!o&&FC(o)&&lI(r,o)&&(Jo(e)||Hg(e)))}function oj(e,t){return e!=null&&sj(e,t,nj)}var ij=1,rj=2;function aj(e,t){return NC(e)&&KI(t)?qI(Wg(e),t):function(n){var s=U4(n,e);return s===void 0&&s===t?oj(n,e):WC(t,s,ij|rj)}}function lj(e){return function(t){return t==null?void 0:t[e]}}function uj(e){return function(t){return bI(t,e)}}function cj(e){return NC(e)?lj(Wg(e)):uj(e)}function dj(e){return typeof e=="function"?e:e==null?DC:typeof e=="object"?Jo(e)?aj(e[0],e[1]):tj(e):cj(e)}var zC=function(){return Ri.Date.now()},hj="Expected a function",fj=Math.max,pj=Math.min;function Di(e,t,n){var s,o,i,r,a,l,u=0,c=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(hj);t=RC(t)||0,Ma(n)&&(c=!!n.leading,d="maxWait"in n,i=d?fj(RC(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function f(R){var T=s,I=o;return s=o=void 0,u=R,r=e.apply(I,T),r}function p(R){return u=R,a=setTimeout(C,t),c?f(R):r}function g(R){var T=R-l,I=R-u,x=t-T;return d?pj(x,i-I):x}function v(R){var T=R-l,I=R-u;return l===void 0||T>=t||T<0||d&&I>=i}function C(){var R=zC();if(v(R))return S(R);a=setTimeout(C,g(R))}function S(R){return a=void 0,h&&s?f(R):(s=o=void 0,r)}function b(){a!==void 0&&clearTimeout(a),u=0,s=l=o=a=void 0}function w(){return a===void 0?r:S(zC())}function _(){var R=zC(),T=v(R);if(s=arguments,o=this,l=R,T){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(C,t),f(l)}return a===void 0&&(a=setTimeout(C,t)),r}return _.cancel=b,_.flush=w,_}function YI(e){return jr(e)&&PC(e)}function gj(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var mj="[object Map]",vj="[object Set]",yj=Object.prototype,wj=yj.hasOwnProperty;function Cj(e){if(e==null)return!0;if(PC(e)&&(Jo(e)||typeof e=="string"||typeof e.splice=="function"||Fh(e)||MC(e)||Hg(e)))return!e.length;var t=Qo(e);if(t==mj||t==vj)return!e.size;if(AC(e))return!yI(e).length;for(var n in e)if(wj.call(e,n))return!1;return!0}var bj=1/0,Sj=lc&&1/GC(new lc([,-0]))[1]==bj?function(e){return new lc(e)}:t6,Ej=200;function _j(e,t,n){var s=-1,o=p6,i=e.length,r=!0,a=[],l=a;if(i>=Ej){var u=t?null:Sj(e);if(u)return GC(u);r=!1,o=HI,l=new Oh}else l=t?[]:a;e:for(;++s<i;){var c=e[s],d=t?t(c):c;if(c=c!==0?c:0,r&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(c)}else o(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}var uc=S6(function(e){var t=gj(e);return YI(t)&&(t=void 0),_j(z4(e,1,YI),dj(t))});const ts=(e,t)=>{const n=Yn();return{apiServices:Y(()=>{var r;const o=n==null?void 0:n.appContext.config.globalProperties,i=(r=t.params)==null?void 0:r.context;if(o!=null&&o.apiServices)return o.apiServices;if(e&&(i!=null&&i.apiServices))return i.apiServices})}},Rj=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let Wl=class extends Error{};class Dj extends Wl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Tj extends Wl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ij extends Wl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class cc extends Wl{}class ZI extends Wl{constructor(t){super(`Invalid unit ${t}`)}}class Bs extends Wl{}let Na=class extends Wl{constructor(){super("Zone is an abstract class")}};const Et="numeric",Ti="short",ko="long",qg={year:Et,month:Et,day:Et},XI={year:Et,month:Ti,day:Et},xj={year:Et,month:Ti,day:Et,weekday:Ti},JI={year:Et,month:ko,day:Et},QI={year:Et,month:ko,day:Et,weekday:ko},ex={hour:Et,minute:Et},tx={hour:Et,minute:Et,second:Et},nx={hour:Et,minute:Et,second:Et,timeZoneName:Ti},sx={hour:Et,minute:Et,second:Et,timeZoneName:ko},ox={hour:Et,minute:Et,hourCycle:"h23"},ix={hour:Et,minute:Et,second:Et,hourCycle:"h23"},rx={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:Ti},ax={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:ko},lx={year:Et,month:Et,day:Et,hour:Et,minute:Et},ux={year:Et,month:Et,day:Et,hour:Et,minute:Et,second:Et},cx={year:Et,month:Ti,day:Et,hour:Et,minute:Et},dx={year:Et,month:Ti,day:Et,hour:Et,minute:Et,second:Et},Fj={year:Et,month:Ti,day:Et,weekday:Ti,hour:Et,minute:Et},hx={year:Et,month:ko,day:Et,hour:Et,minute:Et,timeZoneName:Ti},fx={year:Et,month:ko,day:Et,hour:Et,minute:Et,second:Et,timeZoneName:Ti},px={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,timeZoneName:ko},gx={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,second:Et,timeZoneName:ko};let Mh=class{get type(){throw new Na}get name(){throw new Na}get ianaName(){return this.name}get isUniversal(){throw new Na}offsetName(t,n){throw new Na}formatOffset(t,n){throw new Na}offset(t){throw new Na}equals(t){throw new Na}get isValid(){throw new Na}},jC=null;class Yg extends Mh{static get instance(){return jC===null&&(jC=new Yg),jC}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const KC=new Map;function Pj(e){let t=KC.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"}),KC.set(e,t)),t}const Aj={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function kj(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function Oj(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=Aj[i];i==="era"?s[a]=r:Ht(a)||(s[a]=parseInt(r,10))}return s}const qC=new Map;let dc=class Q_ extends Mh{static create(t){let n=qC.get(t);return n===void 0&&qC.set(t,n=new Q_(t)),n}static resetCache(){qC.clear(),KC.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=Q_.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s,this.name)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=Pj(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?Oj(s,n):kj(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=em({year:o,month:i,day:r,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}},mx={};function Mj(e,t={}){const n=JSON.stringify([e,t]);let s=mx[n];return s||(s=new Intl.ListFormat(e,t),mx[n]=s),s}const YC=new Map;function ZC(e,t={}){const n=JSON.stringify([e,t]);let s=YC.get(n);return s===void 0&&(s=new Intl.DateTimeFormat(e,t),YC.set(n,s)),s}const XC=new Map;function Nj(e,t={}){const n=JSON.stringify([e,t]);let s=XC.get(n);return s===void 0&&(s=new Intl.NumberFormat(e,t),XC.set(n,s)),s}const JC=new Map;function Lj(e,t={}){const{base:n,...s}=t,o=JSON.stringify([e,s]);let i=JC.get(o);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),JC.set(o,i)),i}let Nh=null;function Vj(){return Nh||(Nh=new Intl.DateTimeFormat().resolvedOptions().locale,Nh)}const QC=new Map;function vx(e){let t=QC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),QC.set(e,t)),t}const eb=new Map;function Bj(e){let t=eb.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...yx,...t}),eb.set(e,t)}return t}function $j(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let s,o;try{s=ZC(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);s=ZC(l).resolvedOptions(),o=l}const{numberingSystem:i,calendar:r}=s;return[o,i,r]}}function Hj(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Gj(e){const t=[];for(let n=1;n<=12;n++){const s=bt.utc(2009,n,1);t.push(e(s))}return t}function Uj(e){const t=[];for(let n=1;n<=7;n++){const s=bt.utc(2016,11,13+n);t.push(e(s))}return t}function Zg(e,t,n,s){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):s(t)}function Wj(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||vx(e.locale).numberingSystem==="latn"}class zj{constructor(t,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:o,floor:i,...r}=s;if(!n||Object.keys(r).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Nj(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ub(t,3);return ds(n,this.padTo)}}}class jj{constructor(t,n,s){this.opts=s,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const r=-1*(t.offset/60),a=r>=0?`Etc/GMT+${r}`:`Etc/GMT${r}`;t.offset!==0&&dc.create(a).valid?(o=a,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=ZC(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Kj{constructor(t,n,s){this.opts={style:"long",...s},!n&&Lx()&&(this.rtf=Lj(t,s))}format(t,n){return this.rtf?this.rtf.format(t,n):gK(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const yx={firstDay:1,minimalDays:4,weekend:[6,7]};class bn{static fromOpts(t){return bn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,s,o,i=!1){const r=t||Zn.defaultLocale,a=r||(i?"en-US":Vj()),l=n||Zn.defaultNumberingSystem,u=s||Zn.defaultOutputCalendar,c=ab(o)||Zn.defaultWeekSettings;return new bn(a,l,u,c,r)}static resetCache(){Nh=null,YC.clear(),XC.clear(),JC.clear(),QC.clear(),eb.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:s,weekSettings:o}={}){return bn.create(t,n,s,o)}constructor(t,n,s,o,i){const[r,a,l]=$j(t);this.locale=r,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=o,this.intl=Hj(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Wj(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:bn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ab(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Zg(this,t,Wx,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");n&=!s;const o=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";if(!this.monthsCache[i][t]){const r=s?a=>this.dtFormatter(a,o).format():a=>this.extract(a,o,"month");this.monthsCache[i][t]=Gj(r)}return this.monthsCache[i][t]})}weekdays(t,n=!1){return Zg(this,t,Kx,()=>{const s=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Uj(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return Zg(this,void 0,()=>qx,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bt.utc(2016,11,13,9),bt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Zg(this,t,Yx,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[bt.utc(-40,1,1),bt.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[t]})}extract(t,n,s){const o=this.dtFormatter(t,n),i=o.formatToParts(),r=i.find(a=>a.type.toLowerCase()===s);return r?r.value:null}numberFormatter(t={}){return new zj(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new jj(t,this.intl,n)}relFormatter(t={}){return new Kj(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Mj(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||vx(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Vx()?Bj(this.locale):yx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let tb=null,ir=class Tp extends Mh{static get utcInstance(){return tb===null&&(tb=new Tp(0)),tb}static instance(t){return t===0?Tp.utcInstance:new Tp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tp(tm(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Bh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Bh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Bh(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}};class qj extends Mh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function La(e,t){if(Ht(e)||e===null)return t;if(e instanceof Mh)return e;if(eK(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Yg.instance:n==="utc"||n==="gmt"?ir.utcInstance:ir.parseSpecifier(n)||dc.create(e)}else return Va(e)?ir.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new qj(e)}const nb={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wx={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yj=nb.hanidec.replace(/[\[|\]]/g,"").split("");function Zj(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);if(e[n].search(nb.hanidec)!==-1)t+=Yj.indexOf(e[n]);else for(const o in wx){const[i,r]=wx[o];s>=i&&s<=r&&(t+=s-i)}}return parseInt(t,10)}else return t}const sb=new Map;function Xj(){sb.clear()}function Ii({numberingSystem:e},t=""){const n=e||"latn";let s=sb.get(n);s===void 0&&(s=new Map,sb.set(n,s));let o=s.get(t);return o===void 0&&(o=new RegExp(`${nb[n]}${t}`),s.set(t,o)),o}let Cx=()=>Date.now(),bx="system",Sx=null,Ex=null,_x=null,Rx=60,Dx,Tx=null;class Zn{static get now(){return Cx}static set now(t){Cx=t}static set defaultZone(t){bx=t}static get defaultZone(){return La(bx,Yg.instance)}static get defaultLocale(){return Sx}static set defaultLocale(t){Sx=t}static get defaultNumberingSystem(){return Ex}static set defaultNumberingSystem(t){Ex=t}static get defaultOutputCalendar(){return _x}static set defaultOutputCalendar(t){_x=t}static get defaultWeekSettings(){return Tx}static set defaultWeekSettings(t){Tx=ab(t)}static get twoDigitCutoffYear(){return Rx}static set twoDigitCutoffYear(t){Rx=t%100}static get throwOnInvalid(){return Dx}static set throwOnInvalid(t){Dx=t}static resetCaches(){bn.resetCache(),dc.resetCache(),bt.resetCache(),Xj()}}class xi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ix=[0,31,59,90,120,151,181,212,243,273,304,334],xx=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new xi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ob(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const o=s.getUTCDay();return o===0?7:o}function Fx(e,t,n){return n+(Lh(e)?xx:Ix)[t-1]}function Px(e,t){const n=Lh(e)?xx:Ix,s=n.findIndex(i=>i<t),o=t-n[s];return{month:s+1,day:o}}function ib(e,t){return(e-t+7)%7+1}function Xg(e,t=4,n=1){const{year:s,month:o,day:i}=e,r=Fx(s,o,i),a=ib(ob(s,o,i),n);let l=Math.floor((r-a+14-t)/7),u;return l<1?(u=s-1,l=Vh(u,t,n)):l>Vh(s,t,n)?(u=s+1,l=1):u=s,{weekYear:u,weekNumber:l,weekday:a,...sm(e)}}function Ax(e,t=4,n=1){const{weekYear:s,weekNumber:o,weekday:i}=e,r=ib(ob(s,1,t),n),a=fc(s);let l=o*7+i-r-7+t,u;l<1?(u=s-1,l+=fc(u)):l>a?(u=s+1,l-=fc(s)):u=s;const{month:c,day:d}=Px(u,l);return{year:u,month:c,day:d,...sm(e)}}function rb(e){const{year:t,month:n,day:s}=e,o=Fx(t,n,s);return{year:t,ordinal:o,...sm(e)}}function kx(e){const{year:t,ordinal:n}=e,{month:s,day:o}=Px(t,n);return{year:t,month:s,day:o,...sm(e)}}function Ox(e,t){if(!Ht(e.localWeekday)||!Ht(e.localWeekNumber)||!Ht(e.localWeekYear)){if(!Ht(e.weekday)||!Ht(e.weekNumber)||!Ht(e.weekYear))throw new cc("Cannot mix locale-based week fields with ISO-based week fields");return Ht(e.localWeekday)||(e.weekday=e.localWeekday),Ht(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ht(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Jj(e,t=4,n=1){const s=Jg(e.weekYear),o=ti(e.weekNumber,1,Vh(e.weekYear,t,n)),i=ti(e.weekday,1,7);return s?o?i?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Qj(e){const t=Jg(e.year),n=ti(e.ordinal,1,fc(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Mx(e){const t=Jg(e.year),n=ti(e.month,1,12),s=ti(e.day,1,Qg(e.year,e.month));return t?n?s?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Nx(e){const{hour:t,minute:n,second:s,millisecond:o}=e,i=ti(t,0,23)||t===24&&n===0&&s===0&&o===0,r=ti(n,0,59),a=ti(s,0,59),l=ti(o,0,999);return i?r?a?l?!1:ei("millisecond",o):ei("second",s):ei("minute",n):ei("hour",t)}function Ht(e){return typeof e>"u"}function Va(e){return typeof e=="number"}function Jg(e){return typeof e=="number"&&e%1===0}function eK(e){return typeof e=="string"}function tK(e){return Object.prototype.toString.call(e)==="[object Date]"}function Lx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Vx(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function nK(e){return Array.isArray(e)?e:[e]}function Bx(e,t,n){if(e.length!==0)return e.reduce((s,o)=>{const i=[t(o),o];return s&&n(s[0],i[0])===s[0]?s:i},null)[1]}function sK(e,t){return t.reduce((n,s)=>(n[s]=e[s],n),{})}function hc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ab(e){if(e==null)return null;if(typeof e!="object")throw new Bs("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new Bs("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Jg(e)&&e>=t&&e<=n}function oK(e,t){return e-t*Math.floor(e/t)}function ds(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Ba(e){if(!(Ht(e)||e===null||e===""))return parseInt(e,10)}function zl(e){if(!(Ht(e)||e===null||e===""))return parseFloat(e)}function lb(e){if(!(Ht(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ub(e,t,n="round"){const s=10**t;switch(n){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Lh(e){return e%4===0&&(e%100!==0||e%400===0)}function fc(e){return Lh(e)?366:365}function Qg(e,t){const n=oK(t-1,12)+1,s=e+(t-n)/12;return n===2?Lh(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function em(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 $x(e,t,n){return-ib(ob(e,1,t),n)+t-1}function Vh(e,t=4,n=1){const s=$x(e,t,n),o=$x(e+1,t,n);return(fc(e)-s+o)/7}function cb(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function Hx(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function tm(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Gx(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Bs(`Invalid unit value ${e}`);return t}function nm(e,t){const n={};for(const s in e)if(hc(e,s)){const o=e[s];if(o==null)continue;n[t(s)]=Gx(o)}return n}function Bh(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${ds(n,2)}:${ds(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${ds(n,2)}${ds(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function sm(e){return sK(e,["hour","minute","second","millisecond"])}const iK=["January","February","March","April","May","June","July","August","September","October","November","December"],Ux=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rK=["J","F","M","A","M","J","J","A","S","O","N","D"];function Wx(e){switch(e){case"narrow":return[...rK];case"short":return[...Ux];case"long":return[...iK];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const zx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],aK=["M","T","W","T","F","S","S"];function Kx(e){switch(e){case"narrow":return[...aK];case"short":return[...jx];case"long":return[...zx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qx=["AM","PM"],lK=["Before Christ","Anno Domini"],uK=["BC","AD"],cK=["B","A"];function Yx(e){switch(e){case"narrow":return[...cK];case"short":return[...uK];case"long":return[...lK];default:return null}}function dK(e){return qx[e.hour<12?0:1]}function hK(e,t){return Kx(t)[e.weekday-1]}function fK(e,t){return Wx(t)[e.month-1]}function pK(e,t){return Yx(t)[e.year<0?0:1]}function gK(e,t,n="always",s=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${o[e][0]}`;case-1:return d?"yesterday":`last ${o[e][0]}`;case 0:return d?"today":`this ${o[e][0]}`}}const r=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=o[e],c=s?l?u[1]:u[2]||u[1]:l?o[e][0]:e;return r?`${a} ${c} ago`:`in ${a} ${c}`}function Zx(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const mK={D:qg,DD:XI,DDD:JI,DDDD:QI,t:ex,tt:tx,ttt:nx,tttt:sx,T:ox,TT:ix,TTT:rx,TTTT:ax,f:lx,ff:cx,fff:hx,ffff:px,F:ux,FF:dx,FFF:fx,FFFF:gx};class $s{static create(t,n={}){return new $s(t,n)}static parseFormat(t){let n=null,s="",o=!1;const i=[];for(let r=0;r<t.length;r++){const a=t.charAt(r);a==="'"?((s.length>0||o)&&i.push({literal:o||/^\s+$/.test(s),val:s===""?"'":s}),n=null,s="",o=!o):o||a===n?s+=a:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&i.push({literal:o||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return mK[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,s=void 0){if(this.opts.forceSimple)return ds(t,n);const o={...this.opts};return n>0&&(o.padTo=n),s&&(o.signDisplay=s),this.loc.numberFormatter(o).format(t)}formatDateTimeFromString(t,n){const s=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,p)=>this.loc.extract(t,f,p),r=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?dK(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,p)=>s?fK(t,f):i(p?{month:f}:{month:f,day:"numeric"},"month"),u=(f,p)=>s?hK(t,f):i(p?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{const p=$s.macroTokenToFormatOpts(f);return p?this.formatWithSystemDefault(t,p):f},d=f=>s?pK(t,f):i({era:f},"era"),h=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(f)}};return Zx($s.parseFormat(n),h)}formatDurationFromString(t,n){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,o=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(c,d)=>h=>{const f=o(h);if(f){const p=d.isNegativeDuration&&f!==d.largestUnit?s:1;let g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(c.get(f)*p,h.length,g)}else return h},r=$s.parseFormat(n),a=r.reduce((c,{literal:d,val:h})=>d?c:c.concat(h),[]),l=t.shiftTo(...a.map(o).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return Zx(r,i(l,u))}}const Xx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pc(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function gc(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function mc(e,...t){if(e==null)return[null,null];for(const[n,s]of t){const o=n.exec(e);if(o)return s(o)}return[null,null]}function Jx(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Ba(t[n+o]);return[s,null,n+o]}}const Qx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,vK=`(?:${Qx.source}?(?:\\[(${Xx.source})\\])?)?`,db=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,eF=RegExp(`${db.source}${vK}`),hb=RegExp(`(?:[Tt]${eF.source})?`),yK=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,wK=/(\d{4})-?W(\d\d)(?:-?(\d))?/,CK=/(\d{4})-?(\d{3})/,bK=Jx("weekYear","weekNumber","weekDay"),SK=Jx("year","ordinal"),EK=/(\d{4})-(\d\d)-(\d\d)/,tF=RegExp(`${db.source} ?(?:${Qx.source}|(${Xx.source}))?`),_K=RegExp(`(?: ${tF.source})?`);function vc(e,t,n){const s=e[t];return Ht(s)?n:Ba(s)}function RK(e,t){return[{year:vc(e,t),month:vc(e,t+1,1),day:vc(e,t+2,1)},null,t+3]}function yc(e,t){return[{hours:vc(e,t,0),minutes:vc(e,t+1,0),seconds:vc(e,t+2,0),milliseconds:lb(e[t+3])},null,t+4]}function $h(e,t){const n=!e[t]&&!e[t+1],s=tm(e[t+1],e[t+2]),o=n?null:ir.instance(s);return[{},o,t+3]}function Hh(e,t){const n=e[t]?dc.create(e[t]):null;return[{},n,t+1]}const DK=RegExp(`^T?${db.source}$`),TK=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function IK(e){const[t,n,s,o,i,r,a,l,u]=e,c=t[0]==="-",d=l&&l[0]==="-",h=(f,p=!1)=>f!==void 0&&(p||f&&c)?-f:f;return[{years:h(zl(n)),months:h(zl(s)),weeks:h(zl(o)),days:h(zl(i)),hours:h(zl(r)),minutes:h(zl(a)),seconds:h(zl(l),l==="-0"),milliseconds:h(lb(u),d)}]}const xK={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fb(e,t,n,s,o,i,r){const a={year:t.length===2?cb(Ba(t)):Ba(t),month:Ux.indexOf(n)+1,day:Ba(s),hour:Ba(o),minute:Ba(i)};return r&&(a.second=Ba(r)),e&&(a.weekday=e.length>3?zx.indexOf(e)+1:jx.indexOf(e)+1),a}const FK=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function PK(e){const[,t,n,s,o,i,r,a,l,u,c,d]=e,h=fb(t,o,s,n,i,r,a);let f;return l?f=xK[l]:u?f=0:f=tm(c,d),[h,new ir(f)]}function AK(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const kK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,OK=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,MK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nF(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,o,s,n,i,r,a),ir.utcInstance]}function NK(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,a,n,s,o,i,r),ir.utcInstance]}const LK=pc(yK,hb),VK=pc(wK,hb),BK=pc(CK,hb),$K=pc(eF),sF=gc(RK,yc,$h,Hh),HK=gc(bK,yc,$h,Hh),GK=gc(SK,yc,$h,Hh),UK=gc(yc,$h,Hh);function WK(e){return mc(e,[LK,sF],[VK,HK],[BK,GK],[$K,UK])}function zK(e){return mc(AK(e),[FK,PK])}function jK(e){return mc(e,[kK,nF],[OK,nF],[MK,NK])}function KK(e){return mc(e,[TK,IK])}const qK=gc(yc);function YK(e){return mc(e,[DK,qK])}const ZK=pc(EK,_K),XK=pc(tF),JK=gc(yc,$h,Hh);function QK(e){return mc(e,[ZK,sF],[XK,JK])}const oF="Invalid Duration",iF={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},e7={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...iF},ni=146097/400,wc=146097/4800,t7={years:{quarters:4,months:12,weeks:ni/7,days:ni,hours:ni*24,minutes:ni*24*60,seconds:ni*24*60*60,milliseconds:ni*24*60*60*1e3},quarters:{months:3,weeks:ni/28,days:ni/4,hours:ni*24/4,minutes:ni*24*60/4,seconds:ni*24*60*60/4,milliseconds:ni*24*60*60*1e3/4},months:{weeks:wc/7,days:wc,hours:wc*24,minutes:wc*24*60,seconds:wc*24*60*60,milliseconds:wc*24*60*60*1e3},...iF},jl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],n7=jl.slice(0).reverse();function Yr(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new hn(s)}function rF(e,t){let n=t.milliseconds??0;for(const s of n7.slice(1))t[s]&&(n+=t[s]*e[s].milliseconds);return n}function aF(e,t){const n=rF(e,t)<0?-1:1;jl.reduceRight((s,o)=>{if(Ht(t[o]))return s;if(s){const i=t[s]*n,r=e[o][s],a=Math.floor(i/r);t[o]+=a*n,t[s]-=a*r*n}return o},null),jl.reduce((s,o)=>{if(Ht(t[o]))return s;if(s){const i=t[s]%1;t[s]-=i,t[o]+=i*e[s][o]}return o},null)}function lF(e){const t={};for(const[n,s]of Object.entries(e))s!==0&&(t[n]=s);return t}class hn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let s=n?t7:e7;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||bn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,n){return hn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Bs(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new hn({values:nm(t,hn.normalizeUnit),loc:bn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Va(t))return hn.fromMillis(t);if(hn.isDuration(t))return t;if(typeof t=="object")return hn.fromObject(t);throw new Bs(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[s]=KK(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[s]=YK(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Duration is invalid");const s=t instanceof xi?t:new xi(t,n);if(Zn.throwOnInvalid)throw new Ij(s);return new hn({invalid:s})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new ZI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?$s.create(this.loc,s).formatDurationFromString(this,t):oF}toHuman(t={}){if(!this.isValid)return oF;const n=t.showZeros!==!1,s=jl.map(o=>{const i=this.values[o];return Ht(i)||i===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:o.slice(0,-1)}).format(i)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ub(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},bt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?rF(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t),s={};for(const o of jl)(hc(n.values,o)||hc(this.values,o))&&(s[o]=n.get(o)+this.get(o));return Yr(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=Gx(t(this.values[s],s));return Yr(this,{values:n},!0)}get(t){return this[hn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...nm(t,hn.normalizeUnit)};return Yr(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:s,matrix:o}={}){const r={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:s};return Yr(this,r)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return aF(this.matrix,t),Yr(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=lF(this.normalize().shiftToAll().toObject());return Yr(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(r=>hn.normalizeUnit(r));const n={},s={},o=this.toObject();let i;for(const r of jl)if(t.indexOf(r)>=0){i=r;let a=0;for(const u in s)a+=this.matrix[u][r]*s[u],s[u]=0;Va(o[r])&&(a+=o[r]);const l=Math.trunc(a);n[r]=l,s[r]=(a*1e3-l*1e3)/1e3}else Va(o[r])&&(s[r]=o[r]);for(const r in s)s[r]!==0&&(n[i]+=r===i?s[r]:s[r]/this.matrix[i][r]);return aF(this.matrix,n),Yr(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Yr(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=lF(this.values);return Yr(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(s,o){return s===void 0||s===0?o===void 0||o===0:s===o}for(const s of jl)if(!n(this.values[s],t.values[s]))return!1;return!0}}const Cc="Invalid Interval";function s7(e,t){return!e||!e.isValid?Xn.invalid("missing or invalid start"):!t||!t.isValid?Xn.invalid("missing or invalid end"):t<e?Xn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Xn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Interval is invalid");const s=t instanceof xi?t:new xi(t,n);if(Zn.throwOnInvalid)throw new Tj(s);return new Xn({invalid:s})}static fromDateTimes(t,n){const s=Wh(t),o=Wh(n),i=s7(s,o);return i??new Xn({start:s,end:o})}static after(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o,o.plus(s))}static before(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o.minus(s),o)}static fromISO(t,n){const[s,o]=(t||"").split("/",2);if(s&&o){let i,r;try{i=bt.fromISO(s,n),r=i.isValid}catch{r=!1}let a,l;try{a=bt.fromISO(o,n),l=a.isValid}catch{l=!1}if(r&&l)return Xn.fromDateTimes(i,a);if(r){const u=hn.fromISO(o,n);if(u.isValid)return Xn.after(i,u)}else if(l){const u=hn.fromISO(s,n);if(u.isValid)return Xn.before(a,u)}}return Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:s.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(s,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Xn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Wh).filter(r=>this.contains(r)).sort((r,a)=>r.toMillis()-a.toMillis()),s=[];let{s:o}=this,i=0;for(;o<this.e;){const r=n[i]||this.e,a=+r>+this.e?this.e:r;s.push(Xn.fromDateTimes(o,a)),o=a,i+=1}return s}splitBy(t){const n=hn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,o=1,i;const r=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*o));i=+a>+this.e?this.e:a,r.push(Xn.fromDateTimes(s,i)),s=i,o+=1}return r}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return n>=s?null:Xn.fromDateTimes(n,s)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return Xn.fromDateTimes(n,s)}static merge(t){const[n,s]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],r)=>i?i.overlaps(r)||i.abutsStart(r)?[o,i.union(r)]:[o.concat([i]),r]:[o,r],[[],null]);return s&&n.push(s),n}static xor(t){let n=null,s=0;const o=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),r=Array.prototype.concat(...i),a=r.sort((l,u)=>l.time-u.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&o.push(Xn.fromDateTimes(n,l.time)),n=null);return Xn.merge(o)}difference(...t){return Xn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.s.loc.clone(n),t).formatInterval(this):Cc}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Cc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cc}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Cc}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Cc}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):hn.invalid(this.invalidReason)}mapEndpoints(t){return Xn.fromDateTimes(t(this.s),t(this.e))}}class bc{static hasDST(t=Zn.defaultZone){const n=bt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return dc.isValidZone(t)}static normalizeZone(t){return La(t,Zn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return bn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return bn.create(n,null,"gregory").eras(t)}static features(){return{relative:Lx(),localeWeek:Vx()}}}function uF(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(hn.fromMillis(s).as("days"))}function o7(e,t,n){const s=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=uF(l,u);return(c-c%7)/7}],["days",uF]],o={},i=e;let r,a;for(const[l,u]of s)n.indexOf(l)>=0&&(r=l,o[l]=u(e,t),a=i.plus(o),a>t?(o[l]--,e=i.plus(o),e>t&&(a=e,o[l]--,e=i.plus(o))):e=a);return[e,o,a,r]}function i7(e,t,n,s){let[o,i,r,a]=o7(e,t,n);const l=t-o,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(r<t&&(r=o.plus({[a]:1})),r!==o&&(i[a]=(i[a]||0)+l/(r-o)));const c=hn.fromObject(i,s);return u.length>0?hn.fromMillis(l,s).shiftTo(...u).plus(c):c}const r7="missing Intl.DateTimeFormat.formatToParts support";function vn(e,t=n=>n){return{regex:e,deser:([n])=>t(Zj(n))}}const cF="[  ]",dF=new RegExp(cF,"g");function a7(e){return e.replace(/\./g,"\\.?").replace(dF,cF)}function hF(e){return e.replace(/\./g,"").replace(dF," ").toLowerCase()}function Fi(e,t){return e===null?null:{regex:RegExp(e.map(a7).join("|")),deser:([n])=>e.findIndex(s=>hF(n)===hF(s))+t}}function fF(e,t){return{regex:e,deser:([,n,s])=>tm(n,s),groups:t}}function om(e){return{regex:e,deser:([t])=>t}}function l7(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function u7(e,t){const n=Ii(t),s=Ii(t,"{2}"),o=Ii(t,"{3}"),i=Ii(t,"{4}"),r=Ii(t,"{6}"),a=Ii(t,"{1,2}"),l=Ii(t,"{1,3}"),u=Ii(t,"{1,6}"),c=Ii(t,"{1,9}"),d=Ii(t,"{2,4}"),h=Ii(t,"{4,6}"),f=v=>({regex:RegExp(l7(v.val)),deser:([C])=>C,literal:!0}),g=(v=>{if(e.literal)return f(v);switch(v.val){case"G":return Fi(t.eras("short"),0);case"GG":return Fi(t.eras("long"),0);case"y":return vn(u);case"yy":return vn(d,cb);case"yyyy":return vn(i);case"yyyyy":return vn(h);case"yyyyyy":return vn(r);case"M":return vn(a);case"MM":return vn(s);case"MMM":return Fi(t.months("short",!0),1);case"MMMM":return Fi(t.months("long",!0),1);case"L":return vn(a);case"LL":return vn(s);case"LLL":return Fi(t.months("short",!1),1);case"LLLL":return Fi(t.months("long",!1),1);case"d":return vn(a);case"dd":return vn(s);case"o":return vn(l);case"ooo":return vn(o);case"HH":return vn(s);case"H":return vn(a);case"hh":return vn(s);case"h":return vn(a);case"mm":return vn(s);case"m":return vn(a);case"q":return vn(a);case"qq":return vn(s);case"s":return vn(a);case"ss":return vn(s);case"S":return vn(l);case"SSS":return vn(o);case"u":return om(c);case"uu":return om(a);case"uuu":return vn(n);case"a":return Fi(t.meridiems(),0);case"kkkk":return vn(i);case"kk":return vn(d,cb);case"W":return vn(a);case"WW":return vn(s);case"E":case"c":return vn(n);case"EEE":return Fi(t.weekdays("short",!1),1);case"EEEE":return Fi(t.weekdays("long",!1),1);case"ccc":return Fi(t.weekdays("short",!0),1);case"cccc":return Fi(t.weekdays("long",!0),1);case"Z":case"ZZ":return fF(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return fF(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return om(/[a-z_+-/]{1,256}?/i);case" ":return om(/[^\S\n\r]/);default:return f(v)}})(e)||{invalidReason:r7};return g.token=e,g}const c7={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function d7(e,t,n){const{type:s,value:o}=e;if(s==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const i=t[s];let r=s;s==="hour"&&(t.hour12!=null?r=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?r="hour12":r="hour24":r=n.hour12?"hour12":"hour24");let a=c7[r];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function h7(e){return[`^${e.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,e]}function f7(e,t,n){const s=e.match(t);if(s){const o={};let i=1;for(const r in n)if(hc(n,r)){const a=n[r],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(o[a.token.val[0]]=a.deser(s.slice(i,i+l))),i+=l}return[s,o]}else return[s,{}]}function p7(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return Ht(e.z)||(n=dc.create(e.z)),Ht(e.Z)||(n||(n=new ir(e.Z)),s=e.Z),Ht(e.q)||(e.M=(e.q-1)*3+1),Ht(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Ht(e.u)||(e.S=lb(e.u)),[Object.keys(e).reduce((i,r)=>{const a=t(r);return a&&(i[a]=e[r]),i},{}),n,s]}let pb=null;function g7(){return pb||(pb=bt.fromMillis(1555555555555)),pb}function m7(e,t){if(e.literal)return e;const n=$s.macroTokenToFormatOpts(e.val),s=vF(n,t);return s==null||s.includes(void 0)?e:s}function pF(e,t){return Array.prototype.concat(...e.map(n=>m7(n,t)))}class gF{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=pF($s.parseFormat(n),t),this.units=this.tokens.map(s=>u7(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,o]=h7(this.units);this.regex=RegExp(s,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,s]=f7(t,this.regex,this.handlers),[o,i,r]=s?p7(s):[null,null,void 0];if(hc(s,"a")&&hc(s,"H"))throw new cc("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:o,zone:i,specificOffset:r}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function mF(e,t,n){return new gF(e,n).explainFromTokens(t)}function v7(e,t,n){const{result:s,zone:o,specificOffset:i,invalidReason:r}=mF(e,t,n);return[s,o,i,r]}function vF(e,t){if(!e)return null;const s=$s.create(t,e).dtFormatter(g7()),o=s.formatToParts(),i=s.resolvedOptions();return o.map(r=>d7(r,e,i))}const gb="Invalid DateTime",yF=864e13;function Gh(e){return new xi("unsupported zone",`the zone "${e.name}" is not supported`)}function mb(e){return e.weekData===null&&(e.weekData=Xg(e.c)),e.weekData}function vb(e){return e.localWeekData===null&&(e.localWeekData=Xg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Kl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bt({...n,...t,old:n})}function wF(e,t,n){let s=e-t*60*1e3;const o=n.offset(s);if(t===o)return[s,t];s-=(o-t)*60*1e3;const i=n.offset(s);return o===i?[s,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function im(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function rm(e,t,n){return wF(em(e),t,n)}function CF(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:s,month:o,day:Math.min(e.c.day,Qg(s,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},r=hn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=em(i);let[l,u]=wF(a,n,e.zone);return r!==0&&(l+=r,u=e.zone.offset(l)),{ts:l,o:u}}function Sc(e,t,n,s,o,i){const{setZone:r,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,u=bt.fromObject(e,{...n,zone:l,specificOffset:i});return r?u:u.setZone(a)}else return bt.invalid(new xi("unparsable",`the input "${o}" can't be parsed as ${s}`))}function am(e,t,n=!0){return e.isValid?$s.create(bn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function yb(e,t,n){const s=e.c.year>9999||e.c.year<0;let o="";if(s&&e.c.year>=0&&(o+="+"),o+=ds(e.c.year,s?6:4),n==="year")return o;if(t){if(o+="-",o+=ds(e.c.month),n==="month")return o;o+="-"}else if(o+=ds(e.c.month),n==="month")return o;return o+=ds(e.c.day),o}function bF(e,t,n,s,o,i,r){let a=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(r){case"day":case"month":case"year":break;default:if(l+=ds(e.c.hour),r==="hour")break;if(t){if(l+=":",l+=ds(e.c.minute),r==="minute")break;a&&(l+=":",l+=ds(e.c.second))}else{if(l+=ds(e.c.minute),r==="minute")break;a&&(l+=ds(e.c.second))}if(r==="second")break;a&&(!s||e.c.millisecond!==0)&&(l+=".",l+=ds(e.c.millisecond,3))}return o&&(e.isOffsetFixed&&e.offset===0&&!i?l+="Z":e.o<0?(l+="-",l+=ds(Math.trunc(-e.o/60)),l+=":",l+=ds(Math.trunc(-e.o%60))):(l+="+",l+=ds(Math.trunc(e.o/60)),l+=":",l+=ds(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const SF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},y7={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},w7={ordinal:1,hour:0,minute:0,second:0,millisecond:0},lm=["year","month","day","hour","minute","second","millisecond"],C7=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],b7=["year","ordinal","hour","minute","second","millisecond"];function um(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ZI(e);return t}function EF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return um(e)}}function S7(e){if(Uh===void 0&&(Uh=Zn.now()),e.type!=="iana")return e.offset(Uh);const t=e.name;let n=wb.get(t);return n===void 0&&(n=e.offset(Uh),wb.set(t,n)),n}function _F(e,t){const n=La(t.zone,Zn.defaultZone);if(!n.isValid)return bt.invalid(Gh(n));const s=bn.fromObject(t);let o,i;if(Ht(e.year))o=Zn.now();else{for(const l of lm)Ht(e[l])&&(e[l]=SF[l]);const r=Mx(e)||Nx(e);if(r)return bt.invalid(r);const a=S7(n);[o,i]=rm(e,a,n)}return new bt({ts:o,zone:n,loc:s,o:i})}function RF(e,t,n){const s=Ht(n.round)?!0:n.round,o=Ht(n.rounding)?"trunc":n.rounding,i=(a,l)=>(a=ub(a,s||n.calendary?0:2,n.calendary?"round":o),t.loc.clone(n).relFormatter(n).format(a,l)),r=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return i(r(n.unit),n.unit);for(const a of n.units){const l=r(a);if(Math.abs(l)>=1)return i(l,a)}return i(e>t?-0:0,n.units[n.units.length-1])}function DF(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Uh;const wb=new Map;class bt{constructor(t){const n=t.zone||Zn.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new xi("invalid input"):null)||(n.isValid?null:Gh(n));this.ts=Ht(t.ts)?Zn.now():t.ts;let o=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const a=Va(t.o)&&!t.old?t.o:n.offset(this.ts);o=im(this.ts,a),s=Number.isNaN(o.year)?new xi("invalid input"):null,o=s?null:o,i=s?null:a}this._zone=n,this.loc=t.loc||bn.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new bt({})}static local(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return _F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return t.zone=ir.utcInstance,_F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const s=tK(t)?t.valueOf():NaN;if(Number.isNaN(s))return bt.invalid("invalid input");const o=La(n.zone,Zn.defaultZone);return o.isValid?new bt({ts:s,zone:o,loc:bn.fromObject(n)}):bt.invalid(Gh(o))}static fromMillis(t,n={}){if(Va(t))return t<-yF||t>yF?bt.invalid("Timestamp out of range"):new bt({ts:t,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Va(t))return new bt({ts:t*1e3,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const s=La(n.zone,Zn.defaultZone);if(!s.isValid)return bt.invalid(Gh(s));const o=bn.fromObject(n),i=nm(t,EF),{minDaysInFirstWeek:r,startOfWeek:a}=Ox(i,o),l=Zn.now(),u=Ht(n.specificOffset)?s.offset(l):n.specificOffset,c=!Ht(i.ordinal),d=!Ht(i.year),h=!Ht(i.month)||!Ht(i.day),f=d||h,p=i.weekYear||i.weekNumber;if((f||c)&&p)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new cc("Can't mix ordinal dates with month/day");const g=p||i.weekday&&!f;let v,C,S=im(l,u);g?(v=C7,C=y7,S=Xg(S,r,a)):c?(v=b7,C=w7,S=rb(S)):(v=lm,C=SF);let b=!1;for(const P of v){const D=i[P];Ht(D)?b?i[P]=C[P]:i[P]=S[P]:b=!0}const w=g?Jj(i,r,a):c?Qj(i):Mx(i),_=w||Nx(i);if(_)return bt.invalid(_);const R=g?Ax(i,r,a):c?kx(i):i,[T,I]=rm(R,u,s),x=new bt({ts:T,zone:s,o:I,loc:o});return i.weekday&&f&&t.weekday!==x.weekday?bt.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${x.toISO()}`):x.isValid?x:bt.invalid(x.invalid)}static fromISO(t,n={}){const[s,o]=WK(t);return Sc(s,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[s,o]=zK(t);return Sc(s,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[s,o]=jK(t);return Sc(s,o,n,"HTTP",n)}static fromFormat(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[a,l,u,c]=v7(r,t,n);return c?bt.invalid(c):Sc(a,l,s,`format ${n}`,t,u)}static fromString(t,n,s={}){return bt.fromFormat(t,n,s)}static fromSQL(t,n={}){const[s,o]=QK(t);return Sc(s,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the DateTime is invalid");const s=t instanceof xi?t:new xi(t,n);if(Zn.throwOnInvalid)throw new Dj(s);return new bt({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const s=vF(t,bn.fromObject(n));return s?s.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return pF($s.parseFormat(t),bn.fromObject(n)).map(o=>o.val).join("")}static resetCache(){Uh=void 0,wb.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?mb(this).weekYear:NaN}get weekNumber(){return this.isValid?mb(this).weekNumber:NaN}get weekday(){return this.isValid?mb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?vb(this).weekday:NaN}get localWeekNumber(){return this.isValid?vb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?vb(this).weekYear:NaN}get ordinal(){return this.isValid?rb(this.c).ordinal:NaN}get monthShort(){return this.isValid?bc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?bc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?bc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?bc.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,s=em(this.c),o=this.zone.offset(s-t),i=this.zone.offset(s+t),r=this.zone.offset(s-o*n),a=this.zone.offset(s-i*n);if(r===a)return[this];const l=s-r*n,u=s-a*n,c=im(l,r),d=im(u,a);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[Kl(this,{ts:l}),Kl(this,{ts:u})]:[this]}get isInLeapYear(){return Lh(this.year)}get daysInMonth(){return Qg(this.year,this.month)}get daysInYear(){return this.isValid?fc(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:s,calendar:o}=$s.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ir.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(t=La(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||s){const i=t.offset(this.ts),r=this.toObject();[o]=rm(r,i,t)}return Kl(this,{ts:o,zone:t})}else return bt.invalid(Gh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:s}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:s});return Kl(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=nm(t,EF),{minDaysInFirstWeek:s,startOfWeek:o}=Ox(n,this.loc),i=!Ht(n.weekYear)||!Ht(n.weekNumber)||!Ht(n.weekday),r=!Ht(n.ordinal),a=!Ht(n.year),l=!Ht(n.month)||!Ht(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||r)&&c)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new cc("Can't mix ordinal dates with month/day");let d;i?d=Ax({...Xg(this.c,s,o),...n},s,o):Ht(n.ordinal)?(d={...this.toObject(),...n},Ht(n.day)&&(d.day=Math.min(Qg(d.year,d.month),d.day))):d=kx({...rb(this.c),...n});const[h,f]=rm(d,this.o,this.zone);return Kl(this,{ts:h,o:f})}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return Kl(this,CF(this,n))}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t).negate();return Kl(this,CF(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},o=hn.normalizeUnit(t);switch(o){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:r}=this;r<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?$s.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):gb}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.loc.clone(n),t).formatDateTime(this):gb}toLocaleParts(t={}){return this.isValid?$s.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:o=!0,extendedZone:i=!1,precision:r="milliseconds"}={}){if(!this.isValid)return null;r=um(r);const a=t==="extended";let l=yb(this,a,r);return lm.indexOf(r)>=3&&(l+="T"),l+=bF(this,a,n,s,o,i,r),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?yb(this,t==="extended",um(n)):null}toISOWeekDate(){return am(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:o=!1,extendedZone:i=!1,format:r="extended",precision:a="milliseconds"}={}){return this.isValid?(a=um(a),(o&&lm.indexOf(a)>=3?"T":"")+bF(this,r==="extended",n,t,s,i,a)):null}toRFC2822(){return am(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return am(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yb(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(s&&(o+=" "),n?o+="z":t&&(o+="ZZ")),am(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():gb}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",s={}){if(!this.isValid||!t.isValid)return hn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=nK(n).map(hn.normalizeUnit),r=t.valueOf()>this.valueOf(),a=r?this:t,l=r?t:this,u=i7(a,l,i,o);return r?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(bt.now(),t,n)}until(t){return this.isValid?Xn.fromDateTimes(this,t):this}hasSame(t,n,s){if(!this.isValid)return!1;const o=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,s)<=o&&o<=i.endOf(n,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||bt.fromObject({},{zone:this.zone}),s=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),RF(n,this.plus(s),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?RF(t.base||bt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(bt.isDateTime))throw new Bs("min requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(bt.isDateTime))throw new Bs("max requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,s={}){const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return mF(r,t,n)}static fromStringExplain(t,n,s={}){return bt.fromFormatExplain(t,n,s)}static buildFormatParser(t,n={}){const{locale:s=null,numberingSystem:o=null}=n,i=bn.fromOpts({locale:s,numberingSystem:o,defaultToEN:!0});return new gF(i,t)}static fromFormatParser(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!r.equals(n.locale))throw new Bs(`fromFormatParser called with a locale of ${r}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(t);return c?bt.invalid(c):Sc(a,l,s,`format ${n.format}`,t,u)}static get DATE_SHORT(){return qg}static get DATE_MED(){return XI}static get DATE_MED_WITH_WEEKDAY(){return xj}static get DATE_FULL(){return JI}static get DATE_HUGE(){return QI}static get TIME_SIMPLE(){return ex}static get TIME_WITH_SECONDS(){return tx}static get TIME_WITH_SHORT_OFFSET(){return nx}static get TIME_WITH_LONG_OFFSET(){return sx}static get TIME_24_SIMPLE(){return ox}static get TIME_24_WITH_SECONDS(){return ix}static get TIME_24_WITH_SHORT_OFFSET(){return rx}static get TIME_24_WITH_LONG_OFFSET(){return ax}static get DATETIME_SHORT(){return lx}static get DATETIME_SHORT_WITH_SECONDS(){return ux}static get DATETIME_MED(){return cx}static get DATETIME_MED_WITH_SECONDS(){return dx}static get DATETIME_MED_WITH_WEEKDAY(){return Fj}static get DATETIME_FULL(){return hx}static get DATETIME_FULL_WITH_SECONDS(){return fx}static get DATETIME_HUGE(){return px}static get DATETIME_HUGE_WITH_SECONDS(){return gx}}function Wh(e){if(bt.isDateTime(e))return e;if(e&&e.valueOf&&Va(e.valueOf()))return bt.fromJSDate(e);if(e&&typeof e=="object")return bt.fromObject(e);throw new Bs(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const TF="account.last_prefered_timezone",rr=500;var Vt=(e=>(e[e.UNCHECK=0]="UNCHECK",e[e.INDETERMINATE=1]="INDETERMINATE",e[e.CHECKED=2]="CHECKED",e))(Vt||{});function zh(e){if(!e)return null;if(bt.isDateTime(e))return e;if(e instanceof Date){const t=bt.fromJSDate(e);return t.isValid?t:null}if(typeof e=="number"){const t=bt.fromMillis(e);return t.isValid?t:null}if(typeof e=="string"){let t=bt.fromISO(e);return t.isValid||(t=bt.fromRFC2822(e)),t.isValid?t:null}return null}function IF(e,t,n){const s=zh(e);if(!s)return"";const o=n?s.setZone(n):s;return o.isValid?o.toFormat(t):""}const cm=()=>Rj(TF)||"UTC",xF=e=>({id:e.id,name:(e==null?void 0:e.name)??e.display_name,initial:e.initial,profile_image:e.profile_image,color:{bgColor:e.color.bgColor,textColor:e.color.textColor}}),Ec=e=>e!=null&&e.length?e.map(xF):[],E7=e=>{if(!(e!=null&&e.length))return[];const t=new Set;return e.filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))},FF=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t},_7=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0)),PF=(e,t)=>{var s,o,i;const n={id:e.id,name:e.name,assignees:void 0,status:e.template_flow_status,dateRange:[FF(e.start_date),FF(e.due_date)],isStarted:!!Number(e.is_started),isCompleted:!!Number(e.is_completed),lastUpdated:{tooltip:e!=null&&e.last_updated_by?e.last_updated_by:"",value:IF(e.updated_at,"MMM dd, yyyy | HH:mm",t)||""},completedOn:{tooltip:e.actual_due_date==null?"Pending":e.last_completed_by?e.last_completed_by:"",value:IF(e.actual_due_date,"MMM dd, yyyy | HH:mm",t)},isDeleted:!1,isProcessing:e!=null&&e.bulk_process?{state:e==null?void 0:e.bulk_process.state,message:(e==null?void 0:e.bulk_process.message)||""}:void 0,disabled:((s=e==null?void 0:e.bulk_process)==null?void 0:s.state)==0,isArchived:((o=e.property)==null?void 0:o.is_archived)===1||e.status==0,isLocked:((i=e.property)==null?void 0:i.is_locked)===1};return _7(n)},AF={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},Cb=e=>e.toLowerCase().trim(),R7=e=>Cb(e).split(/\s+/).filter(Boolean),kF=e=>e.replace(/(ing|ed|s)$/i,"");function D7(e){const t=new Set;for(const n of e){const s=kF(n);if(t.add(s),t.add(n),AF[s])for(const o of AF[s])t.add(kF(o))}return Array.from(t)}function T7(e,t){const n=Cb(e),s=D7(R7(t));let o=0;for(const i of s)i&&(n.includes(i)&&(o+=i.length*2),n.startsWith(i)&&(o+=3));return o}function I7(e,t){const n=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=t.split(/\s+/).filter(Boolean).map(n);if(!s.length)return e;const o=new RegExp(`(${s.join("|")})`,"ig");return e.replace(o,"<mark>$1</mark>")}const OF=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},bb=e=>!isNaN(e)&&isFinite(e),dm=(e,t)=>{var i;const{restricted_type:n}=e,s=Math.floor(Number(t)),o=((i=e.restricted_value)==null?void 0:i.split(",").map(Number))||[];if(n=="none")return!0;if(e.restricted_type=="not")return bb(s)&&!o.includes(s);if(e.restricted_type=="range"){const[r,a]=o;return bb(Number(t))&&Number(t)>=Number(r)&&Number(t)<=Number(a)}else if(n=="exact")return bb(s)&&o.includes(s);return!1},x7=(e,t)=>{var i;const n=En.getInstance().getItem("ws.terminology"),s=n?JSON.parse(n):null;return` ${((i=s==null?void 0:s.find(r=>r.code==="scene"))==null?void 0:i.name)||"Scene"} ${t}`.trim()};/*! js-cookie v3.0.5 | MIT */function hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var F7={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Sb(e,t){function n(o,i,r){if(!(typeof document>"u")){r=hm({},t,r),typeof r.expires=="number"&&(r.expires=new Date(Date.now()+r.expires*864e5)),r.expires&&(r.expires=r.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in r)r[l]&&(a+="; "+l,r[l]!==!0&&(a+="="+r[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],r={},a=0;a<i.length;a++){var l=i[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(r[c]=e.read(u,c),o===c)break}catch{}}return o?r[o]:r}}return Object.create({set:n,get:s,remove:function(o,i){n(o,"",hm({},i,{expires:-1}))},withAttributes:function(o){return Sb(this.converter,hm({},this.attributes,o))},withConverter:function(o){return Sb(hm({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var MF=Sb(F7,{path:"/"});const fm=({date:e,timezone:t,format:n})=>{if(!e)return"";const s=typeof e=="string"?bt.fromISO(e,{zone:t}):e,o=bt.now().setZone(t||"local"),i=s.setZone(t||"local"),r=o.startOf("day"),l=i.startOf("day").diff(r,"days").days;let u="";if(l===0?u="Today":l===-1?u="Yesterday":l===1&&(u="Tomorrow"),u&&(n!=null&&n.includes("HH:mm"))){const c=i.toFormat("HH:mm");return`${u} at ${c}`}else if(u)return u;return i.toFormat(n)},Eb=()=>MF.get("account.last_prefered_timezone")||"UTC",pm=e=>`${bt.fromJSDate(e,{zone:"UTC"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,gm=e=>({id:e.id,label:e.name,value:e.id,data:e,color:e.color||{bgColor:"#CCCCCC",textColor:"#FFFFFF"},selected:!1,hover:!1,type:"text",disabled:!1,clickable:!0,danger:!1}),mm=(e,t)=>{var P;const n=_n("filterParams",null),s=V(((P=e.value)==null?void 0:P.map(D=>D.id))??[]),o=V([]),i=V(!1),r=Ki(e,"workspaceId"),a=Ki(e,"entityId"),l=Ki(e,"id"),u=Ki(e,"isSelectAll"),c=Ki(e,"isBulkUpdate"),d=e.updateRowData,h=V([]),{apiServices:f}=ts(!!e.params,e),p=Y(()=>{var O,B;const D=new Set(((O=e.value)==null?void 0:O.map(Z=>Z.id))??[]),F=((B=e.value)==null?void 0:B.map(Z=>({...gm(Z),selected:!0})))??[],k=o.value.filter(Z=>!D.has(Z.id));return uc(F,k,"id")}),g=D=>{const F=p.value.find(k=>k.id===D);return F==null?void 0:F.data},v=()=>{var D;return c.value&&u.value?[]:(D=t==null?void 0:t.value)!=null&&D.length?t.value:[String(l.value)]},C=async(D,F,k)=>{if(i.value||!f.value)return!1;i.value=!0;try{const O=await D();if((O==null?void 0:O.message)!=="Done")throw new Error("API call failed");return F(),!0}catch(O){return console.error("API call error:",O),k==null||k(O),!1}finally{i.value=!1}},S=Y(()=>!!(c.value&&u.value)),b=async()=>await C(()=>f.value.unAssignAll({workspaceId:String(r.value),userIds:[],itemIds:S.value?void 0:v(),entityId:S.value?String(a.value):void 0,filterParams:n!=null&&n.value?n.value:void 0}),()=>{d==null||d({assignees:[],type:"removeAll"}),s.value=[]},()=>{var F;console.error("Failed to unassign all assignees"),(F=e.errorCallback)==null||F.call(e)}),w=async D=>await C(()=>f.value.replaceAssignee(R(D)),()=>{s.value=[D];const k=g(D);k&&(d==null||d({assignees:Ec([k]),type:"overwrite"}))},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),_=async D=>await C(()=>f.value.addAssignee(R(D)),()=>{var O,B,Z;s.value.push(D);const k=g(D);if(k){const J=(Z=(B=(O=e.params)==null?void 0:O.api)==null?void 0:B.getRowNode(String(e.id)))==null?void 0:Z.data,ee=(J==null?void 0:J.assignees)||[],X=uc([...ee,...Ec([k])],"id");d==null||d({assignees:X,type:"add"})}},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),R=D=>{const F={workspaceId:String(r.value),userIds:[D],filterParams:n!=null&&n.value?n.value:void 0};return console.log("Creating payload with filterParams:",e),S.value?(F.itemIds=void 0,F.entityId=String(a.value)):F.itemIds=v(),F},T=async D=>await C(()=>f.value.removeAssignee(R(D)),()=>{var B,Z,J;const k=(J=(Z=(B=e.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(e.id)))==null?void 0:J.data;s.value=s.value.filter(ee=>ee!==D);const O=Ec(((k==null?void 0:k.assignees)||[]).filter(ee=>ee.id!==D));d==null||d({assignees:O,type:"remove"})},()=>{var k;(k=e.errorCallback)==null||k.call(e)});return{isSubmitting:i,options:h,unAssignAll:b,replaceAssignees:w,addAssignee:_,removeAssignee:T,handleSelect:D=>{const F=String(D.id);s.value.includes(F)?T(F):_(F)},openPeopleInsight:D=>{if(!D||!r.value)return;const F=co({type:"people_insight",config:{user_id:D,ws_code:r.value,baseDomain:En.getInstance().getItem("BASE_URL")||""}}).url;window.open(F,"_blank")},assigneeList:o,mergedOptions:p,selectedUserIds:s}},P7={placement:"bottom-start",theme:"light",trigger:"click",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0};function A7(e){return e.value?"$el"in e.value?e.value.$el:e.value:null}function Fs(e={}){const t=V(!1),n={...P7,...e},s=V(null),o=V(null),i=V(null),r=V(!1);let a=null,l=null;const u=S=>{(S.key==="Escape"||S.key==="Esc")&&p()},c=()=>{a&&l&&(l.removeEventListener("click",a),a=null,l=null),i.value&&(i.value.destroy(),i.value=null,r.value=!1),document.removeEventListener("keydown",u)},d=S=>{const{showOnInit:b,alwaysShow:w,showArrow:_,debug:R,...T}=n;return{...T,content:S,theme:n.theme,trigger:w||n.toggleOnClick?"manual":n.trigger,placement:n.placement||"bottom-start",arrow:!1,offset:n.offset,interactive:n.interactive,appendTo:n.appendTo,animation:"fade",maxWidth:n.maxWidth||350,onShow:I=>{if(e.disabled)return!1;if(r.value=!0,document.addEventListener("keydown",u),e.onShow)return e.onShow(I)},onHide:I=>{if(t.value)return setTimeout(()=>{t.value=!1},200),!1;if(w)return!1;if(r.value=!1,document.removeEventListener("keydown",u),e.onHide)return e.onHide(I)},onClickOutside:n.onClickOutside?n.onClickOutside:(I,x)=>{const P=x.target.closest(".notification-center"),D=x.target.closest("#people-insight-container");if(P||D){t.value=!0;return}if(e.onClickOutside)return e.onClickOutside(I,x);w||I.hide()},popperOptions:n.popperOptions||{modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}},{name:"preventOverflow",options:{padding:8}}]},hideOnClick:n.hideOnClick!==void 0?n.hideOnClick:!1}},h=()=>{var w;c();const S=A7(s),b=o.value;if(!(!S||!b)){b.style.display==="none"&&(b.style.display="");try{const _=d(b),R=Pa(S,_);i.value=Array.isArray(R)?R[0]:R,n.toggleOnClick&&!n.alwaysShow&&(a=()=>g(),l=S,S.addEventListener("click",a)),(n.showOnInit||n.alwaysShow)&&((w=i.value)==null||w.show())}catch(_){console.error("[useTippyComposable] Failed to create Tippy instance:",_)}}},f=S=>{S&&C(S),i.value&&i.value.show()},p=()=>{n.alwaysShow||i.value&&i.value.hide()},g=()=>{r.value?p():f()},v=S=>{i.value&&i.value.setContent(S)},C=S=>{i.value&&i.value.setProps(S)};return tt([s,o],h,{flush:"post"}),vs(()=>{c()}),{instance:i,isVisible:r,show:f,hide:p,toggle:g,triggerRef:s,popupRef:o,destroyTippy:c,setContent:v,setProps:C}}const NF=(e,t,n)=>{const s=V("Copy"),o=()=>{setTimeout(()=>{s.value="Copy"},5e3)};return{copyToClipboard:async r=>{r.stopPropagation(),r.preventDefault(),r.stopImmediatePropagation();try{return await navigator.clipboard.writeText(e),s.value="Copied",t==null||t(),o(),!0}catch(a){return console.error("Failed to copy text to clipboard:",a),s.value="Copy failed",o(),!1}},tooltip:s}},k7=(e,t,n)=>{const s={truncate:"End date cleared because it was before start. Please pick an end date.",swap:"Dates auto-swapped because start was after end.",...e.messages},o=Eo({startDate:null,endDate:null,timezone:e.timezone||"UTC",format:e.format||"",isSelectingStart:!1,isSelectingEnd:!1,rangeFeedback:{status:"idle",action:null,message:""},cacheStartDate:null,cacheEndDate:null,isDirty:!1});eh(()=>{var P;((P=e.value)==null?void 0:P.length)===2&&(o.startDate=e.value[0],o.endDate=e.value[1]),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isSelectingStart=!1,o.isSelectingEnd=!1,e.timezone&&(o.timezone=e.timezone)});const i=V(!1),r=V(!1),a=()=>{var Z,J,ee,X,ve,ne,L,H;const P=i.value||((J=(Z=o.startDate)==null?void 0:Z.getTime)==null?void 0:J.call(Z))!==((X=(ee=o.cacheStartDate)==null?void 0:ee.getTime)==null?void 0:X.call(ee)),D=r.value||((ne=(ve=o.endDate)==null?void 0:ve.getTime)==null?void 0:ne.call(ve))!==((H=(L=o.cacheEndDate)==null?void 0:L.getTime)==null?void 0:H.call(L)),F=o.startDate===null,k=o.endDate===null;let O,B;P&&D&&F&&k?(O=!0,B=!0,t("clearAll")):P&&!D?(O=!0,F?t("clearStart"):t("update:start",o.startDate)):D&&!P?(B=!0,k?t("clearDue"):t("update:end",o.endDate)):P&&D&&(O=!0,B=!0,t("update",[o.startDate,o.endDate])),!(!O&&!B)&&(O&&!B?t("confirmed",{start:o.startDate}):!O&&B?t("confirmed",{end:o.endDate}):t("confirmed",{start:o.startDate,end:o.endDate}),o.isDirty=P||D)},l=(P,D)=>{const F=bt.fromObject({year:P.year,month:P.month,day:P.day},{zone:o.timezone});return(D==="start"?F.startOf("day"):F.endOf("day")).toJSDate()},u=()=>{o.rangeFeedback.status="idle",o.rangeFeedback.action=null,o.rangeFeedback.message=""},c=P=>{e.enableRangeFeedback&&(o.rangeFeedback.status="corrected",o.rangeFeedback.action=P,o.rangeFeedback.message=P==="swap"?s.swap:s.truncate)},d=P=>{if(!(!o.startDate||!o.endDate)){if(o.startDate.getTime()<=o.endDate.getTime()){e.enableRangeFeedback&&u();return}if(P==="select-start"){const D={start:o.startDate,end:o.endDate};o.endDate=null,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"truncate"}),o.isSelectingEnd=!0,c("truncate")}else{const D={start:o.startDate,end:o.endDate},F=o.startDate;o.startDate=o.endDate,o.endDate=F,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"swap"}),c("swap")}}},h=V(!1),f=V(!1),p=(P,D=!0)=>{i.value=!0,h.value=!1,!(e.disabled||e.readOnly)&&(o.startDate=l(P,"start"),D?(o.isSelectingStart=!1,o.isSelectingEnd=!0):(o.isSelectingStart=!0,o.isSelectingEnd=!1),d("select-start"))},g=P=>{r.value=!0,f.value=!1,!(e.disabled||e.readOnly)&&(o.endDate=l(P,"end"),d("select-end"))},v=()=>{i.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,u())},C=()=>{r.value=!0,!(e.disabled||e.readOnly)&&(o.endDate=null,u())},S=()=>{i.value=!0,r.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,o.endDate=null,u(),w())},b=()=>{e.disabled||e.readOnly||o.isDirty||(o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate)},w=()=>{e.disabled||e.readOnly||(a(),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isDirty=!1)},_=()=>{e.disabled||e.readOnly||(o.startDate=o.cacheStartDate,o.endDate=o.cacheEndDate,u(),o.isDirty=!1)},R=Y(()=>o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat(o.format):e.startPlaceholder),T=Y(()=>o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat(o.format):e.duePlaceholder),I=Y(()=>!o.startDate&&!e.disabled?e.startTooltip:!o.startDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.startTooltip),x=Y(()=>!o.endDate&&!e.disabled?e.dueTooltip:!o.endDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.dueTooltip);return{states:o,displayStartDate:R,displayEndDate:T,tooltipStartDate:I,tooltipEndDate:x,showMultipleDueDates:f,showMultipleStartDates:h,selectEndDate:g,selectStartDate:p,clearDue:C,clearStart:v,clearAll:S,beginInteraction:b,confirmSelection:w,cancelSelection:_}},LF="MMM dd",O7=e=>{const t=e.timezone,n=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:LF}):"No start"),s=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:LF}):"No due"),o=d=>{if(!d)return null;const h=bt.now().setZone(t).startOf("day"),f=bt.fromISO(d).setZone(t).startOf("day");if(!f.isValid)return console.warn("Invalid date:",d,f.invalidReason),null;const p=f.diff(h,"days").days;return p===0?"today":p===1?"tomorrow":p===-1?"yesterday":p<-1?"past":"future"},i=Y(()=>o(e.start)),r=Y(()=>o(e.end)),a=Y(()=>{if(n.value==="No start")return["empty"];const d=[];return i.value&&d.push(`start-${i.value}`),e.isStarted&&d.push("actual"),d}),l=Y(()=>{if(s.value==="No due")return["empty"];const d=[];return r.value&&d.push(`end-${r.value}`),e.isEnded&&d.push("actual"),d}),u=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No start"),c=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No due");return{startDate:n,endDate:s,startClasses:a,endClasses:l,fullStartDate:u,fullEndDate:c}},M7="UserCache",N7="user",L7=()=>{const e=V({}),{getCachedValue:t,setCachedValue:n}=Dh({dbName:M7,storeName:N7}),s=async u=>u?await t(u):null;return{getCachedUser:s,setCachedUser:async u=>{if(!(u!=null&&u.id)){console.warn("Cannot cache user without id:",u);return}await n(u.id,u),e.value[u.id]=!0},getCachedUsers:async u=>{if(!u||u.length===0)return[];const c=u.map(h=>s(h));return(await Promise.all(c)).filter(h=>h!==null)},setCachedUsers:async u=>{if(!u||u.length===0)return;const d=uc(u,"id").filter(h=>h.id&&!e.value[h.id]).map(async h=>{await n(h.id,h),e.value[h.id]=!0});await Promise.all(d)},isUserCached:u=>!!e.value[u],clearCacheTracking:()=>{e.value={}}}},V7={placement:"bottom-start",theme:"light",trigger:"manual",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0,useTrigger:!0,showOverlay:!1,overlayOpacity:.5,closeOnOverlayClick:!0,centered:!1};let jh=0,Oo=null;function B7(e){return Oo||(Oo=document.createElement("div"),Oo.className="popup-overlay",Oo.style.cssText=`
113
+ `+W:""),this.inner=W||null):typeof N=="object"&&(this.message="".concat(N.name," ").concat(N.message),this.inner=N):(this.message=L[y]||E,this.inner=null)}return g(A).from(oe),m[y]=A,m},{});z.Syntax=SyntaxError,z.Type=TypeError,z.Range=RangeError;var pe=ze.reduce(function(m,y){return m[y+"Error"]=z[y],m},{}),ie=mi.reduce(function(m,y){return["Syntax","Type","Range"].indexOf(y)===-1&&(m[y+"Error"]=z[y]),m},{});function be(){}function G(m){return m}function q(m,y){return m==null||m===G?y:function(E){return y(m(E))}}function ce(m,y){return function(){m.apply(this,arguments),y.apply(this,arguments)}}function ke(m,y){return m===be?y:function(){var E=m.apply(this,arguments);E!==void 0&&(arguments[0]=E);var A=this.onsuccess,N=this.onerror;this.onsuccess=null,this.onerror=null;var W=y.apply(this,arguments);return A&&(this.onsuccess=this.onsuccess?ce(A,this.onsuccess):A),N&&(this.onerror=this.onerror?ce(N,this.onerror):N),W!==void 0?W:E}}function Fe(m,y){return m===be?y:function(){m.apply(this,arguments);var E=this.onsuccess,A=this.onerror;this.onsuccess=this.onerror=null,y.apply(this,arguments),E&&(this.onsuccess=this.onsuccess?ce(E,this.onsuccess):E),A&&(this.onerror=this.onerror?ce(A,this.onerror):A)}}function Le(m,y){return m===be?y:function(E){var A=m.apply(this,arguments);l(E,A);var N=this.onsuccess,W=this.onerror;return this.onsuccess=null,this.onerror=null,E=y.apply(this,arguments),N&&(this.onsuccess=this.onsuccess?ce(N,this.onsuccess):N),W&&(this.onerror=this.onerror?ce(W,this.onerror):W),A===void 0?E===void 0?void 0:E:l(A,E)}}function ye(m,y){return m===be?y:function(){return y.apply(this,arguments)!==!1&&m.apply(this,arguments)}}function M(m,y){return m===be?y:function(){var E=m.apply(this,arguments);if(E&&typeof E.then=="function"){for(var A=this,N=arguments.length,W=new Array(N);N--;)W[N]=arguments[N];return E.then(function(){return y.apply(A,W)})}return y.apply(this,arguments)}}ie.ModifyError=he,ie.DexieError=H,ie.BulkError=me;var $=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ae(m){$=m}var Ge={},we=100,wa=typeof Promise>"u"?[]:function(){var m=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[m,u(m),m];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,u(y),m]}(),ze=wa[0],mi=wa[1],wa=wa[2],mi=mi&&mi.then,Ue=ze&&ze.constructor,Ee=!!wa,Ve=function(m,y){yt.push([m,y]),At&&(queueMicrotask(Ir),At=!1)},pt=!0,At=!0,Ut=[],Qt=[],zt=G,Ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:be,pgp:!1,env:{},finalize:be},je=Ne,yt=[],Ot=0,Wt=[];function st(m){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=je;if(typeof m!="function"){if(m!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&pl(this,this._value))}this._state=null,this._value=null,++y.ref,function E(A,N){try{N(function(W){if(A._state===null){if(W===A)throw new TypeError("A promise cannot be resolved with itself.");var se=A._lib&&xr();W&&typeof W.then=="function"?E(A,function(le,Ce){W instanceof st?W._then(le,Ce):W.then(le,Ce)}):(A._state=!0,A._value=W,Co(A)),se&&pi()}},pl.bind(null,A))}catch(W){pl(A,W)}}(this,m)}var ps={get:function(){var m=je,y=Od;function E(A,N){var W=this,se=!m.global&&(m!==je||y!==Od),le=se&&!jt(),Ce=new st(function(Re,Ie){va(W,new Gi(Pr(A,m,se,le),Pr(N,m,se,le),Re,Ie,m))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return E.prototype=Ge,E},set:function(m){p(this,"then",m&&m.prototype===Ge?ps:{get:function(){return m},set:ps.set})}};function Gi(m,y,E,A,N){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.resolve=E,this.reject=A,this.psd=N}function pl(m,y){var E,A;Qt.push(y),m._state===null&&(E=m._lib&&xr(),y=zt(y),m._state=!1,m._value=y,A=m,Ut.some(function(N){return N._value===A._value})||Ut.push(A),Co(m),E&&pi())}function Co(m){var y=m._listeners;m._listeners=[];for(var E=0,A=y.length;E<A;++E)va(m,y[E]);var N=m._PSD;--N.ref||N.finalize(),Ot===0&&(++Ot,Ve(function(){--Ot==0&&Fr()},[]))}function va(m,y){if(m._state!==null){var E=m._state?y.onFulfilled:y.onRejected;if(E===null)return(m._state?y.resolve:y.reject)(m._value);++y.psd.ref,++Ot,Ve(gl,[E,m,y])}else m._listeners.push(y)}function gl(m,y,E){try{var A,N=y._value;!y._state&&Qt.length&&(Qt=[]),A=$&&y._consoleTask?y._consoleTask.run(function(){return m(N)}):m(N),y._state||Qt.indexOf(N)!==-1||function(W){for(var se=Ut.length;se;)if(Ut[--se]._value===W._value)return Ut.splice(se,1)}(y),E.resolve(A)}catch(W){E.reject(W)}finally{--Ot==0&&Fr(),--E.psd.ref||E.psd.finalize()}}function Ir(){bo(Ne,function(){xr()&&pi()})}function xr(){var m=pt;return At=pt=!1,m}function pi(){var m,y,E;do for(;0<yt.length;)for(m=yt,yt=[],E=m.length,y=0;y<E;++y){var A=m[y];A[0].apply(null,A[1])}while(0<yt.length);At=pt=!0}function Fr(){var m=Ut;Ut=[],m.forEach(function(A){A._PSD.onunhandled.call(null,A._value,A)});for(var y=Wt.slice(0),E=y.length;E;)y[--E]()}function Au(m){return new st(Ge,!1,m)}function kn(m,y){var E=je;return function(){var A=xr(),N=je;try{return js(E,!0),m.apply(this,arguments)}catch(W){y&&y(W)}finally{js(N,!1),A&&pi()}}}h(st.prototype,{then:ps,_then:function(m,y){va(this,new Gi(null,null,m,y,je))},catch:function(m){if(arguments.length===1)return this.then(null,m);var y=m,E=arguments[1];return typeof y=="function"?this.then(null,function(A){return(A instanceof y?E:Au)(A)}):this.then(null,function(A){return(A&&A.name===y?E:Au)(A)})},finally:function(m){return this.then(function(y){return st.resolve(m()).then(function(){return y})},function(y){return st.resolve(m()).then(function(){return Au(y)})})},timeout:function(m,y){var E=this;return m<1/0?new st(function(A,N){var W=setTimeout(function(){return N(new z.Timeout(y))},m);E.then(A,N).finally(clearTimeout.bind(null,W))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(st.prototype,Symbol.toStringTag,"Dexie.Promise"),Ne.env=ku(),h(st,{all:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&y([]);var A=m.length;m.forEach(function(N,W){return st.resolve(N).then(function(se){m[W]=se,--A||y(m)},E)})})},resolve:function(m){return m instanceof st?m:m&&typeof m.then=="function"?new st(function(y,E){m.then(y,E)}):new st(Ge,!0,m)},reject:Au,race:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.map(function(A){return st.resolve(A).then(y,E)})})},PSD:{get:function(){return je},set:function(m){return je=m}},totalEchoes:{get:function(){return Od}},newPSD:Ae,usePSD:bo,scheduler:{get:function(){return Ve},set:function(m){Ve=m}},rejectionMapper:{get:function(){return zt},set:function(m){zt=m}},follow:function(m,y){return new st(function(E,A){return Ae(function(N,W){var se=je;se.unhandleds=[],se.onunhandled=W,se.finalize=ce(function(){var le,Ce=this;le=function(){Ce.unhandleds.length===0?N():W(Ce.unhandleds[0])},Wt.push(function Re(){le(),Wt.splice(Wt.indexOf(Re),1)}),++Ot,Ve(function(){--Ot==0&&Fr()},[])},se.finalize),m()},y,E,A)})}}),Ue&&(Ue.allSettled&&p(st,"allSettled",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y){m.length===0&&y([]);var E=m.length,A=new Array(E);m.forEach(function(N,W){return st.resolve(N).then(function(se){return A[W]={status:"fulfilled",value:se}},function(se){return A[W]={status:"rejected",reason:se}}).then(function(){return--E||y(A)})})})}),Ue.any&&typeof AggregateError<"u"&&p(st,"any",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&E(new AggregateError([]));var A=m.length,N=new Array(A);m.forEach(function(W,se){return st.resolve(W).then(function(le){return y(le)},function(le){N[se]=le,--A||E(new AggregateError(N))})})})}),Ue.withResolvers&&(st.withResolvers=Ue.withResolvers));var gs={awaits:0,echoes:0,id:0},__=0,Ad=[],kd=0,Od=0,R_=0;function Ae(m,y,E,A){var N=je,W=Object.create(N);return W.parent=N,W.ref=0,W.global=!1,W.id=++R_,Ne.env,W.env=Ee?{Promise:st,PromiseProp:{value:st,configurable:!0,writable:!0},all:st.all,race:st.race,allSettled:st.allSettled,any:st.any,resolve:st.resolve,reject:st.reject}:{},y&&l(W,y),++N.ref,W.finalize=function(){--this.parent.ref||this.parent.finalize()},A=bo(W,m,E,A),W.ref===0&&W.finalize(),A}function Ye(){return gs.id||(gs.id=++__),++gs.awaits,gs.echoes+=we,gs.id}function jt(){return!!gs.awaits&&(--gs.awaits==0&&(gs.id=0),gs.echoes=gs.awaits*we,!0)}function sn(m){return gs.echoes&&m&&m.constructor===Ue?(Ye(),m.then(function(y){return jt(),y},function(y){return jt(),Kn(y)})):m}function Ui(){var m=Ad[Ad.length-1];Ad.pop(),js(m,!1)}function js(m,y){var E,A=je;(y?!gs.echoes||kd++&&m===je:!kd||--kd&&m===je)||queueMicrotask(y?(function(N){++Od,gs.echoes&&--gs.echoes!=0||(gs.echoes=gs.awaits=gs.id=0),Ad.push(je),js(N,!0)}).bind(null,m):Ui),m!==je&&(je=m,A===Ne&&(Ne.env=ku()),Ee&&(E=Ne.env.Promise,y=m.env,(A.global||m.global)&&(Object.defineProperty(i,"Promise",y.PromiseProp),E.all=y.all,E.race=y.race,E.resolve=y.resolve,E.reject=y.reject,y.allSettled&&(E.allSettled=y.allSettled),y.any&&(E.any=y.any))))}function ku(){var m=i.Promise;return Ee?{Promise:m,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:m.all,race:m.race,allSettled:m.allSettled,any:m.any,resolve:m.resolve,reject:m.reject}:{}}function bo(m,y,E,A,N){var W=je;try{return js(m,!0),y(E,A,N)}finally{js(W,!1)}}function Pr(m,y,E,A){return typeof m!="function"?m:function(){var N=je;E&&Ye(),js(y,!0);try{return m.apply(this,arguments)}finally{js(N,!1),A&&queueMicrotask(jt)}}}function Fy(m){Promise===Ue&&gs.echoes===0?kd===0?m():enqueueNativeMicroTask(m):setTimeout(m,0)}(""+mi).indexOf("[native code]")===-1&&(Ye=jt=be);var Kn=st.reject,ya="￿",gi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ou="String expected.",Md=[],Py="__dbnames",D_="readonly",T_="readwrite";function Mu(m,y){return m?y?function(){return m.apply(this,arguments)&&y.apply(this,arguments)}:m:y}var VB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ay(m){return typeof m!="string"||/\./.test(m)?function(y){return y}:function(y){return y[m]===void 0&&m in y&&delete(y=k(y))[m],y}}function BB(){throw z.Type()}function ln(m,y){try{var E=$B(m),A=$B(y);if(E!==A)return E==="Array"?1:A==="Array"?-1:E==="binary"?1:A==="binary"?-1:E==="string"?1:A==="string"?-1:E==="Date"?1:A!=="Date"?NaN:-1;switch(E){case"number":case"Date":case"string":return y<m?1:m<y?-1:0;case"binary":return function(N,W){for(var se=N.length,le=W.length,Ce=se<le?se:le,Re=0;Re<Ce;++Re)if(N[Re]!==W[Re])return N[Re]<W[Re]?-1:1;return se===le?0:se<le?-1:1}(HB(m),HB(y));case"Array":return function(N,W){for(var se=N.length,le=W.length,Ce=se<le?se:le,Re=0;Re<Ce;++Re){var Ie=ln(N[Re],W[Re]);if(Ie!==0)return Ie}return se===le?0:se<le?-1:1}(m,y)}}catch{}return NaN}function $B(m){var y=typeof m;return y!="object"?y:ArrayBuffer.isView(m)?"binary":(m=B(m),m==="ArrayBuffer"?"binary":m)}function HB(m){return m instanceof Uint8Array?m:ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m)}var GB=($n.prototype._trans=function(m,y,E){var A=this._tx||je.trans,N=this.name,W=$&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(m==="readonly"?"read":"write"," ").concat(this.name));function se(Re,Ie,de){if(!de.schema[N])throw new z.NotFound("Table "+N+" not part of transaction");return y(de.idbtrans,de)}var le=xr();try{var Ce=A&&A.db._novip===this.db._novip?A===je.trans?A._promise(m,se,E):Ae(function(){return A._promise(m,se,E)},{trans:A,transless:je.transless||je}):function Re(Ie,de,Pe,Se){if(Ie.idbdb&&(Ie._state.openComplete||je.letThrough||Ie._vip)){var Te=Ie._createTransaction(de,Pe,Ie._dbSchema);try{Te.create(),Ie._state.PR1398_maxLoop=3}catch(xe){return xe.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,de,Pe,Se)})):Kn(xe)}return Te._promise(de,function(xe,De){return Ae(function(){return je.trans=Te,Se(xe,De,Te)})}).then(function(xe){if(de==="readwrite")try{Te.idbtrans.commit()}catch{}return de==="readonly"?xe:Te._completion.then(function(){return xe})})}if(Ie._state.openComplete)return Kn(new z.DatabaseClosed(Ie._state.dbOpenError));if(!Ie._state.isBeingOpened){if(!Ie._state.autoOpen)return Kn(new z.DatabaseClosed);Ie.open().catch(be)}return Ie._state.dbReadyPromise.then(function(){return Re(Ie,de,Pe,Se)})}(this.db,m,[this.name],se);return W&&(Ce._consoleTask=W,Ce=Ce.catch(function(Re){return console.trace(Re),Kn(Re)})),Ce}finally{le&&pi()}},$n.prototype.get=function(m,y){var E=this;return m&&m.constructor===Object?this.where(m).first(y):m==null?Kn(new z.Type("Invalid argument to Table.get()")):this._trans("readonly",function(A){return E.core.get({trans:A,key:m}).then(function(N){return E.hook.reading.fire(N)})}).then(y)},$n.prototype.where=function(m){if(typeof m=="string")return new this.db.WhereClause(this,m);if(a(m))return new this.db.WhereClause(this,"[".concat(m.join("+"),"]"));var y=r(m);if(y.length===1)return this.where(y[0]).equals(m[y[0]]);var E=this.schema.indexes.concat(this.schema.primKey).filter(function(le){if(le.compound&&y.every(function(Re){return 0<=le.keyPath.indexOf(Re)})){for(var Ce=0;Ce<y.length;++Ce)if(y.indexOf(le.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(le,Ce){return le.keyPath.length-Ce.keyPath.length})[0];if(E&&this.db._maxKey!==ya){var W=E.keyPath.slice(0,y.length);return this.where(W).equals(W.map(function(Ce){return m[Ce]}))}!E&&$&&console.warn("The query ".concat(JSON.stringify(m)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(y.join("+"),"]"));var A=this.schema.idxByName;function N(le,Ce){return ln(le,Ce)===0}var se=y.reduce(function(de,Ce){var Re=de[0],Ie=de[1],de=A[Ce],Pe=m[Ce];return[Re||de,Re||!de?Mu(Ie,de&&de.multi?function(Se){return Se=R(Se,Ce),a(Se)&&Se.some(function(Te){return N(Pe,Te)})}:function(Se){return N(Pe,R(Se,Ce))}):Ie]},[null,null]),W=se[0],se=se[1];return W?this.where(W.name).equals(m[W.keyPath]).filter(se):E?this.filter(se):this.where(y).equals("")},$n.prototype.filter=function(m){return this.toCollection().and(m)},$n.prototype.count=function(m){return this.toCollection().count(m)},$n.prototype.offset=function(m){return this.toCollection().offset(m)},$n.prototype.limit=function(m){return this.toCollection().limit(m)},$n.prototype.each=function(m){return this.toCollection().each(m)},$n.prototype.toArray=function(m){return this.toCollection().toArray(m)},$n.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$n.prototype.orderBy=function(m){return new this.db.Collection(new this.db.WhereClause(this,a(m)?"[".concat(m.join("+"),"]"):m))},$n.prototype.reverse=function(){return this.toCollection().reverse()},$n.prototype.mapToClass=function(m){var y,E=this.db,A=this.name;function N(){return y!==null&&y.apply(this,arguments)||this}(this.schema.mappedClass=m).prototype instanceof BB&&(function(Ce,Re){if(typeof Re!="function"&&Re!==null)throw new TypeError("Class extends value "+String(Re)+" is not a constructor or null");function Ie(){this.constructor=Ce}n(Ce,Re),Ce.prototype=Re===null?Object.create(Re):(Ie.prototype=Re.prototype,new Ie)}(N,y=m),Object.defineProperty(N.prototype,"db",{get:function(){return E},enumerable:!1,configurable:!0}),N.prototype.table=function(){return A},m=N);for(var W=new Set,se=m.prototype;se;se=u(se))Object.getOwnPropertyNames(se).forEach(function(Ce){return W.add(Ce)});function le(Ce){if(!Ce)return Ce;var Re,Ie=Object.create(m.prototype);for(Re in Ce)if(!W.has(Re))try{Ie[Re]=Ce[Re]}catch{}return Ie}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=le,this.hook("reading",le),m},$n.prototype.defineClass=function(){return this.mapToClass(function(m){l(this,m)})},$n.prototype.add=function(m,y){var E=this,A=this.schema.primKey,N=A.auto,W=A.keyPath,se=m;return W&&N&&(se=Ay(W)(m)),this._trans("readwrite",function(le){return E.core.mutate({trans:le,type:"add",keys:y!=null?[y]:null,values:[se]})}).then(function(le){return le.numFailures?st.reject(le.failures[0]):le.lastResult}).then(function(le){if(W)try{T(m,W,le)}catch{}return le})},$n.prototype.update=function(m,y){return typeof m!="object"||a(m)?this.where(":id").equals(m).modify(y):(m=R(m,this.schema.primKey.keyPath),m===void 0?Kn(new z.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(m).modify(y))},$n.prototype.put=function(m,y){var E=this,A=this.schema.primKey,N=A.auto,W=A.keyPath,se=m;return W&&N&&(se=Ay(W)(m)),this._trans("readwrite",function(le){return E.core.mutate({trans:le,type:"put",values:[se],keys:y!=null?[y]:null})}).then(function(le){return le.numFailures?st.reject(le.failures[0]):le.lastResult}).then(function(le){if(W)try{T(m,W,le)}catch{}return le})},$n.prototype.delete=function(m){var y=this;return this._trans("readwrite",function(E){return y.core.mutate({trans:E,type:"delete",keys:[m]})}).then(function(E){return E.numFailures?st.reject(E.failures[0]):void 0})},$n.prototype.clear=function(){var m=this;return this._trans("readwrite",function(y){return m.core.mutate({trans:y,type:"deleteRange",range:VB})}).then(function(y){return y.numFailures?st.reject(y.failures[0]):void 0})},$n.prototype.bulkGet=function(m){var y=this;return this._trans("readonly",function(E){return y.core.getMany({keys:m,trans:E}).then(function(A){return A.map(function(N){return y.hook.reading.fire(N)})})})},$n.prototype.bulkAdd=function(m,y,E){var A=this,N=Array.isArray(y)?y:void 0,W=(E=E||(N?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var Re=A.schema.primKey,le=Re.auto,Re=Re.keyPath;if(Re&&N)throw new z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(N&&N.length!==m.length)throw new z.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&le?m.map(Ay(Re)):m;return A.core.mutate({trans:se,type:"add",keys:N,values:Re,wantResults:W}).then(function(Te){var de=Te.numFailures,Pe=Te.results,Se=Te.lastResult,Te=Te.failures;if(de===0)return W?Pe:Se;throw new me("".concat(A.name,".bulkAdd(): ").concat(de," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkPut=function(m,y,E){var A=this,N=Array.isArray(y)?y:void 0,W=(E=E||(N?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var Re=A.schema.primKey,le=Re.auto,Re=Re.keyPath;if(Re&&N)throw new z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(N&&N.length!==m.length)throw new z.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&le?m.map(Ay(Re)):m;return A.core.mutate({trans:se,type:"put",keys:N,values:Re,wantResults:W}).then(function(Te){var de=Te.numFailures,Pe=Te.results,Se=Te.lastResult,Te=Te.failures;if(de===0)return W?Pe:Se;throw new me("".concat(A.name,".bulkPut(): ").concat(de," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkUpdate=function(m){var y=this,E=this.core,A=m.map(function(se){return se.key}),N=m.map(function(se){return se.changes}),W=[];return this._trans("readwrite",function(se){return E.getMany({trans:se,keys:A,cache:"clone"}).then(function(le){var Ce=[],Re=[];m.forEach(function(de,Pe){var Se=de.key,Te=de.changes,xe=le[Pe];if(xe){for(var De=0,Me=Object.keys(Te);De<Me.length;De++){var $e=Me[De],He=Te[$e];if($e===y.schema.primKey.keyPath){if(ln(He,Se)!==0)throw new z.Constraint("Cannot update primary key in bulkUpdate()")}else T(xe,$e,He)}W.push(Pe),Ce.push(Se),Re.push(xe)}});var Ie=Ce.length;return E.mutate({trans:se,type:"put",keys:Ce,values:Re,updates:{keys:A,changeSpecs:N}}).then(function(de){var Pe=de.numFailures,Se=de.failures;if(Pe===0)return Ie;for(var Te=0,xe=Object.keys(Se);Te<xe.length;Te++){var De,Me=xe[Te],$e=W[Number(Me)];$e!=null&&(De=Se[Me],delete Se[Me],Se[$e]=De)}throw new me("".concat(y.name,".bulkUpdate(): ").concat(Pe," of ").concat(Ie," operations failed"),Se)})})})},$n.prototype.bulkDelete=function(m){var y=this,E=m.length;return this._trans("readwrite",function(A){return y.core.mutate({trans:A,type:"delete",keys:m})}).then(function(se){var N=se.numFailures,W=se.lastResult,se=se.failures;if(N===0)return W;throw new me("".concat(y.name,".bulkDelete(): ").concat(N," of ").concat(E," operations failed"),se)})},$n);function $n(){}function yp(m){function y(se,le){if(le){for(var Ce=arguments.length,Re=new Array(Ce-1);--Ce;)Re[Ce-1]=arguments[Ce];return E[se].subscribe.apply(null,Re),m}if(typeof se=="string")return E[se]}var E={};y.addEventType=W;for(var A=1,N=arguments.length;A<N;++A)W(arguments[A]);return y;function W(se,le,Ce){if(typeof se!="object"){var Re;le=le||ye;var Ie={subscribers:[],fire:Ce=Ce||be,subscribe:function(de){Ie.subscribers.indexOf(de)===-1&&(Ie.subscribers.push(de),Ie.fire=le(Ie.fire,de))},unsubscribe:function(de){Ie.subscribers=Ie.subscribers.filter(function(Pe){return Pe!==de}),Ie.fire=Ie.subscribers.reduce(le,Ce)}};return E[se]=y[se]=Ie}r(Re=se).forEach(function(de){var Pe=Re[de];if(a(Pe))W(de,Re[de][0],Re[de][1]);else{if(Pe!=="asap")throw new z.InvalidArgument("Invalid event config");var Se=W(de,G,function(){for(var Te=arguments.length,xe=new Array(Te);Te--;)xe[Te]=arguments[Te];Se.subscribers.forEach(function(De){_(function(){De.apply(null,xe)})})})}})}}function wp(m,y){return g(y).from({prototype:m}),y}function Nd(m,y){return!(m.filter||m.algorithm||m.or)&&(y?m.justLimit:!m.replayFilter)}function I_(m,y){m.filter=Mu(m.filter,y)}function x_(m,y,E){var A=m.replayFilter;m.replayFilter=A?function(){return Mu(A(),y())}:y,m.justLimit=E&&!A}function ky(m,y){if(m.isPrimKey)return y.primaryKey;var E=y.getIndexByKeyPath(m.index);if(!E)throw new z.Schema("KeyPath "+m.index+" on object store "+y.name+" is not indexed");return E}function UB(m,y,E){var A=ky(m,y.schema);return y.openCursor({trans:E,values:!m.keysOnly,reverse:m.dir==="prev",unique:!!m.unique,query:{index:A,range:m.range}})}function Oy(m,y,E,A){var N=m.replayFilter?Mu(m.filter,m.replayFilter()):m.filter;if(m.or){var W={},se=function(le,Ce,Re){var Ie,de;N&&!N(Ce,Re,function(Pe){return Ce.stop(Pe)},function(Pe){return Ce.fail(Pe)})||((de=""+(Ie=Ce.primaryKey))=="[object ArrayBuffer]"&&(de=""+new Uint8Array(Ie)),d(W,de)||(W[de]=!0,y(le,Ce,Re)))};return Promise.all([m.or._iterate(se,E),WB(UB(m,A,E),m.algorithm,se,!m.keysOnly&&m.valueMapper)])}return WB(UB(m,A,E),Mu(m.algorithm,N),y,!m.keysOnly&&m.valueMapper)}function WB(m,y,E,A){var N=kn(A?function(W,se,le){return E(A(W),se,le)}:E);return m.then(function(W){if(W)return W.start(function(){var se=function(){return W.continue()};y&&!y(W,function(le){return se=le},function(le){W.stop(le),se=be},function(le){W.fail(le),se=be})||N(W.value,W,function(le){return se=le}),se()})})}var wa=Symbol(),Cp=(zB.prototype.execute=function(m){if(this.add!==void 0){var y=this.add;if(a(y))return o(o([],a(m)?m:[],!0),y).sort();if(typeof y=="number")return(Number(m)||0)+y;if(typeof y=="bigint")try{return BigInt(m)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(this.remove!==void 0){var E=this.remove;if(a(E))return a(m)?m.filter(function(A){return!E.includes(A)}).sort():[];if(typeof E=="number")return Number(m)-E;if(typeof E=="bigint")try{return BigInt(m)-E}catch{return BigInt(0)-E}throw new TypeError("Invalid subtrahend ".concat(E))}return y=(y=this.replacePrefix)===null||y===void 0?void 0:y[0],y&&typeof m=="string"&&m.startsWith(y)?this.replacePrefix[1]+m.substring(y.length):m},zB);function zB(m){Object.assign(this,m)}var sbe=(mn.prototype._read=function(m,y){var E=this._ctx;return E.error?E.table._trans(null,Kn.bind(null,E.error)):E.table._trans("readonly",m).then(y)},mn.prototype._write=function(m){var y=this._ctx;return y.error?y.table._trans(null,Kn.bind(null,y.error)):y.table._trans("readwrite",m,"locked")},mn.prototype._addAlgorithm=function(m){var y=this._ctx;y.algorithm=Mu(y.algorithm,m)},mn.prototype._iterate=function(m,y){return Oy(this._ctx,m,y,this._ctx.table.core)},mn.prototype.clone=function(m){var y=Object.create(this.constructor.prototype),E=Object.create(this._ctx);return m&&l(E,m),y._ctx=E,y},mn.prototype.raw=function(){return this._ctx.valueMapper=null,this},mn.prototype.each=function(m){var y=this._ctx;return this._read(function(E){return Oy(y,m,E,y.table.core)})},mn.prototype.count=function(m){var y=this;return this._read(function(E){var A=y._ctx,N=A.table.core;if(Nd(A,!0))return N.count({trans:E,query:{index:ky(A,N.schema),range:A.range}}).then(function(se){return Math.min(se,A.limit)});var W=0;return Oy(A,function(){return++W,!1},E,N).then(function(){return W})}).then(m)},mn.prototype.sortBy=function(m,y){var E=m.split(".").reverse(),A=E[0],N=E.length-1;function W(Ce,Re){return Re?W(Ce[E[Re]],Re-1):Ce[A]}var se=this._ctx.dir==="next"?1:-1;function le(Ce,Re){return ln(W(Ce,N),W(Re,N))*se}return this.toArray(function(Ce){return Ce.sort(le)}).then(y)},mn.prototype.toArray=function(m){var y=this;return this._read(function(E){var A=y._ctx;if(A.dir==="next"&&Nd(A,!0)&&0<A.limit){var N=A.valueMapper,W=ky(A,A.table.core.schema);return A.table.core.query({trans:E,limit:A.limit,values:!0,query:{index:W,range:A.range}}).then(function(le){return le=le.result,N?le.map(N):le})}var se=[];return Oy(A,function(le){return se.push(le)},E,A.table.core).then(function(){return se})},m)},mn.prototype.offset=function(m){var y=this._ctx;return m<=0||(y.offset+=m,Nd(y)?x_(y,function(){var E=m;return function(A,N){return E===0||(E===1?--E:N(function(){A.advance(E),E=0}),!1)}}):x_(y,function(){var E=m;return function(){return--E<0}})),this},mn.prototype.limit=function(m){return this._ctx.limit=Math.min(this._ctx.limit,m),x_(this._ctx,function(){var y=m;return function(E,A,N){return--y<=0&&A(N),0<=y}},!0),this},mn.prototype.until=function(m,y){return I_(this._ctx,function(E,A,N){return!m(E.value)||(A(N),y)}),this},mn.prototype.first=function(m){return this.limit(1).toArray(function(y){return y[0]}).then(m)},mn.prototype.last=function(m){return this.reverse().first(m)},mn.prototype.filter=function(m){var y;return I_(this._ctx,function(E){return m(E.value)}),(y=this._ctx).isMatch=Mu(y.isMatch,m),this},mn.prototype.and=function(m){return this.filter(m)},mn.prototype.or=function(m){return new this.db.WhereClause(this._ctx.table,m,this)},mn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mn.prototype.desc=function(){return this.reverse()},mn.prototype.eachKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.key,A)})},mn.prototype.eachUniqueKey=function(m){return this._ctx.unique="unique",this.eachKey(m)},mn.prototype.eachPrimaryKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.primaryKey,A)})},mn.prototype.keys=function(m){var y=this._ctx;y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,N){E.push(N.key)}).then(function(){return E}).then(m)},mn.prototype.primaryKeys=function(m){var y=this._ctx;if(y.dir==="next"&&Nd(y,!0)&&0<y.limit)return this._read(function(A){var N=ky(y,y.table.core.schema);return y.table.core.query({trans:A,values:!1,limit:y.limit,query:{index:N,range:y.range}})}).then(function(A){return A.result}).then(m);y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,N){E.push(N.primaryKey)}).then(function(){return E}).then(m)},mn.prototype.uniqueKeys=function(m){return this._ctx.unique="unique",this.keys(m)},mn.prototype.firstKey=function(m){return this.limit(1).keys(function(y){return y[0]}).then(m)},mn.prototype.lastKey=function(m){return this.reverse().firstKey(m)},mn.prototype.distinct=function(){var m=this._ctx,m=m.index&&m.table.schema.idxByName[m.index];if(!m||!m.multi)return this;var y={};return I_(this._ctx,function(N){var A=N.primaryKey.toString(),N=d(y,A);return y[A]=!0,!N}),this},mn.prototype.modify=function(m){var y=this,E=this._ctx;return this._write(function(A){var N,W,se;se=typeof m=="function"?m:(N=r(m),W=N.length,function(De){for(var Me=!1,$e=0;$e<W;++$e){var He=N[$e],Ze=m[He],ot=R(De,He);Ze instanceof Cp?(T(De,He,Ze.execute(ot)),Me=!0):ot!==Ze&&(T(De,He,Ze),Me=!0)}return Me});var le=E.table.core,de=le.schema.primaryKey,Ce=de.outbound,Re=de.extractKey,Ie=200,de=y.db._options.modifyChunkSize;de&&(Ie=typeof de=="object"?de[le.name]||de["*"]||200:de);function Pe(De,He){var $e=He.failures,He=He.numFailures;Te+=De-He;for(var Ze=0,ot=r($e);Ze<ot.length;Ze++){var gt=ot[Ze];Se.push($e[gt])}}var Se=[],Te=0,xe=[];return y.clone().primaryKeys().then(function(De){function Me(He){var Ze=Math.min(Ie,De.length-He);return le.getMany({trans:A,keys:De.slice(He,He+Ze),cache:"immutable"}).then(function(ot){for(var gt=[],it=[],at=Ce?[]:null,St=[],ht=0;ht<Ze;++ht){var Rt=ot[ht],Zt={value:k(Rt),primKey:De[He+ht]};se.call(Zt,Zt.value,Zt)!==!1&&(Zt.value==null?St.push(De[He+ht]):Ce||ln(Re(Rt),Re(Zt.value))===0?(it.push(Zt.value),Ce&&at.push(De[He+ht])):(St.push(De[He+ht]),gt.push(Zt.value)))}return Promise.resolve(0<gt.length&&le.mutate({trans:A,type:"add",values:gt}).then(function(on){for(var rn in on.failures)St.splice(parseInt(rn),1);Pe(gt.length,on)})).then(function(){return(0<it.length||$e&&typeof m=="object")&&le.mutate({trans:A,type:"put",keys:at,values:it,criteria:$e,changeSpec:typeof m!="function"&&m,isAdditionalChunk:0<He}).then(function(on){return Pe(it.length,on)})}).then(function(){return(0<St.length||$e&&m===F_)&&le.mutate({trans:A,type:"delete",keys:St,criteria:$e,isAdditionalChunk:0<He}).then(function(on){return Pe(St.length,on)})}).then(function(){return De.length>He+Ze&&Me(He+Ie)})})}var $e=Nd(E)&&E.limit===1/0&&(typeof m!="function"||m===F_)&&{index:E.index,range:E.range};return Me(0).then(function(){if(0<Se.length)throw new he("Error modifying one or more objects",Se,Te,xe);return De.length})})})},mn.prototype.delete=function(){var m=this._ctx,y=m.range;return Nd(m)&&(m.isPrimKey||y.type===3)?this._write(function(E){var A=m.table.core.schema.primaryKey,N=y;return m.table.core.count({trans:E,query:{index:A,range:N}}).then(function(W){return m.table.core.mutate({trans:E,type:"deleteRange",range:N}).then(function(se){var le=se.failures;if(se.lastResult,se.results,se=se.numFailures,se)throw new he("Could not delete some values",Object.keys(le).map(function(Ce){return le[Ce]}),W-se);return W-se})})}):this.modify(F_)},mn);function mn(){}var F_=function(m,y){return y.value=null};function obe(m,y){return m<y?-1:m===y?0:1}function ibe(m,y){return y<m?-1:m===y?0:1}function Uo(m,y,E){return m=m instanceof KB?new m.Collection(m):m,m._ctx.error=new(E||TypeError)(y),m}function Ld(m){return new m.Collection(m,function(){return jB("")}).limit(0)}function My(m,y,E,A){var N,W,se,le,Ce,Re,Ie,de=E.length;if(!E.every(function(Te){return typeof Te=="string"}))return Uo(m,Ou);function Pe(Te){N=Te==="next"?function(De){return De.toUpperCase()}:function(De){return De.toLowerCase()},W=Te==="next"?function(De){return De.toLowerCase()}:function(De){return De.toUpperCase()},se=Te==="next"?obe:ibe;var xe=E.map(function(De){return{lower:W(De),upper:N(De)}}).sort(function(De,Me){return se(De.lower,Me.lower)});le=xe.map(function(De){return De.upper}),Ce=xe.map(function(De){return De.lower}),Ie=(Re=Te)==="next"?"":A}Pe("next"),m=new m.Collection(m,function(){return ml(le[0],Ce[de-1]+A)}),m._ondirectionchange=function(Te){Pe(Te)};var Se=0;return m._addAlgorithm(function(Te,xe,De){var Me=Te.key;if(typeof Me!="string")return!1;var $e=W(Me);if(y($e,Ce,Se))return!0;for(var He=null,Ze=Se;Ze<de;++Ze){var ot=function(gt,it,at,St,ht,Rt){for(var Zt=Math.min(gt.length,St.length),on=-1,rn=0;rn<Zt;++rn){var Wo=it[rn];if(Wo!==St[rn])return ht(gt[rn],at[rn])<0?gt.substr(0,rn)+at[rn]+at.substr(rn+1):ht(gt[rn],St[rn])<0?gt.substr(0,rn)+St[rn]+at.substr(rn+1):0<=on?gt.substr(0,on)+it[on]+at.substr(on+1):null;ht(gt[rn],Wo)<0&&(on=rn)}return Zt<St.length&&Rt==="next"?gt+at.substr(gt.length):Zt<gt.length&&Rt==="prev"?gt.substr(0,at.length):on<0?null:gt.substr(0,on)+St[on]+at.substr(on+1)}(Me,$e,le[Ze],Ce[Ze],se,Re);ot===null&&He===null?Se=Ze+1:(He===null||0<se(He,ot))&&(He=ot)}return xe(He!==null?function(){Te.continue(He+Ie)}:De),!1}),m}function ml(m,y,E,A){return{type:2,lower:m,upper:y,lowerOpen:E,upperOpen:A}}function jB(m){return{type:1,lower:m,upper:m}}var KB=(Object.defineProperty(Is.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Is.prototype.between=function(m,y,E,A){E=E!==!1,A=A===!0;try{return 0<this._cmp(m,y)||this._cmp(m,y)===0&&(E||A)&&(!E||!A)?Ld(this):new this.Collection(this,function(){return ml(m,y,!E,!A)})}catch{return Uo(this,gi)}},Is.prototype.equals=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return jB(m)})},Is.prototype.above=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!0)})},Is.prototype.aboveOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!1)})},Is.prototype.below=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m,!1,!0)})},Is.prototype.belowOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m)})},Is.prototype.startsWith=function(m){return typeof m!="string"?Uo(this,Ou):this.between(m,m+ya,!0,!0)},Is.prototype.startsWithIgnoreCase=function(m){return m===""?this.startsWith(m):My(this,function(y,E){return y.indexOf(E[0])===0},[m],ya)},Is.prototype.equalsIgnoreCase=function(m){return My(this,function(y,E){return y===E[0]},[m],"")},Is.prototype.anyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.indexOf(y)!==-1},m,"")},Is.prototype.startsWithAnyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.some(function(A){return y.indexOf(A)===0})},m,ya)},Is.prototype.anyOf=function(){var m=this,y=ve.apply(X,arguments),E=this._cmp;try{y.sort(E)}catch{return Uo(this,gi)}if(y.length===0)return Ld(this);var A=new this.Collection(this,function(){return ml(y[0],y[y.length-1])});A._ondirectionchange=function(W){E=W==="next"?m._ascending:m._descending,y.sort(E)};var N=0;return A._addAlgorithm(function(W,se,le){for(var Ce=W.key;0<E(Ce,y[N]);)if(++N===y.length)return se(le),!1;return E(Ce,y[N])===0||(se(function(){W.continue(y[N])}),!1)}),A},Is.prototype.notEqual=function(m){return this.inAnyRange([[-1/0,m],[m,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Is.prototype.noneOf=function(){var m=ve.apply(X,arguments);if(m.length===0)return new this.Collection(this);try{m.sort(this._ascending)}catch{return Uo(this,gi)}var y=m.reduce(function(E,A){return E?E.concat([[E[E.length-1][1],A]]):[[-1/0,A]]},null);return y.push([m[m.length-1],this.db._maxKey]),this.inAnyRange(y,{includeLowers:!1,includeUppers:!1})},Is.prototype.inAnyRange=function(Me,y){var E=this,A=this._cmp,N=this._ascending,W=this._descending,se=this._min,le=this._max;if(Me.length===0)return Ld(this);if(!Me.every(function($e){return $e[0]!==void 0&&$e[1]!==void 0&&N($e[0],$e[1])<=0}))return Uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",z.InvalidArgument);var Ce=!y||y.includeLowers!==!1,Re=y&&y.includeUppers===!0,Ie,de=N;function Pe($e,He){return de($e[0],He[0])}try{(Ie=Me.reduce(function($e,He){for(var Ze=0,ot=$e.length;Ze<ot;++Ze){var gt=$e[Ze];if(A(He[0],gt[1])<0&&0<A(He[1],gt[0])){gt[0]=se(gt[0],He[0]),gt[1]=le(gt[1],He[1]);break}}return Ze===ot&&$e.push(He),$e},[])).sort(Pe)}catch{return Uo(this,gi)}var Se=0,Te=Re?function($e){return 0<N($e,Ie[Se][1])}:function($e){return 0<=N($e,Ie[Se][1])},xe=Ce?function($e){return 0<W($e,Ie[Se][0])}:function($e){return 0<=W($e,Ie[Se][0])},De=Te,Me=new this.Collection(this,function(){return ml(Ie[0][0],Ie[Ie.length-1][1],!Ce,!Re)});return Me._ondirectionchange=function($e){de=$e==="next"?(De=Te,N):(De=xe,W),Ie.sort(Pe)},Me._addAlgorithm(function($e,He,Ze){for(var ot,gt=$e.key;De(gt);)if(++Se===Ie.length)return He(Ze),!1;return!Te(ot=gt)&&!xe(ot)||(E._cmp(gt,Ie[Se][1])===0||E._cmp(gt,Ie[Se][0])===0||He(function(){de===N?$e.continue(Ie[Se][0]):$e.continue(Ie[Se][1])}),!1)}),Me},Is.prototype.startsWithAnyOf=function(){var m=ve.apply(X,arguments);return m.every(function(y){return typeof y=="string"})?m.length===0?Ld(this):this.inAnyRange(m.map(function(y){return[y,y+ya]})):Uo(this,"startsWithAnyOf() only works with strings")},Is);function Is(){}function Ar(m){return kn(function(y){return bp(y),m(y.target.error),!1})}function bp(m){m.stopPropagation&&m.stopPropagation(),m.preventDefault&&m.preventDefault()}var Sp="storagemutated",P_="x-storagemutated-1",vl=yp(null,Sp),rbe=(kr.prototype._lock=function(){return w(!je.global),++this._reculock,this._reculock!==1||je.global||(je.lockOwnerFor=this),this},kr.prototype._unlock=function(){if(w(!je.global),--this._reculock==0)for(je.global||(je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var m=this._blockedFuncs.shift();try{bo(m[1],m[0])}catch{}}return this},kr.prototype._locked=function(){return this._reculock&&je.lockOwnerFor!==this},kr.prototype.create=function(m){var y=this;if(!this.mode)return this;var E=this.db.idbdb,A=this.db._state.dbOpenError;if(w(!this.idbtrans),!m&&!E)switch(A&&A.name){case"DatabaseClosedError":throw new z.DatabaseClosed(A);case"MissingAPIError":throw new z.MissingAPI(A.message,A);default:throw new z.OpenFailed(A)}if(!this.active)throw new z.TransactionInactive;return w(this._completion._state===null),(m=this.idbtrans=m||(this.db.core||E).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=kn(function(N){bp(N),y._reject(m.error)}),m.onabort=kn(function(N){bp(N),y.active&&y._reject(new z.Abort(m.error)),y.active=!1,y.on("abort").fire(N)}),m.oncomplete=kn(function(){y.active=!1,y._resolve(),"mutatedParts"in m&&vl.storagemutated.fire(m.mutatedParts)}),this},kr.prototype._promise=function(m,y,E){var A=this;if(m==="readwrite"&&this.mode!=="readwrite")return Kn(new z.ReadOnly("Transaction is readonly"));if(!this.active)return Kn(new z.TransactionInactive);if(this._locked())return new st(function(W,se){A._blockedFuncs.push([function(){A._promise(m,y,E).then(W,se)},je])});if(E)return Ae(function(){var W=new st(function(se,le){A._lock();var Ce=y(se,le,A);Ce&&Ce.then&&Ce.then(se,le)});return W.finally(function(){return A._unlock()}),W._lib=!0,W});var N=new st(function(W,se){var le=y(W,se,A);le&&le.then&&le.then(W,se)});return N._lib=!0,N},kr.prototype._root=function(){return this.parent?this.parent._root():this},kr.prototype.waitFor=function(m){var y,E=this._root(),A=st.resolve(m);E._waitingFor?E._waitingFor=E._waitingFor.then(function(){return A}):(E._waitingFor=A,E._waitingQueue=[],y=E.idbtrans.objectStore(E.storeNames[0]),function W(){for(++E._spinCount;E._waitingQueue.length;)E._waitingQueue.shift()();E._waitingFor&&(y.get(-1/0).onsuccess=W)}());var N=E._waitingFor;return new st(function(W,se){A.then(function(le){return E._waitingQueue.push(kn(W.bind(null,le)))},function(le){return E._waitingQueue.push(kn(se.bind(null,le)))}).finally(function(){E._waitingFor===N&&(E._waitingFor=null)})})},kr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new z.Abort))},kr.prototype.table=function(m){var y=this._memoizedTables||(this._memoizedTables={});if(d(y,m))return y[m];var E=this.schema[m];if(!E)throw new z.NotFound("Table "+m+" not part of transaction");return E=new this.db.Table(m,E,this),E.core=this.db.core.table(m),y[m]=E},kr);function kr(){}function A_(m,y,E,A,N,W,se){return{name:m,keyPath:y,unique:E,multi:A,auto:N,compound:W,src:(E&&!se?"&":"")+(A?"*":"")+(N?"++":"")+qB(y)}}function qB(m){return typeof m=="string"?m:m?"["+[].join.call(m,"+")+"]":""}function k_(m,y,E){return{name:m,primKey:y,indexes:E,mappedClass:null,idxByName:(A=function(N){return[N.name,N]},E.reduce(function(N,W,se){return se=A(W,se),se&&(N[se[0]]=se[1]),N},{}))};var A}var Ep=function(m){try{return m.only([[]]),Ep=function(){return[[]]},[[]]}catch{return Ep=function(){return ya},ya}};function O_(m){return m==null?function(){}:typeof m=="string"?(y=m).split(".").length===1?function(E){return E[y]}:function(E){return R(E,y)}:function(E){return R(E,m)};var y}function YB(m){return[].slice.call(m)}var abe=0;function _p(m){return m==null?":id":typeof m=="string"?m:"[".concat(m.join("+"),"]")}function lbe(m,y,Ce){function A(De){if(De.type===3)return null;if(De.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var Se=De.lower,Te=De.upper,xe=De.lowerOpen,De=De.upperOpen;return Se===void 0?Te===void 0?null:y.upperBound(Te,!!De):Te===void 0?y.lowerBound(Se,!!xe):y.bound(Se,Te,!!xe,!!De)}function N(Pe){var Se,Te=Pe.name;return{name:Te,schema:Pe,mutate:function(xe){var De=xe.trans,Me=xe.type,$e=xe.keys,He=xe.values,Ze=xe.range;return new Promise(function(ot,gt){ot=kn(ot);var it=De.objectStore(Te),at=it.keyPath==null,St=Me==="put"||Me==="add";if(!St&&Me!=="delete"&&Me!=="deleteRange")throw new Error("Invalid operation type: "+Me);var ht,Rt=($e||He||{length:1}).length;if($e&&He&&$e.length!==He.length)throw new Error("Given keys array must have same length as given values array.");if(Rt===0)return ot({numFailures:0,failures:{},results:[],lastResult:void 0});function Zt(oo){++Wo,bp(oo)}var on=[],rn=[],Wo=0;if(Me==="deleteRange"){if(Ze.type===4)return ot({numFailures:Wo,failures:rn,results:[],lastResult:void 0});Ze.type===3?on.push(ht=it.clear()):on.push(ht=it.delete(A(Ze)))}else{var at=St?at?[He,$e]:[He,null]:[$e,null],Kt=at[0],qs=at[1];if(St)for(var Ys=0;Ys<Rt;++Ys)on.push(ht=qs&&qs[Ys]!==void 0?it[Me](Kt[Ys],qs[Ys]):it[Me](Kt[Ys])),ht.onerror=Zt;else for(Ys=0;Ys<Rt;++Ys)on.push(ht=it[Me](Kt[Ys])),ht.onerror=Zt}function qy(oo){oo=oo.target.result,on.forEach(function(Vu,J_){return Vu.error!=null&&(rn[J_]=Vu.error)}),ot({numFailures:Wo,failures:rn,results:Me==="delete"?$e:on.map(function(Vu){return Vu.result}),lastResult:oo})}ht.onerror=function(oo){Zt(oo),qy(oo)},ht.onsuccess=qy})},getMany:function(xe){var De=xe.trans,Me=xe.keys;return new Promise(function($e,He){$e=kn($e);for(var Ze,ot=De.objectStore(Te),gt=Me.length,it=new Array(gt),at=0,St=0,ht=function(on){on=on.target,it[on._pos]=on.result,++St===at&&$e(it)},Rt=Ar(He),Zt=0;Zt<gt;++Zt)Me[Zt]!=null&&((Ze=ot.get(Me[Zt]))._pos=Zt,Ze.onsuccess=ht,Ze.onerror=Rt,++at);at===0&&$e(it)})},get:function(xe){var De=xe.trans,Me=xe.key;return new Promise(function($e,He){$e=kn($e);var Ze=De.objectStore(Te).get(Me);Ze.onsuccess=function(ot){return $e(ot.target.result)},Ze.onerror=Ar(He)})},query:(Se=Re,function(xe){return new Promise(function(De,Me){De=kn(De);var $e,He,Ze,at=xe.trans,ot=xe.values,gt=xe.limit,ht=xe.query,it=gt===1/0?void 0:gt,St=ht.index,ht=ht.range,at=at.objectStore(Te),St=St.isPrimaryKey?at:at.index(St.name),ht=A(ht);if(gt===0)return De({result:[]});Se?((it=ot?St.getAll(ht,it):St.getAllKeys(ht,it)).onsuccess=function(Rt){return De({result:Rt.target.result})},it.onerror=Ar(Me)):($e=0,He=!ot&&"openKeyCursor"in St?St.openKeyCursor(ht):St.openCursor(ht),Ze=[],He.onsuccess=function(Rt){var Zt=He.result;return Zt?(Ze.push(ot?Zt.value:Zt.primaryKey),++$e===gt?De({result:Ze}):void Zt.continue()):De({result:Ze})},He.onerror=Ar(Me))})}),openCursor:function(xe){var De=xe.trans,Me=xe.values,$e=xe.query,He=xe.reverse,Ze=xe.unique;return new Promise(function(ot,gt){ot=kn(ot);var St=$e.index,it=$e.range,at=De.objectStore(Te),at=St.isPrimaryKey?at:at.index(St.name),St=He?Ze?"prevunique":"prev":Ze?"nextunique":"next",ht=!Me&&"openKeyCursor"in at?at.openKeyCursor(A(it),St):at.openCursor(A(it),St);ht.onerror=Ar(gt),ht.onsuccess=kn(function(Rt){var Zt,on,rn,Wo,Kt=ht.result;Kt?(Kt.___id=++abe,Kt.done=!1,Zt=Kt.continue.bind(Kt),on=(on=Kt.continuePrimaryKey)&&on.bind(Kt),rn=Kt.advance.bind(Kt),Wo=function(){throw new Error("Cursor not stopped")},Kt.trans=De,Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=function(){throw new Error("Cursor not started")},Kt.fail=kn(gt),Kt.next=function(){var qs=this,Ys=1;return this.start(function(){return Ys--?qs.continue():qs.stop()}).then(function(){return qs})},Kt.start=function(qs){function Ys(){if(ht.result)try{qs()}catch(oo){Kt.fail(oo)}else Kt.done=!0,Kt.start=function(){throw new Error("Cursor behind last entry")},Kt.stop()}var qy=new Promise(function(oo,Vu){oo=kn(oo),ht.onerror=Ar(Vu),Kt.fail=Vu,Kt.stop=function(J_){Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=Wo,oo(J_)}});return ht.onsuccess=kn(function(oo){ht.onsuccess=Ys,Ys()}),Kt.continue=Zt,Kt.continuePrimaryKey=on,Kt.advance=rn,Ys(),qy},ot(Kt)):ot(null)},gt)})},count:function(xe){var De=xe.query,Me=xe.trans,$e=De.index,He=De.range;return new Promise(function(Ze,ot){var gt=Me.objectStore(Te),it=$e.isPrimaryKey?gt:gt.index($e.name),gt=A(He),it=gt?it.count(gt):it.count();it.onsuccess=kn(function(at){return Ze(at.target.result)}),it.onerror=Ar(ot)})}}}var W,se,le,Ie=(se=Ce,le=YB((W=m).objectStoreNames),{schema:{name:W.name,tables:le.map(function(Pe){return se.objectStore(Pe)}).map(function(Pe){var Se=Pe.keyPath,De=Pe.autoIncrement,Te=a(Se),xe={},De={name:Pe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Se==null,compound:Te,keyPath:Se,autoIncrement:De,unique:!0,extractKey:O_(Se)},indexes:YB(Pe.indexNames).map(function(Me){return Pe.index(Me)}).map(function(Ze){var $e=Ze.name,He=Ze.unique,ot=Ze.multiEntry,Ze=Ze.keyPath,ot={name:$e,compound:a(Ze),keyPath:Ze,unique:He,multiEntry:ot,extractKey:O_(Ze)};return xe[_p(Ze)]=ot}),getIndexByKeyPath:function(Me){return xe[_p(Me)]}};return xe[":id"]=De.primaryKey,Se!=null&&(xe[_p(Se)]=De.primaryKey),De})},hasGetAll:0<le.length&&"getAll"in se.objectStore(le[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=Ie.schema,Re=Ie.hasGetAll,Ie=Ce.tables.map(N),de={};return Ie.forEach(function(Pe){return de[Pe.name]=Pe}),{stack:"dbcore",transaction:m.transaction.bind(m),table:function(Pe){if(!de[Pe])throw new Error("Table '".concat(Pe,"' not found"));return de[Pe]},MIN_KEY:-1/0,MAX_KEY:Ep(y),schema:Ce}}function ube(m,y,E,A){var N=E.IDBKeyRange;return E.indexedDB,{dbcore:(A=lbe(y,N,A),m.dbcore.reduce(function(W,se){return se=se.create,s(s({},W),se(W))},A))}}function Ny(m,A){var E=A.db,A=ube(m._middlewares,E,m._deps,A);m.core=A.dbcore,m.tables.forEach(function(N){var W=N.name;m.core.schema.tables.some(function(se){return se.name===W})&&(N.core=m.core.table(W),m[W]instanceof m.Table&&(m[W].core=N.core))})}function Ly(m,y,E,A){E.forEach(function(N){var W=A[N];y.forEach(function(se){var le=function Ce(Re,Ie){return v(Re,Ie)||(Re=u(Re))&&Ce(Re,Ie)}(se,N);(!le||"value"in le&&le.value===void 0)&&(se===m.Transaction.prototype||se instanceof m.Transaction?p(se,N,{get:function(){return this.table(N)},set:function(Ce){f(this,N,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):se[N]=new m.Table(N,W))})})}function M_(m,y){y.forEach(function(E){for(var A in E)E[A]instanceof m.Table&&delete E[A]})}function cbe(m,y){return m._cfg.version-y._cfg.version}function dbe(m,y,E,A){var N=m._dbSchema;E.objectStoreNames.contains("$meta")&&!N.$meta&&(N.$meta=k_("$meta",XB("")[0],[]),m._storeNames.push("$meta"));var W=m._createTransaction("readwrite",m._storeNames,N);W.create(E),W._completion.catch(A);var se=W._reject.bind(W),le=je.transless||je;Ae(function(){return je.trans=W,je.transless=le,y!==0?(Ny(m,E),Re=y,((Ce=W).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(Ie){return Ie??Re}):st.resolve(Re)).then(function(Ie){return Pe=Ie,Se=W,Te=E,xe=[],Ie=(de=m)._versions,De=de._dbSchema=By(0,de.idbdb,Te),(Ie=Ie.filter(function(Me){return Me._cfg.version>=Pe})).length!==0?(Ie.forEach(function(Me){xe.push(function(){var $e=De,He=Me._cfg.dbschema;$y(de,$e,Te),$y(de,He,Te),De=de._dbSchema=He;var Ze=N_($e,He);Ze.add.forEach(function(St){L_(Te,St[0],St[1].primKey,St[1].indexes)}),Ze.change.forEach(function(St){if(St.recreate)throw new z.Upgrade("Not yet support for changing primary key");var ht=Te.objectStore(St.name);St.add.forEach(function(Rt){return Vy(ht,Rt)}),St.change.forEach(function(Rt){ht.deleteIndex(Rt.name),Vy(ht,Rt)}),St.del.forEach(function(Rt){return ht.deleteIndex(Rt)})});var ot=Me._cfg.contentUpgrade;if(ot&&Me._cfg.version>Pe){Ny(de,Te),Se._memoizedTables={};var gt=I(He);Ze.del.forEach(function(St){gt[St]=$e[St]}),M_(de,[de.Transaction.prototype]),Ly(de,[de.Transaction.prototype],r(gt),gt),Se.schema=gt;var it,at=ne(ot);return at&&Ye(),Ze=st.follow(function(){var St;(it=ot(Se))&&at&&(St=jt.bind(null,null),it.then(St,St))}),it&&typeof it.then=="function"?st.resolve(it):Ze.then(function(){return it})}}),xe.push(function($e){var He,Ze,ot=Me._cfg.dbschema;He=ot,Ze=$e,[].slice.call(Ze.db.objectStoreNames).forEach(function(gt){return He[gt]==null&&Ze.db.deleteObjectStore(gt)}),M_(de,[de.Transaction.prototype]),Ly(de,[de.Transaction.prototype],de._storeNames,de._dbSchema),Se.schema=de._dbSchema}),xe.push(function($e){de.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(de.idbdb.version/10)===Me._cfg.version?(de.idbdb.deleteObjectStore("$meta"),delete de._dbSchema.$meta,de._storeNames=de._storeNames.filter(function(He){return He!=="$meta"})):$e.objectStore("$meta").put(Me._cfg.version,"version"))})}),function Me(){return xe.length?st.resolve(xe.shift()(Se.idbtrans)).then(Me):st.resolve()}().then(function(){ZB(De,Te)})):st.resolve();var de,Pe,Se,Te,xe,De}).catch(se)):(r(N).forEach(function(Ie){L_(E,Ie,N[Ie].primKey,N[Ie].indexes)}),Ny(m,E),void st.follow(function(){return m.on.populate.fire(W)}).catch(se));var Ce,Re})}function hbe(m,y){ZB(m._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var E=By(0,m.idbdb,y);$y(m,m._dbSchema,y);for(var A=0,N=N_(E,m._dbSchema).change;A<N.length;A++){var W=function(se){if(se.change.length||se.recreate)return console.warn("Unable to patch indexes of table ".concat(se.name," because it has changes on the type of index or primary key.")),{value:void 0};var le=y.objectStore(se.name);se.add.forEach(function(Ce){$&&console.debug("Dexie upgrade patch: Creating missing index ".concat(se.name,".").concat(Ce.src)),Vy(le,Ce)})}(N[A]);if(typeof W=="object")return W.value}}function N_(m,y){var E,A={del:[],add:[],change:[]};for(E in m)y[E]||A.del.push(E);for(E in y){var N=m[E],W=y[E];if(N){var se={name:E,def:W,recreate:!1,del:[],add:[],change:[]};if(""+(N.primKey.keyPath||"")!=""+(W.primKey.keyPath||"")||N.primKey.auto!==W.primKey.auto)se.recreate=!0,A.change.push(se);else{var le=N.idxByName,Ce=W.idxByName,Re=void 0;for(Re in le)Ce[Re]||se.del.push(Re);for(Re in Ce){var Ie=le[Re],de=Ce[Re];Ie?Ie.src!==de.src&&se.change.push(de):se.add.push(de)}(0<se.del.length||0<se.add.length||0<se.change.length)&&A.change.push(se)}}else A.add.push([E,W])}return A}function L_(m,y,E,A){var N=m.db.createObjectStore(y,E.keyPath?{keyPath:E.keyPath,autoIncrement:E.auto}:{autoIncrement:E.auto});return A.forEach(function(W){return Vy(N,W)}),N}function ZB(m,y){r(m).forEach(function(E){y.db.objectStoreNames.contains(E)||($&&console.debug("Dexie: Creating missing table",E),L_(y,E,m[E].primKey,m[E].indexes))})}function Vy(m,y){m.createIndex(y.name,y.keyPath,{unique:y.unique,multiEntry:y.multi})}function By(m,y,E){var A={};return S(y.objectStoreNames,0).forEach(function(N){for(var W=E.objectStore(N),se=A_(qB(Re=W.keyPath),Re||"",!0,!1,!!W.autoIncrement,Re&&typeof Re!="string",!0),le=[],Ce=0;Ce<W.indexNames.length;++Ce){var Ie=W.index(W.indexNames[Ce]),Re=Ie.keyPath,Ie=A_(Ie.name,Re,!!Ie.unique,!!Ie.multiEntry,!1,Re&&typeof Re!="string",!1);le.push(Ie)}A[N]=k_(N,se,le)}),A}function $y(m,y,E){for(var A=E.db.objectStoreNames,N=0;N<A.length;++N){var W=A[N],se=E.objectStore(W);m._hasGetAll="getAll"in se;for(var le=0;le<se.indexNames.length;++le){var Ce=se.indexNames[le],Re=se.index(Ce).keyPath,Ie=typeof Re=="string"?Re:"["+S(Re).join("+")+"]";!y[W]||(Re=y[W].idxByName[Ie])&&(Re.name=Ce,delete y[W].idxByName[Ie],y[W].idxByName[Ce]=Re)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(m._hasGetAll=!1)}function XB(m){return m.split(",").map(function(y,E){var A=(y=y.trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(A)?A.match(/^\[(.*)\]$/)[1].split("+"):A;return A_(A,N||null,/\&/.test(y),/\*/.test(y),/\+\+/.test(y),a(N),E===0)})}var fbe=(Hy.prototype._parseStoresSpec=function(m,y){r(m).forEach(function(E){if(m[E]!==null){var A=XB(m[E]),N=A.shift();if(N.unique=!0,N.multi)throw new z.Schema("Primary key cannot be multi-valued");A.forEach(function(W){if(W.auto)throw new z.Schema("Only primary key can be marked as autoIncrement (++)");if(!W.keyPath)throw new z.Schema("Index must have a name and cannot be an empty string")}),y[E]=k_(E,N,A)}})},Hy.prototype.stores=function(E){var y=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,E):E;var E=y._versions,A={},N={};return E.forEach(function(W){l(A,W._cfg.storesSource),N=W._cfg.dbschema={},W._parseStoresSpec(A,N)}),y._dbSchema=N,M_(y,[y._allTables,y,y.Transaction.prototype]),Ly(y,[y._allTables,y,y.Transaction.prototype,this._cfg.tables],r(N),N),y._storeNames=r(N),this},Hy.prototype.upgrade=function(m){return this._cfg.contentUpgrade=M(this._cfg.contentUpgrade||be,m),this},Hy);function Hy(){}function V_(m,y){var E=m._dbNamesDB;return E||(E=m._dbNamesDB=new Ca(Py,{addons:[],indexedDB:m,IDBKeyRange:y})).version(1).stores({dbnames:"name"}),E.table("dbnames")}function B_(m){return m&&typeof m.databases=="function"}function $_(m){return Ae(function(){return je.letThrough=!0,m()})}function H_(m){return!("from"in m)}var Ks=function(m,y){if(!this){var E=new Ks;return m&&"d"in m&&l(E,m),E}l(this,arguments.length?{d:1,from:m,to:1<arguments.length?y:m}:{d:0})};function Rp(m,y,E){var A=ln(y,E);if(!isNaN(A)){if(0<A)throw RangeError();if(H_(m))return l(m,{from:y,to:E,d:1});var N=m.l,A=m.r;if(ln(E,m.from)<0)return N?Rp(N,y,E):m.l={from:y,to:E,d:1,l:null,r:null},QB(m);if(0<ln(y,m.to))return A?Rp(A,y,E):m.r={from:y,to:E,d:1,l:null,r:null},QB(m);ln(y,m.from)<0&&(m.from=y,m.l=null,m.d=A?A.d+1:1),0<ln(E,m.to)&&(m.to=E,m.r=null,m.d=m.l?m.l.d+1:1),E=!m.r,N&&!m.l&&Dp(m,N),A&&E&&Dp(m,A)}}function Dp(m,y){H_(y)||function E(A,Ce){var W=Ce.from,se=Ce.to,le=Ce.l,Ce=Ce.r;Rp(A,W,se),le&&E(A,le),Ce&&E(A,Ce)}(m,y)}function JB(m,y){var E=Gy(y),A=E.next();if(A.done)return!1;for(var N=A.value,W=Gy(m),se=W.next(N.from),le=se.value;!A.done&&!se.done;){if(ln(le.from,N.to)<=0&&0<=ln(le.to,N.from))return!0;ln(N.from,le.from)<0?N=(A=E.next(le.from)).value:le=(se=W.next(N.from)).value}return!1}function Gy(m){var y=H_(m)?null:{s:0,n:m};return{next:function(E){for(var A=0<arguments.length;y;)switch(y.s){case 0:if(y.s=1,A)for(;y.n.l&&ln(E,y.n.from)<0;)y={up:y,n:y.n.l,s:1};else for(;y.n.l;)y={up:y,n:y.n.l,s:1};case 1:if(y.s=2,!A||ln(E,y.n.to)<=0)return{value:y.n,done:!1};case 2:if(y.n.r){y.s=3,y={up:y,n:y.n.r,s:0};continue}case 3:y=y.up}return{done:!0}}}}function QB(m){var y,E,A=(((y=m.r)===null||y===void 0?void 0:y.d)||0)-(((E=m.l)===null||E===void 0?void 0:E.d)||0),N=1<A?"r":A<-1?"l":"";N&&(y=N=="r"?"l":"r",E=s({},m),A=m[N],m.from=A.from,m.to=A.to,m[N]=A[N],E[N]=A[y],(m[y]=E).d=e$(E)),m.d=e$(m)}function e$(E){var y=E.r,E=E.l;return(y?E?Math.max(y.d,E.d):y.d:E?E.d:0)+1}function Uy(m,y){return r(y).forEach(function(E){m[E]?Dp(m[E],y[E]):m[E]=function A(N){var W,se,le={};for(W in N)d(N,W)&&(se=N[W],le[W]=!se||typeof se!="object"||D.has(se.constructor)?se:A(se));return le}(y[E])}),m}function G_(m,y){return m.all||y.all||Object.keys(m).some(function(E){return y[E]&&JB(y[E],m[E])})}h(Ks.prototype,((mi={add:function(m){return Dp(this,m),this},addKey:function(m){return Rp(this,m,m),this},addKeys:function(m){var y=this;return m.forEach(function(E){return Rp(y,E,E)}),this},hasKey:function(m){var y=Gy(this).next(m).value;return y&&ln(y.from,m)<=0&&0<=ln(y.to,m)}})[Z]=function(){return Gy(this)},mi));var Nu={},U_={},W_=!1;function Wy(m){Uy(U_,m),W_||(W_=!0,setTimeout(function(){W_=!1,z_(U_,!(U_={}))},0))}function z_(m,y){y===void 0&&(y=!1);var E=new Set;if(m.all)for(var A=0,N=Object.values(Nu);A<N.length;A++)t$(se=N[A],m,E,y);else for(var W in m){var se,le=/^idb\:\/\/(.*)\/(.*)\//.exec(W);le&&(W=le[1],le=le[2],(se=Nu["idb://".concat(W,"/").concat(le)])&&t$(se,m,E,y))}E.forEach(function(Ce){return Ce()})}function t$(m,y,E,A){for(var N=[],W=0,se=Object.entries(m.queries.query);W<se.length;W++){for(var le=se[W],Ce=le[0],Re=[],Ie=0,de=le[1];Ie<de.length;Ie++){var Pe=de[Ie];G_(y,Pe.obsSet)?Pe.subscribers.forEach(function(De){return E.add(De)}):A&&Re.push(Pe)}A&&N.push([Ce,Re])}if(A)for(var Se=0,Te=N;Se<Te.length;Se++){var xe=Te[Se],Ce=xe[0],Re=xe[1];m.queries.query[Ce]=Re}}function pbe(m){var y=m._state,E=m._deps.indexedDB;if(y.isBeingOpened||m.idbdb)return y.dbReadyPromise.then(function(){return y.dbOpenError?Kn(y.dbOpenError):m});y.isBeingOpened=!0,y.dbOpenError=null,y.openComplete=!1;var A=y.openCanceller,N=Math.round(10*m.verno),W=!1;function se(){if(y.openCanceller!==A)throw new z.DatabaseClosed("db.open() was cancelled")}function le(){return new st(function(Pe,Se){if(se(),!E)throw new z.MissingAPI;var Te=m.name,xe=y.autoSchema||!N?E.open(Te):E.open(Te,N);if(!xe)throw new z.MissingAPI;xe.onerror=Ar(Se),xe.onblocked=kn(m._fireOnBlocked),xe.onupgradeneeded=kn(function(De){var Me;Ie=xe.transaction,y.autoSchema&&!m._options.allowEmptyDB?(xe.onerror=bp,Ie.abort(),xe.result.close(),(Me=E.deleteDatabase(Te)).onsuccess=Me.onerror=kn(function(){Se(new z.NoSuchDatabase("Database ".concat(Te," doesnt exist")))})):(Ie.onerror=Ar(Se),De=De.oldVersion>Math.pow(2,62)?0:De.oldVersion,de=De<1,m.idbdb=xe.result,W&&hbe(m,Ie),dbe(m,De/10,Ie,Se))},Se),xe.onsuccess=kn(function(){Ie=null;var De,Me,$e,He,Ze,ot=m.idbdb=xe.result,gt=S(ot.objectStoreNames);if(0<gt.length)try{var it=ot.transaction((He=gt).length===1?He[0]:He,"readonly");if(y.autoSchema)Me=ot,$e=it,(De=m).verno=Me.version/10,$e=De._dbSchema=By(0,Me,$e),De._storeNames=S(Me.objectStoreNames,0),Ly(De,[De._allTables],r($e),$e);else if($y(m,m._dbSchema,it),((Ze=N_(By(0,(Ze=m).idbdb,it),Ze._dbSchema)).add.length||Ze.change.some(function(at){return at.add.length||at.change.length}))&&!W)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ot.close(),N=ot.version+1,W=!0,Pe(le());Ny(m,it)}catch{}Md.push(m),ot.onversionchange=kn(function(at){y.vcFired=!0,m.on("versionchange").fire(at)}),ot.onclose=kn(function(at){m.on("close").fire(at)}),de&&(Ze=m._deps,it=Te,ot=Ze.indexedDB,Ze=Ze.IDBKeyRange,B_(ot)||it===Py||V_(ot,Ze).put({name:it}).catch(be)),Pe()},Se)}).catch(function(Pe){switch(Pe==null?void 0:Pe.name){case"UnknownError":if(0<y.PR1398_maxLoop)return y.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),le();break;case"VersionError":if(0<N)return N=0,le()}return st.reject(Pe)})}var Ce,Re=y.dbReadyResolve,Ie=null,de=!1;return st.race([A,(typeof navigator>"u"?st.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Pe){function Se(){return indexedDB.databases().finally(Pe)}Ce=setInterval(Se,100),Se()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(le)]).then(function(){return se(),y.onReadyBeingFired=[],st.resolve($_(function(){return m.on.ready.fire(m.vip)})).then(function Pe(){if(0<y.onReadyBeingFired.length){var Se=y.onReadyBeingFired.reduce(M,be);return y.onReadyBeingFired=[],st.resolve($_(function(){return Se(m.vip)})).then(Pe)}})}).finally(function(){y.openCanceller===A&&(y.onReadyBeingFired=null,y.isBeingOpened=!1)}).catch(function(Pe){y.dbOpenError=Pe;try{Ie&&Ie.abort()}catch{}return A===y.openCanceller&&m._close(),Kn(Pe)}).finally(function(){y.openComplete=!0,Re()}).then(function(){var Pe;return de&&(Pe={},m.tables.forEach(function(Se){Se.schema.indexes.forEach(function(Te){Te.name&&(Pe["idb://".concat(m.name,"/").concat(Se.name,"/").concat(Te.name)]=new Ks(-1/0,[[[]]]))}),Pe["idb://".concat(m.name,"/").concat(Se.name,"/")]=Pe["idb://".concat(m.name,"/").concat(Se.name,"/:dels")]=new Ks(-1/0,[[[]]])}),vl(Sp).fire(Pe),z_(Pe,!0)),m})}function j_(m){function y(W){return m.next(W)}var E=N(y),A=N(function(W){return m.throw(W)});function N(W){return function(Ce){var le=W(Ce),Ce=le.value;return le.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(E,A):a(Ce)?Promise.all(Ce).then(E,A):E(Ce)}}return N(y)()}function zy(m,y,E){for(var A=a(m)?m.slice():[m],N=0;N<E;++N)A.push(y);return A}var gbe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema,N={},W=[];function se(de,Pe,Se){var Te=_p(de),xe=N[Te]=N[Te]||[],De=de==null?0:typeof de=="string"?1:de.length,Me=0<Pe,Me=s(s({},Se),{name:Me?"".concat(Te,"(virtual-from:").concat(Se.name,")"):Se.name,lowLevelIndex:Se,isVirtual:Me,keyTail:Pe,keyLength:De,extractKey:O_(de),unique:!Me&&Se.unique});return xe.push(Me),Me.isPrimaryKey||W.push(Me),1<De&&se(De===2?de[0]:de.slice(0,De-1),Pe+1,Se),xe.sort(function($e,He){return $e.keyTail-He.keyTail}),Me}y=se(A.primaryKey.keyPath,0,A.primaryKey),N[":id"]=[y];for(var le=0,Ce=A.indexes;le<Ce.length;le++){var Re=Ce[le];se(Re.keyPath,0,Re)}function Ie(de){var Pe,Se=de.query.index;return Se.isVirtual?s(s({},de),{query:{index:Se.lowLevelIndex,range:(Pe=de.query.range,Se=Se.keyTail,{type:Pe.type===1?2:Pe.type,lower:zy(Pe.lower,Pe.lowerOpen?m.MAX_KEY:m.MIN_KEY,Se),lowerOpen:!0,upper:zy(Pe.upper,Pe.upperOpen?m.MIN_KEY:m.MAX_KEY,Se),upperOpen:!0})}}):de}return s(s({},E),{schema:s(s({},A),{primaryKey:y,indexes:W,getIndexByKeyPath:function(de){return(de=N[_p(de)])&&de[0]}}),count:function(de){return E.count(Ie(de))},query:function(de){return E.query(Ie(de))},openCursor:function(de){var Pe=de.query.index,Se=Pe.keyTail,Te=Pe.isVirtual,xe=Pe.keyLength;return Te?E.openCursor(Ie(de)).then(function(Me){return Me&&De(Me)}):E.openCursor(de);function De(Me){return Object.create(Me,{continue:{value:function($e){$e!=null?Me.continue(zy($e,de.reverse?m.MAX_KEY:m.MIN_KEY,Se)):de.unique?Me.continue(Me.key.slice(0,xe).concat(de.reverse?m.MIN_KEY:m.MAX_KEY,Se)):Me.continue()}},continuePrimaryKey:{value:function($e,He){Me.continuePrimaryKey(zy($e,m.MAX_KEY,Se),He)}},primaryKey:{get:function(){return Me.primaryKey}},key:{get:function(){var $e=Me.key;return xe===1?$e[0]:$e.slice(0,xe)}},value:{get:function(){return Me.value}}})}}})}})}};function K_(m,y,E,A){return E=E||{},A=A||"",r(m).forEach(function(N){var W,se,le;d(y,N)?(W=m[N],se=y[N],typeof W=="object"&&typeof se=="object"&&W&&se?(le=B(W))!==B(se)?E[A+N]=y[N]:le==="Object"?K_(W,se,E,A+N+"."):W!==se&&(E[A+N]=y[N]):W!==se&&(E[A+N]=y[N])):E[A+N]=void 0}),r(y).forEach(function(N){d(m,N)||(E[A+N]=y[N])}),E}function q_(m,y){return y.type==="delete"?y.keys:y.keys||y.values.map(m.extractKey)}var mbe={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema.primaryKey;return s(s({},E),{mutate:function(N){var W=je.trans,se=W.table(y).hook,le=se.deleting,Ce=se.creating,Re=se.updating;switch(N.type){case"add":if(Ce.fire===be)break;return W._promise("readwrite",function(){return Ie(N)},!0);case"put":if(Ce.fire===be&&Re.fire===be)break;return W._promise("readwrite",function(){return Ie(N)},!0);case"delete":if(le.fire===be)break;return W._promise("readwrite",function(){return Ie(N)},!0);case"deleteRange":if(le.fire===be)break;return W._promise("readwrite",function(){return function de(Pe,Se,Te){return E.query({trans:Pe,values:!1,query:{index:A,range:Se},limit:Te}).then(function(xe){var De=xe.result;return Ie({type:"delete",keys:De,trans:Pe}).then(function(Me){return 0<Me.numFailures?Promise.reject(Me.failures[0]):De.length<Te?{failures:[],numFailures:0,lastResult:void 0}:de(Pe,s(s({},Se),{lower:De[De.length-1],lowerOpen:!0}),Te)})})}(N.trans,N.range,1e4)},!0)}return E.mutate(N);function Ie(de){var Pe,Se,Te,xe=je.trans,De=de.keys||q_(A,de);if(!De)throw new Error("Keys missing");return(de=de.type==="add"||de.type==="put"?s(s({},de),{keys:De}):s({},de)).type!=="delete"&&(de.values=o([],de.values)),de.keys&&(de.keys=o([],de.keys)),Pe=E,Te=De,((Se=de).type==="add"?Promise.resolve([]):Pe.getMany({trans:Se.trans,keys:Te,cache:"immutable"})).then(function(Me){var $e=De.map(function(He,Ze){var ot,gt,it,at=Me[Ze],St={onerror:null,onsuccess:null};return de.type==="delete"?le.fire.call(St,He,at,xe):de.type==="add"||at===void 0?(ot=Ce.fire.call(St,He,de.values[Ze],xe),He==null&&ot!=null&&(de.keys[Ze]=He=ot,A.outbound||T(de.values[Ze],A.keyPath,He))):(ot=K_(at,de.values[Ze]),(gt=Re.fire.call(St,ot,He,at,xe))&&(it=de.values[Ze],Object.keys(gt).forEach(function(ht){d(it,ht)?it[ht]=gt[ht]:T(it,ht,gt[ht])}))),St});return E.mutate(de).then(function(He){for(var Ze=He.failures,ot=He.results,gt=He.numFailures,He=He.lastResult,it=0;it<De.length;++it){var at=(ot||De)[it],St=$e[it];at==null?St.onerror&&St.onerror(Ze[it]):St.onsuccess&&St.onsuccess(de.type==="put"&&Me[it]?de.values[it]:at)}return{failures:Ze,results:ot,numFailures:gt,lastResult:He}}).catch(function(He){return $e.forEach(function(Ze){return Ze.onerror&&Ze.onerror(He)}),Promise.reject(He)})})}}})}})}};function n$(m,y,E){try{if(!y||y.keys.length<m.length)return null;for(var A=[],N=0,W=0;N<y.keys.length&&W<m.length;++N)ln(y.keys[N],m[W])===0&&(A.push(E?k(y.values[N]):y.values[N]),++W);return A.length===m.length?A:null}catch{return null}}var vbe={stack:"dbcore",level:-1,create:function(m){return{table:function(y){var E=m.table(y);return s(s({},E),{getMany:function(A){if(!A.cache)return E.getMany(A);var N=n$(A.keys,A.trans._cache,A.cache==="clone");return N?st.resolve(N):E.getMany(A).then(function(W){return A.trans._cache={keys:A.keys,values:A.cache==="clone"?k(W):W},W})},mutate:function(A){return A.type!=="add"&&(A.trans._cache=null),E.mutate(A)}})}}}};function s$(m,y){return m.trans.mode==="readonly"&&!!m.subscr&&!m.trans.explicit&&m.trans.db._options.cache!=="disabled"&&!y.schema.primaryKey.outbound}function o$(m,y){switch(m){case"query":return y.values&&!y.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ybe={stack:"dbcore",level:0,name:"Observability",create:function(m){var y=m.schema.name,E=new Ks(m.MIN_KEY,m.MAX_KEY);return s(s({},m),{transaction:function(A,N,W){if(je.subscr&&N!=="readonly")throw new z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(je.querier));return m.transaction(A,N,W)},table:function(A){var N=m.table(A),W=N.schema,se=W.primaryKey,de=W.indexes,le=se.extractKey,Ce=se.outbound,Re=se.autoIncrement&&de.filter(function(Se){return Se.compound&&Se.keyPath.includes(se.keyPath)}),Ie=s(s({},N),{mutate:function(Se){function Te(ht){return ht="idb://".concat(y,"/").concat(A,"/").concat(ht),He[ht]||(He[ht]=new Ks)}var xe,De,Me,$e=Se.trans,He=Se.mutatedParts||(Se.mutatedParts={}),Ze=Te(""),ot=Te(":dels"),gt=Se.type,St=Se.type==="deleteRange"?[Se.range]:Se.type==="delete"?[Se.keys]:Se.values.length<50?[q_(se,Se).filter(function(ht){return ht}),Se.values]:[],it=St[0],at=St[1],St=Se.trans._cache;return a(it)?(Ze.addKeys(it),(St=gt==="delete"||it.length===at.length?n$(it,St):null)||ot.addKeys(it),(St||at)&&(xe=Te,De=St,Me=at,W.indexes.forEach(function(ht){var Rt=xe(ht.name||"");function Zt(rn){return rn!=null?ht.extractKey(rn):null}function on(rn){return ht.multiEntry&&a(rn)?rn.forEach(function(Wo){return Rt.addKey(Wo)}):Rt.addKey(rn)}(De||Me).forEach(function(rn,qs){var Kt=De&&Zt(De[qs]),qs=Me&&Zt(Me[qs]);ln(Kt,qs)!==0&&(Kt!=null&&on(Kt),qs!=null&&on(qs))})}))):it?(at={from:(at=it.lower)!==null&&at!==void 0?at:m.MIN_KEY,to:(at=it.upper)!==null&&at!==void 0?at:m.MAX_KEY},ot.add(at),Ze.add(at)):(Ze.add(E),ot.add(E),W.indexes.forEach(function(ht){return Te(ht.name).add(E)})),N.mutate(Se).then(function(ht){return!it||Se.type!=="add"&&Se.type!=="put"||(Ze.addKeys(ht.results),Re&&Re.forEach(function(Rt){for(var Zt=Se.values.map(function(Kt){return Rt.extractKey(Kt)}),on=Rt.keyPath.findIndex(function(Kt){return Kt===se.keyPath}),rn=0,Wo=ht.results.length;rn<Wo;++rn)Zt[rn][on]=ht.results[rn];Te(Rt.name).addKeys(Zt)})),$e.mutatedParts=Uy($e.mutatedParts||{},He),ht})}}),de=function(Te){var xe=Te.query,Te=xe.index,xe=xe.range;return[Te,new Ks((Te=xe.lower)!==null&&Te!==void 0?Te:m.MIN_KEY,(xe=xe.upper)!==null&&xe!==void 0?xe:m.MAX_KEY)]},Pe={get:function(Se){return[se,new Ks(Se.key)]},getMany:function(Se){return[se,new Ks().addKeys(Se.keys)]},count:de,query:de,openCursor:de};return r(Pe).forEach(function(Se){Ie[Se]=function(Te){var xe=je.subscr,De=!!xe,Me=s$(je,N)&&o$(Se,Te)?Te.obsSet={}:xe;if(De){var $e=function(at){return at="idb://".concat(y,"/").concat(A,"/").concat(at),Me[at]||(Me[at]=new Ks)},He=$e(""),Ze=$e(":dels"),xe=Pe[Se](Te),De=xe[0],xe=xe[1];if((Se==="query"&&De.isPrimaryKey&&!Te.values?Ze:$e(De.name||"")).add(xe),!De.isPrimaryKey){if(Se!=="count"){var ot=Se==="query"&&Ce&&Te.values&&N.query(s(s({},Te),{values:!1}));return N[Se].apply(this,arguments).then(function(at){if(Se==="query"){if(Ce&&Te.values)return ot.then(function(Zt){return Zt=Zt.result,He.addKeys(Zt),at});var St=Te.values?at.result.map(le):at.result;(Te.values?He:Ze).addKeys(St)}else if(Se==="openCursor"){var ht=at,Rt=Te.values;return ht&&Object.create(ht,{key:{get:function(){return Ze.addKey(ht.primaryKey),ht.key}},primaryKey:{get:function(){var Zt=ht.primaryKey;return Ze.addKey(Zt),Zt}},value:{get:function(){return Rt&&He.addKey(ht.primaryKey),ht.value}}})}return at})}Ze.add(E)}}return N[Se].apply(this,arguments)}}),Ie}})}};function i$(m,y,E){if(E.numFailures===0)return y;if(y.type==="deleteRange")return null;var A=y.keys?y.keys.length:"values"in y&&y.values?y.values.length:1;return E.numFailures===A?null:(y=s({},y),a(y.keys)&&(y.keys=y.keys.filter(function(N,W){return!(W in E.failures)})),"values"in y&&a(y.values)&&(y.values=y.values.filter(function(N,W){return!(W in E.failures)})),y)}function Y_(m,y){return E=m,((A=y).lower===void 0||(A.lowerOpen?0<ln(E,A.lower):0<=ln(E,A.lower)))&&(m=m,(y=y).upper===void 0||(y.upperOpen?ln(m,y.upper)<0:ln(m,y.upper)<=0));var E,A}function r$(m,y,Pe,A,N,W){if(!Pe||Pe.length===0)return m;var se=y.query.index,le=se.multiEntry,Ce=y.query.range,Re=A.schema.primaryKey.extractKey,Ie=se.extractKey,de=(se.lowLevelIndex||se).extractKey,Pe=Pe.reduce(function(Se,Te){var xe=Se,De=[];if(Te.type==="add"||Te.type==="put")for(var Me=new Ks,$e=Te.values.length-1;0<=$e;--$e){var He,Ze=Te.values[$e],ot=Re(Ze);Me.hasKey(ot)||(He=Ie(Ze),(le&&a(He)?He.some(function(ht){return Y_(ht,Ce)}):Y_(He,Ce))&&(Me.addKey(ot),De.push(Ze)))}switch(Te.type){case"add":var gt=new Ks().addKeys(y.values?Se.map(function(Rt){return Re(Rt)}):Se),xe=Se.concat(y.values?De.filter(function(Rt){return Rt=Re(Rt),!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}):De.map(function(Rt){return Re(Rt)}).filter(function(Rt){return!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}));break;case"put":var it=new Ks().addKeys(Te.values.map(function(Rt){return Re(Rt)}));xe=Se.filter(function(Rt){return!it.hasKey(y.values?Re(Rt):Rt)}).concat(y.values?De:De.map(function(Rt){return Re(Rt)}));break;case"delete":var at=new Ks().addKeys(Te.keys);xe=Se.filter(function(Rt){return!at.hasKey(y.values?Re(Rt):Rt)});break;case"deleteRange":var St=Te.range;xe=Se.filter(function(Rt){return!Y_(Re(Rt),St)})}return xe},m);return Pe===m?m:(Pe.sort(function(Se,Te){return ln(de(Se),de(Te))||ln(Re(Se),Re(Te))}),y.limit&&y.limit<1/0&&(Pe.length>y.limit?Pe.length=y.limit:m.length===y.limit&&Pe.length<y.limit&&(N.dirty=!0)),W?Object.freeze(Pe):Pe)}function a$(m,y){return ln(m.lower,y.lower)===0&&ln(m.upper,y.upper)===0&&!!m.lowerOpen==!!y.lowerOpen&&!!m.upperOpen==!!y.upperOpen}function wbe(m,y){return function(E,A,N,W){if(E===void 0)return A!==void 0?-1:0;if(A===void 0)return 1;if((A=ln(E,A))===0){if(N&&W)return 0;if(N)return 1;if(W)return-1}return A}(m.lower,y.lower,m.lowerOpen,y.lowerOpen)<=0&&0<=function(E,A,N,W){if(E===void 0)return A!==void 0?1:0;if(A===void 0)return-1;if((A=ln(E,A))===0){if(N&&W)return 0;if(N)return-1;if(W)return 1}return A}(m.upper,y.upper,m.upperOpen,y.upperOpen)}function Cbe(m,y,E,A){m.subscribers.add(E),A.addEventListener("abort",function(){var N,W;m.subscribers.delete(E),m.subscribers.size===0&&(N=m,W=y,setTimeout(function(){N.subscribers.size===0&&ee(W,N)},3e3))})}var bbe={stack:"dbcore",level:0,name:"Cache",create:function(m){var y=m.schema.name;return s(s({},m),{transaction:function(E,A,N){var W,se,le=m.transaction(E,A,N);return A==="readwrite"&&(se=(W=new AbortController).signal,N=function(Ce){return function(){if(W.abort(),A==="readwrite"){for(var Re=new Set,Ie=0,de=E;Ie<de.length;Ie++){var Pe=de[Ie],Se=Nu["idb://".concat(y,"/").concat(Pe)];if(Se){var Te=m.table(Pe),xe=Se.optimisticOps.filter(function(Rt){return Rt.trans===le});if(le._explicit&&Ce&&le.mutatedParts)for(var De=0,Me=Object.values(Se.queries.query);De<Me.length;De++)for(var $e=0,He=(gt=Me[De]).slice();$e<He.length;$e++)G_((it=He[$e]).obsSet,le.mutatedParts)&&(ee(gt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)}));else if(0<xe.length){Se.optimisticOps=Se.optimisticOps.filter(function(Rt){return Rt.trans!==le});for(var Ze=0,ot=Object.values(Se.queries.query);Ze<ot.length;Ze++)for(var gt,it,at,St=0,ht=(gt=ot[Ze]).slice();St<ht.length;St++)(it=ht[St]).res!=null&&le.mutatedParts&&(Ce&&!it.dirty?(at=Object.isFrozen(it.res),at=r$(it.res,it.req,xe,Te,it,at),it.dirty?(ee(gt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})):at!==it.res&&(it.res=at,it.promise=st.resolve({result:at}))):(it.dirty&&ee(gt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})))}}}Re.forEach(function(Rt){return Rt()})}}},le.addEventListener("abort",N(!1),{signal:se}),le.addEventListener("error",N(!1),{signal:se}),le.addEventListener("complete",N(!0),{signal:se})),le},table:function(E){var A=m.table(E),N=A.schema.primaryKey;return s(s({},A),{mutate:function(W){var se=je.trans;if(N.outbound||se.db._options.cache==="disabled"||se.explicit||se.idbtrans.mode!=="readwrite")return A.mutate(W);var le=Nu["idb://".concat(y,"/").concat(E)];return le?(se=A.mutate(W),W.type!=="add"&&W.type!=="put"||!(50<=W.values.length||q_(N,W).some(function(Ce){return Ce==null}))?(le.optimisticOps.push(W),W.mutatedParts&&Wy(W.mutatedParts),se.then(function(Ce){0<Ce.numFailures&&(ee(le.optimisticOps,W),(Ce=i$(0,W,Ce))&&le.optimisticOps.push(Ce),W.mutatedParts&&Wy(W.mutatedParts))}),se.catch(function(){ee(le.optimisticOps,W),W.mutatedParts&&Wy(W.mutatedParts)})):se.then(function(Ce){var Re=i$(0,s(s({},W),{values:W.values.map(function(Ie,de){var Pe;return Ce.failures[de]?Ie:(Ie=(Pe=N.keyPath)!==null&&Pe!==void 0&&Pe.includes(".")?k(Ie):s({},Ie),T(Ie,N.keyPath,Ce.results[de]),Ie)})}),Ce);le.optimisticOps.push(Re),queueMicrotask(function(){return W.mutatedParts&&Wy(W.mutatedParts)})}),se):A.mutate(W)},query:function(W){if(!s$(je,A)||!o$("query",W))return A.query(W);var se=((Re=je.trans)===null||Re===void 0?void 0:Re.db._options.cache)==="immutable",de=je,le=de.requery,Ce=de.signal,Re=function(Te,xe,De,Me){var $e=Nu["idb://".concat(Te,"/").concat(xe)];if(!$e)return[];if(!(xe=$e.queries[De]))return[null,!1,$e,null];var He=xe[(Me.query?Me.query.index.name:null)||""];if(!He)return[null,!1,$e,null];switch(De){case"query":var Ze=He.find(function(ot){return ot.req.limit===Me.limit&&ot.req.values===Me.values&&a$(ot.req.query.range,Me.query.range)});return Ze?[Ze,!0,$e,He]:[He.find(function(ot){return("limit"in ot.req?ot.req.limit:1/0)>=Me.limit&&(!Me.values||ot.req.values)&&wbe(ot.req.query.range,Me.query.range)}),!1,$e,He];case"count":return Ze=He.find(function(ot){return a$(ot.req.query.range,Me.query.range)}),[Ze,!!Ze,$e,He]}}(y,E,"query",W),Ie=Re[0],de=Re[1],Pe=Re[2],Se=Re[3];return Ie&&de?Ie.obsSet=W.obsSet:(de=A.query(W).then(function(Te){var xe=Te.result;if(Ie&&(Ie.res=xe),se){for(var De=0,Me=xe.length;De<Me;++De)Object.freeze(xe[De]);Object.freeze(xe)}else Te.result=k(xe);return Te}).catch(function(Te){return Se&&Ie&&ee(Se,Ie),Promise.reject(Te)}),Ie={obsSet:W.obsSet,promise:de,subscribers:new Set,type:"query",req:W,dirty:!1},Se?Se.push(Ie):(Se=[Ie],(Pe=Pe||(Nu["idb://".concat(y,"/").concat(E)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[W.query.index.name||""]=Se)),Cbe(Ie,Se,le,Ce),Ie.promise.then(function(Te){return{result:r$(Te.result,W,Pe==null?void 0:Pe.optimisticOps,A,Ie,se)}})}})}})}};function jy(m,y){return new Proxy(m,{get:function(E,A,N){return A==="db"?y:Reflect.get(E,A,N)}})}var Ca=(as.prototype.version=function(m){if(isNaN(m)||m<.1)throw new z.Type("Given version is not a positive number");if(m=Math.round(10*m)/10,this.idbdb||this._state.isBeingOpened)throw new z.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,m);var y=this._versions,E=y.filter(function(A){return A._cfg.version===m})[0];return E||(E=new this.Version(m),y.push(E),y.sort(cbe),E.stores({}),this._state.autoSchema=!1,E)},as.prototype._whenReady=function(m){var y=this;return this.idbdb&&(this._state.openComplete||je.letThrough||this._vip)?m():new st(function(E,A){if(y._state.openComplete)return A(new z.DatabaseClosed(y._state.dbOpenError));if(!y._state.isBeingOpened){if(!y._state.autoOpen)return void A(new z.DatabaseClosed);y.open().catch(be)}y._state.dbReadyPromise.then(E,A)}).then(m)},as.prototype.use=function(m){var y=m.stack,E=m.create,A=m.level,N=m.name;return N&&this.unuse({stack:y,name:N}),m=this._middlewares[y]||(this._middlewares[y]=[]),m.push({stack:y,create:E,level:A??10,name:N}),m.sort(function(W,se){return W.level-se.level}),this},as.prototype.unuse=function(m){var y=m.stack,E=m.name,A=m.create;return y&&this._middlewares[y]&&(this._middlewares[y]=this._middlewares[y].filter(function(N){return A?N.create!==A:!!E&&N.name!==E})),this},as.prototype.open=function(){var m=this;return bo(Ne,function(){return pbe(m)})},as.prototype._close=function(){var m=this._state,y=Md.indexOf(this);if(0<=y&&Md.splice(y,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}m.isBeingOpened||(m.dbReadyPromise=new st(function(E){m.dbReadyResolve=E}),m.openCanceller=new st(function(E,A){m.cancelOpen=A}))},as.prototype.close=function(E){var y=(E===void 0?{disableAutoOpen:!0}:E).disableAutoOpen,E=this._state;y?(E.isBeingOpened&&E.cancelOpen(new z.DatabaseClosed),this._close(),E.autoOpen=!1,E.dbOpenError=new z.DatabaseClosed):(this._close(),E.autoOpen=this._options.autoOpen||E.isBeingOpened,E.openComplete=!1,E.dbOpenError=null)},as.prototype.delete=function(m){var y=this;m===void 0&&(m={disableAutoOpen:!0});var E=0<arguments.length&&typeof arguments[0]!="object",A=this._state;return new st(function(N,W){function se(){y.close(m);var le=y._deps.indexedDB.deleteDatabase(y.name);le.onsuccess=kn(function(){var Ce,Re,Ie;Ce=y._deps,Re=y.name,Ie=Ce.indexedDB,Ce=Ce.IDBKeyRange,B_(Ie)||Re===Py||V_(Ie,Ce).delete(Re).catch(be),N()}),le.onerror=Ar(W),le.onblocked=y._fireOnBlocked}if(E)throw new z.InvalidArgument("Invalid closeOptions argument to db.delete()");A.isBeingOpened?A.dbReadyPromise.then(se):se()})},as.prototype.backendDB=function(){return this.idbdb},as.prototype.isOpen=function(){return this.idbdb!==null},as.prototype.hasBeenClosed=function(){var m=this._state.dbOpenError;return m&&m.name==="DatabaseClosed"},as.prototype.hasFailed=function(){return this._state.dbOpenError!==null},as.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(as.prototype,"tables",{get:function(){var m=this;return r(this._allTables).map(function(y){return m._allTables[y]})},enumerable:!1,configurable:!0}),as.prototype.transaction=function(){var m=(function(y,E,A){var N=arguments.length;if(N<2)throw new z.InvalidArgument("Too few arguments");for(var W=new Array(N-1);--N;)W[N-1]=arguments[N];return A=W.pop(),[y,P(W),A]}).apply(this,arguments);return this._transaction.apply(this,m)},as.prototype._transaction=function(m,y,E){var A=this,N=je.trans;N&&N.db===this&&m.indexOf("!")===-1||(N=null);var W,se,le=m.indexOf("?")!==-1;m=m.replace("!","").replace("?","");try{if(se=y.map(function(Re){if(Re=Re instanceof A.Table?Re.name:Re,typeof Re!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Re}),m=="r"||m===D_)W=D_;else{if(m!="rw"&&m!=T_)throw new z.InvalidArgument("Invalid transaction mode: "+m);W=T_}if(N){if(N.mode===D_&&W===T_){if(!le)throw new z.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");N=null}N&&se.forEach(function(Re){if(N&&N.storeNames.indexOf(Re)===-1){if(!le)throw new z.SubTransaction("Table "+Re+" not included in parent transaction.");N=null}}),le&&N&&!N.active&&(N=null)}}catch(Re){return N?N._promise(null,function(Ie,de){de(Re)}):Kn(Re)}var Ce=(function Re(Ie,de,Pe,Se,Te){return st.resolve().then(function(){var xe=je.transless||je,De=Ie._createTransaction(de,Pe,Ie._dbSchema,Se);if(De.explicit=!0,xe={trans:De,transless:xe},Se)De.idbtrans=Se.idbtrans;else try{De.create(),De.idbtrans._explicit=!0,Ie._state.PR1398_maxLoop=3}catch(He){return He.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,de,Pe,null,Te)})):Kn(He)}var Me,$e=ne(Te);return $e&&Ye(),xe=st.follow(function(){var He;(Me=Te.call(De,De))&&($e?(He=jt.bind(null,null),Me.then(He,He)):typeof Me.next=="function"&&typeof Me.throw=="function"&&(Me=j_(Me)))},xe),(Me&&typeof Me.then=="function"?st.resolve(Me).then(function(He){return De.active?He:Kn(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Me})).then(function(He){return Se&&De._resolve(),De._completion.then(function(){return He})}).catch(function(He){return De._reject(He),Kn(He)})})}).bind(null,this,W,se,N,E);return N?N._promise(W,Ce,"lock"):je.trans?bo(je.transless,function(){return A._whenReady(Ce)}):this._whenReady(Ce)},as.prototype.table=function(m){if(!d(this._allTables,m))throw new z.InvalidTable("Table ".concat(m," does not exist"));return this._allTables[m]},as);function as(m,y){var E=this;this._middlewares={},this.verno=0;var A=as.dependencies;this._options=y=s({addons:as.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned"},y),this._deps={indexedDB:y.indexedDB,IDBKeyRange:y.IDBKeyRange},A=y.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var N,W,se,le,Ce,Re={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:be,dbReadyPromise:null,cancelOpen:be,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:y.autoOpen};Re.dbReadyPromise=new st(function(de){Re.dbReadyResolve=de}),Re.openCanceller=new st(function(de,Pe){Re.cancelOpen=Pe}),this._state=Re,this.name=m,this.on=yp(this,"populate","blocked","versionchange","close",{ready:[M,be]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(de){return function(Pe,Se){as.vip(function(){var Te,xe=E._state;xe.openComplete?(xe.dbOpenError||st.resolve().then(Pe),Se&&de(Pe)):xe.onReadyBeingFired?(xe.onReadyBeingFired.push(Pe),Se&&de(Pe)):(de(Pe),Te=E,Se||de(function De(){Te.on.ready.unsubscribe(Pe),Te.on.ready.unsubscribe(De)}))})}}),this.Collection=(N=this,wp(sbe.prototype,function(Me,De){this.db=N;var Se=VB,Te=null;if(De)try{Se=De()}catch($e){Te=$e}var xe=Me._ctx,De=xe.table,Me=De.hook.reading.fire;this._ctx={table:De,index:xe.index,isPrimKey:!xe.index||De.schema.primKey.keyPath&&xe.index===De.schema.primKey.name,range:Se,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Te,or:xe.or,valueMapper:Me!==G?Me:null}})),this.Table=(W=this,wp(GB.prototype,function(de,Pe,Se){this.db=W,this._tx=Se,this.name=de,this.schema=Pe,this.hook=W._allTables[de]?W._allTables[de].hook:yp(null,{creating:[ke,be],reading:[q,G],updating:[Le,be],deleting:[Fe,be]})})),this.Transaction=(se=this,wp(rbe.prototype,function(de,Pe,Se,Te,xe){var De=this;this.db=se,this.mode=de,this.storeNames=Pe,this.schema=Se,this.chromeTransactionDurability=Te,this.idbtrans=null,this.on=yp(this,"complete","error","abort"),this.parent=xe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new st(function(Me,$e){De._resolve=Me,De._reject=$e}),this._completion.then(function(){De.active=!1,De.on.complete.fire()},function(Me){var $e=De.active;return De.active=!1,De.on.error.fire(Me),De.parent?De.parent._reject(Me):$e&&De.idbtrans&&De.idbtrans.abort(),Kn(Me)})})),this.Version=(le=this,wp(fbe.prototype,function(de){this.db=le,this._cfg={version:de,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,wp(KB.prototype,function(de,Pe,Se){if(this.db=Ce,this._ctx={table:de,index:Pe===":id"?null:Pe,or:Se},this._cmp=this._ascending=ln,this._descending=function(Te,xe){return ln(xe,Te)},this._max=function(Te,xe){return 0<ln(Te,xe)?Te:xe},this._min=function(Te,xe){return ln(Te,xe)<0?Te:xe},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new z.MissingAPI})),this.on("versionchange",function(de){0<de.newVersion?console.warn("Another connection wants to upgrade database '".concat(E.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(E.name,"'. Closing db now to resume the delete request.")),E.close({disableAutoOpen:!1})}),this.on("blocked",function(de){!de.newVersion||de.newVersion<de.oldVersion?console.warn("Dexie.delete('".concat(E.name,"') was blocked")):console.warn("Upgrade '".concat(E.name,"' blocked by other connection holding version ").concat(de.oldVersion/10))}),this._maxKey=Ep(y.IDBKeyRange),this._createTransaction=function(de,Pe,Se,Te){return new E.Transaction(de,Pe,Se,E._options.chromeTransactionDurability,Te)},this._fireOnBlocked=function(de){E.on("blocked").fire(de),Md.filter(function(Pe){return Pe.name===E.name&&Pe!==E&&!Pe._state.vcFired}).map(function(Pe){return Pe.on("versionchange").fire(de)})},this.use(vbe),this.use(bbe),this.use(ybe),this.use(gbe),this.use(mbe);var Ie=new Proxy(this,{get:function(de,Pe,Se){if(Pe==="_vip")return!0;if(Pe==="table")return function(xe){return jy(E.table(xe),Ie)};var Te=Reflect.get(de,Pe,Se);return Te instanceof GB?jy(Te,Ie):Pe==="tables"?Te.map(function(xe){return jy(xe,Ie)}):Pe==="_createTransaction"?function(){return jy(Te.apply(this,arguments),Ie)}:Te}});this.vip=Ie,A.forEach(function(de){return de(E)})}var Ky,mi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Sbe=(Z_.prototype.subscribe=function(m,y,E){return this._subscribe(m&&typeof m!="function"?m:{next:m,error:y,complete:E})},Z_.prototype[mi]=function(){return this},Z_);function Z_(m){this._subscribe=m}try{Ky={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Ky={indexedDB:null,IDBKeyRange:null}}function l$(m){var y,E=!1,A=new Sbe(function(N){var W=ne(m),se,le=!1,Ce={},Re={},Ie={get closed(){return le},unsubscribe:function(){le||(le=!0,se&&se.abort(),de&&vl.storagemutated.unsubscribe(Se))}};N.start&&N.start(Ie);var de=!1,Pe=function(){return Fy(Te)},Se=function(xe){Uy(Ce,xe),G_(Re,Ce)&&Pe()},Te=function(){var xe,De,Me;!le&&Ky.indexedDB&&(Ce={},xe={},se&&se.abort(),se=new AbortController,Me=function($e){var He=xr();try{W&&Ye();var Ze=Ae(m,$e);return Ze=W?Ze.finally(jt):Ze}finally{He&&pi()}}(De={subscr:xe,signal:se.signal,requery:Pe,querier:m,trans:null}),Promise.resolve(Me).then(function($e){E=!0,y=$e,le||De.signal.aborted||(Ce={},function(He){for(var Ze in He)if(d(He,Ze))return;return 1}(Re=xe)||de||(vl(Sp,Se),de=!0),Fy(function(){return!le&&N.next&&N.next($e)}))},function($e){E=!1,["DatabaseClosedError","AbortError"].includes($e==null?void 0:$e.name)||le||Fy(function(){le||N.error&&N.error($e)})}))};return setTimeout(Pe,0),Ie});return A.hasValue=function(){return E},A.getValue=function(){return y},A}var Lu=Ca;function X_(m){var y=yl;try{yl=!0,vl.storagemutated.fire(m),z_(m,!0)}finally{yl=y}}h(Lu,s(s({},ie),{delete:function(m){return new Lu(m,{addons:[]}).delete()},exists:function(m){return new Lu(m,{addons:[]}).open().then(function(y){return y.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(m){try{return y=Lu.dependencies,E=y.indexedDB,y=y.IDBKeyRange,(B_(E)?Promise.resolve(E.databases()).then(function(A){return A.map(function(N){return N.name}).filter(function(N){return N!==Py})}):V_(E,y).toCollection().primaryKeys()).then(m)}catch{return Kn(new z.MissingAPI)}var y,E},defineClass:function(){return function(m){l(this,m)}},ignoreTransaction:function(m){return je.trans?bo(je.transless,m):m()},vip:$_,async:function(m){return function(){try{var y=j_(m.apply(this,arguments));return y&&typeof y.then=="function"?y:st.resolve(y)}catch(E){return Kn(E)}}},spawn:function(m,y,E){try{var A=j_(m.apply(E,y||[]));return A&&typeof A.then=="function"?A:st.resolve(A)}catch(N){return Kn(N)}},currentTransaction:{get:function(){return je.trans||null}},waitFor:function(m,y){return y=st.resolve(typeof m=="function"?Lu.ignoreTransaction(m):m).timeout(y||6e4),je.trans?je.trans.waitFor(y):y},Promise:st,debug:{get:function(){return $},set:function(m){ae(m)}},derive:g,extend:l,props:h,override:b,Events:yp,on:vl,liveQuery:l$,extendObservabilitySet:Uy,getByKeyPath:R,setByKeyPath:T,delByKeyPath:function(m,y){typeof y=="string"?T(m,y,void 0):"length"in y&&[].map.call(y,function(E){T(m,E,void 0)})},shallowClone:I,deepClone:k,getObjectDiff:K_,cmp:ln,asap:_,minKey:-1/0,addons:[],connections:Md,errnames:re,dependencies:Ky,cache:Nu,semVer:"4.0.10",version:"4.0.10".split(".").map(function(m){return parseInt(m)}).reduce(function(m,y,E){return m+y/Math.pow(10,2*E)})})),Lu.maxKey=Ep(Lu.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(vl(Sp,function(m){yl||(m=new CustomEvent(P_,{detail:m}),yl=!0,dispatchEvent(m),yl=!1)}),addEventListener(P_,function(m){m=m.detail,yl||X_(m)}));var Vd,yl=!1,u$=function(){};return typeof BroadcastChannel<"u"&&((u$=function(){(Vd=new BroadcastChannel(P_)).onmessage=function(m){return m.data&&X_(m.data)}})(),typeof Vd.unref=="function"&&Vd.unref(),vl(Sp,function(m){yl||Vd.postMessage(m)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(m){if(!Ca.disableBfCache&&m.persisted){$&&console.debug("Dexie: handling persisted pagehide"),Vd!=null&&Vd.close();for(var y=0,E=Md;y<E.length;y++)E[y].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(m){!Ca.disableBfCache&&m.persisted&&($&&console.debug("Dexie: handling persisted pageshow"),u$(),X_({all:new Ks(-1/0,[[]])}))})),st.rejectionMapper=function(m,y){return!m||m instanceof H||m instanceof TypeError||m instanceof SyntaxError||!m.name||!pe[m.name]?m:(y=new pe[m.name](y||m.message,m),"stack"in m&&p(y,"stack",{get:function(){return this.inner.stack}}),y)},ae($),s(Ca,Object.freeze({__proto__:null,Dexie:Ca,liveQuery:l$,Entity:BB,cmp:ln,PropModSymbol:wa,PropModification:Cp,replacePrefix:function(m,y){return new Cp({replacePrefix:[m,y]})},add:function(m){return new Cp({add:m})},remove:function(m){return new Cp({remove:m})},default:Ca,RangeSet:Ks,mergeRanges:Dp,rangesOverlap:JB}),{default:Ca}),Ca})})(B1);var $z=B1.exports;const bC=Bz($z),$1=Symbol.for("Dexie"),Rh=globalThis[$1]||(globalThis[$1]=bC);if(bC.semVer!==Rh.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${bC.semVer} and ${Rh.semVer}`);const{liveQuery:Lbe,mergeRanges:Vbe,rangesOverlap:Bbe,RangeSet:$be,cmp:Hbe,Entity:Gbe,PropModSymbol:Ube,PropModification:Wbe,replacePrefix:zbe,add:jbe,remove:Kbe}=Rh;class H1 extends Rh{constructor(n){super(n);es(this,"icons");es(this,"visuals");es(this,"users");es(this,"columns");es(this,"general");this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(n){return this[n]?this[n]:this.general}}const Ag=new Map,Hz=async e=>{if(!Ag.has(e)){const t=new H1(e);try{await t.open(),Ag.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await Rh.delete(e);const s=new H1(e);await s.open(),Ag.set(e,s)}catch(s){throw console.error("Failed to delete and recreate database:",s),s}}}return Ag.get(e)},Dh=({dbName:e,storeName:t})=>{const n=async()=>(await Hz(e)).getTable(t);return{getCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}const d=await c.get(u);return d==null?void 0:d.value}catch(c){console.error("Failed to get cached value:",c);return}},setCachedValue:async(u,c)=>{try{const d=await n();if(!d){console.error(`Store is undefined, cannot cache key: ${u}`);return}await d.put({key:u,value:c,timestamp:Date.now()})}catch(d){console.error("Failed to cache value:",d)}},deleteCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined, cannot delete key: ${u}`);return}await c.delete(u)}catch(c){console.error("Failed to delete cached value:",c)}},clearCache:async()=>{try{const u=await n();if(!u){console.error("Store is undefined, cannot clear cache");return}await u.clear()}catch(u){console.error("Failed to clear cache:",u)}},getAllKeys:async()=>{try{const u=await n();return u?(await u.toArray()).map(d=>d.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(u){return console.error("Failed to get all keys:",u),[]}},getCachedValueWithTimestamp:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}return await c.get(u)}catch(c){console.error("Failed to get cached value with timestamp:",c);return}}}},Gz="AvatarCache",Uz="images",Bl={},kg={},Wz=()=>{const{getCachedValue:e,setCachedValue:t}=Dh({dbName:Gz,storeName:Uz}),n=a=>new Promise((l,u)=>{const c=new FileReader;c.onloadend=()=>l(c.result),c.onerror=u,c.readAsDataURL(a)}),s=async a=>{try{if(Bl[a])return Bl[a];if(kg[a])return await kg[a];const l=(async()=>{try{const u=await e(a);if(!u||!(u instanceof Blob))return null;const c=await n(u);return Bl[a]=c,c}catch(u){return console.warn(`Failed to get cached image for key: ${a}`,u),null}})();return kg[a]=l,l.finally(()=>{delete kg[a]}),await l}catch(l){return console.error(`Error in getCachedImage for key: ${a}`,l),null}},o=a=>new Promise((l,u)=>{new Vz(a,{width:96,height:96,quality:1,success(c){l(c)},error(c){console.error("Image compression failed:",c.message),u(c)}})});return{getCachedImage:s,setCachedImage:async(a,l)=>{try{const u=await o(l);await t(a,u);const c=await n(u);Bl[a]=c}catch(u){throw console.error(`Failed to cache image for key: ${a}`,u),u}},clearMemoryCache:a=>{try{a?delete Bl[a]:Object.keys(Bl).forEach(l=>delete Bl[l])}catch(l){console.error("Error clearing memory cache:",l)}}}},Th=new Map,sr=new Map,ic=new Map,zz=5*60*1e3,G1=100;function jz(){const e=Date.now(),t=[];ic.forEach((n,s)=>{e-n>zz&&t.push(s)}),t.forEach(n=>{Th.delete(n),ic.delete(n),sr.delete(n)})}function Kz(){if(ic.size<=G1)return;const e=Array.from(ic.entries()).sort((n,s)=>n[1]-s[1]);e.slice(0,e.length-G1).forEach(([n])=>{Th.delete(n),ic.delete(n),sr.delete(n)})}const qz=(e,t)=>{const n=sr.get(e);return n==null||n.forEach(s=>s(t)),sr.delete(e),t};async function Yz({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:s}){let o=e;if(t)try{const d=new URL(t,"http://localhost").pathname.split("/").pop();d?o=`${e}_${d}`:o=t}catch{o=t||e}const i=await n.getCachedImage(o),r=Th.has(o),a=sr.has(o);if(i)return qz(o,i);if(jz(),r)return new Promise(c=>{a||sr.set(o,[]),sr.get(o).push(c)});const l=(async()=>{let c=null,d=null;try{const h=Math.random()*300;await new Promise(p=>setTimeout(p,h)),s==null||s(!0);const f=await fetch(t,{cache:"no-cache"});if(!f.ok)throw new Error("Failed to fetch image");return c=await f.blob(),await n.setCachedImage(o,c),d=URL.createObjectURL(c),d}catch(h){throw console.error("Error loading avatar image:",h),h}finally{c=null,s==null||s(!1),ic.set(o,Date.now()),setTimeout(()=>{Th.delete(o),Kz()},100)}})();Th.set(o,l);const u=await l;return sr.has(o)&&(sr.get(o).forEach(d=>d(u)),sr.delete(o)),u}const Zz=(e,t=3,n=1e3)=>{const s=V(0),o=V(!1),i=V(!1),r=async()=>{try{await e()}catch(a){if(s.value<t)return s.value++,i.value=!0,await new Promise(l=>setTimeout(l,n)),r();throw o.value=!0,a}};return{retry:r,currentAttempt:s,errorRetry:o,isRetrying:i}};function xs(e,t){Xz(e)&&(e="100%");const n=Jz(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Og(e){return Math.min(1,Math.max(0,e))}function Xz(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Jz(e){return typeof e=="string"&&e.indexOf("%")!==-1}function U1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mg(e){return Number(e)<=1?`${Number(e)*100}%`:e}function $l(e){return e.length===1?"0"+e:String(e)}function Qz(e,t,n){return{r:xs(e,255)*255,g:xs(t,255)*255,b:xs(n,255)*255}}function W1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0,r=0;const a=(s+o)/2;if(s===o)r=0,i=0;else{const l=s-o;switch(r=a>.5?l/(2-s-o):l/(s+o),s){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:r,l:a}}function SC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function e3(e,t,n){let s,o,i;if(e=xs(e,360),t=xs(t,100),n=xs(n,100),t===0)o=n,i=n,s=n;else{const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=SC(a,r,e+1/3),o=SC(a,r,e),i=SC(a,r,e-1/3)}return{r:s*255,g:o*255,b:i*255}}function z1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0;const r=s,a=s-o,l=s===0?0:a/s;if(s===o)i=0;else{switch(s){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break}i/=6}return{h:i,s:l,v:r}}function t3(e,t,n){e=xs(e,360)*6,t=xs(t,100),n=xs(n,100);const s=Math.floor(e),o=e-s,i=n*(1-t),r=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6,u=[n,r,i,i,a,n][l],c=[a,n,n,r,i,i][l],d=[i,i,a,n,n,r][l];return{r:u*255,g:c*255,b:d*255}}function j1(e,t,n,s){const o=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function n3(e,t,n,s,o){const i=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16)),$l(o3(s))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function s3(e,t,n,s){const o=e/100,i=t/100,r=n/100,a=s/100,l=255*(1-o)*(1-a),u=255*(1-i)*(1-a),c=255*(1-r)*(1-a);return{r:l,g:u,b:c}}function K1(e,t,n){let s=1-e/255,o=1-t/255,i=1-n/255,r=Math.min(s,o,i);return r===1?(s=0,o=0,i=0):(s=(s-r)/(1-r)*100,o=(o-r)/(1-r)*100,i=(i-r)/(1-r)*100),r*=100,{c:Math.round(s),m:Math.round(o),y:Math.round(i),k:Math.round(r)}}function o3(e){return Math.round(parseFloat(e)*255).toString(16)}function q1(e){return Po(e)/255}function Po(e){return parseInt(e,16)}function i3(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const EC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function r3(e){let t={r:0,g:0,b:0},n=1,s=null,o=null,i=null,r=!1,a=!1;return typeof e=="string"&&(e=a3(e)),typeof e=="object"&&(Ao(e.r)&&Ao(e.g)&&Ao(e.b)?(t=Qz(e.r,e.g,e.b),r=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ao(e.h)&&Ao(e.s)&&Ao(e.v)?(s=Mg(e.s),o=Mg(e.v),t=t3(e.h,s,o),r=!0,a="hsv"):Ao(e.h)&&Ao(e.s)&&Ao(e.l)?(s=Mg(e.s),i=Mg(e.l),t=e3(e.h,s,i),r=!0,a="hsl"):Ao(e.c)&&Ao(e.m)&&Ao(e.y)&&Ao(e.k)&&(t=s3(e.c,e.m,e.y,e.k),r=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=U1(n),{ok:r,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const ka="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",_C="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Ng="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Zo={CSS_UNIT:new RegExp(ka),rgb:new RegExp("rgb"+_C),rgba:new RegExp("rgba"+Ng),hsl:new RegExp("hsl"+_C),hsla:new RegExp("hsla"+Ng),hsv:new RegExp("hsv"+_C),hsva:new RegExp("hsva"+Ng),cmyk:new RegExp("cmyk"+Ng),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function a3(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(EC[e])e=EC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=Zo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Zo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Zo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Zo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Zo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Zo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Zo.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Zo.hex8.exec(e),n?{r:Po(n[1]),g:Po(n[2]),b:Po(n[3]),a:q1(n[4]),format:t?"name":"hex8"}:(n=Zo.hex6.exec(e),n?{r:Po(n[1]),g:Po(n[2]),b:Po(n[3]),format:t?"name":"hex"}:(n=Zo.hex4.exec(e),n?{r:Po(n[1]+n[1]),g:Po(n[2]+n[2]),b:Po(n[3]+n[3]),a:q1(n[4]+n[4]),format:t?"name":"hex8"}:(n=Zo.hex3.exec(e),n?{r:Po(n[1]+n[1]),g:Po(n[2]+n[2]),b:Po(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function Ao(e){return typeof e=="number"?!Number.isNaN(e):Zo.CSS_UNIT.test(e)}class Nn{constructor(t="",n={}){if(t instanceof Nn)return t;typeof t=="number"&&(t=i3(t)),this.originalInput=t;const s=r3(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,s,o;const i=t.r/255,r=t.g/255,a=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*s+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=U1(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=z1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=z1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${s}%, ${o}%)`:`hsva(${n}, ${s}%, ${o}%, ${this.roundA})`}toHsl(){const t=W1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=W1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${s}%, ${o}%)`:`hsla(${n}, ${s}%, ${o}%, ${this.roundA})`}toHex(t=!1){return j1(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return n3(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),s=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${s})`:`rgba(${t}, ${n}, ${s}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(xs(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(xs(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...K1(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:s,k:o}=K1(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${s}, ${o})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+j1(this.r,this.g,this.b,!1);for(const[n,s]of Object.entries(EC))if(t===s)return n;return!1}toString(t){const n=!!t;t=t??this.format;let s=!1;const o=this.a<1&&this.a>=0;return!n&&o&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),t==="cmyk"&&(s=this.toCmykString()),s||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Nn(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Og(n.l),new Nn(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Nn(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Og(n.l),new Nn(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Og(n.s),new Nn(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Og(n.s),new Nn(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,new Nn(n)}mix(t,n=50){const s=this.toRgb(),o=new Nn(t).toRgb(),i=n/100,r={r:(o.r-s.r)*i+s.r,g:(o.g-s.g)*i+s.g,b:(o.b-s.b)*i+s.b,a:(o.a-s.a)*i+s.a};return new Nn(r)}analogous(t=6,n=30){const s=this.toHsl(),o=360/n,i=[this];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,i.push(new Nn(s));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Nn(t)}monochromatic(t=6){const n=this.toHsv(),{h:s}=n,{s:o}=n;let{v:i}=n;const r=[],a=1/t;for(;t--;)r.push(new Nn({h:s,s:o,v:i})),i=(i+a)%1;return r}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Nn({h:(n+72)%360,s:t.s,l:t.l}),new Nn({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),s=new Nn(t).toRgb(),o=n.a+s.a*(1-n.a);return new Nn({r:(n.r*n.a+s.r*s.a*(1-n.a))/o,g:(n.g*n.a+s.g*s.a*(1-n.a))/o,b:(n.b*n.a+s.b*s.a*(1-n.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:s}=n,o=[this],i=360/t;for(let r=1;r<t;r++)o.push(new Nn({h:(s+r*i)%360,s:n.s,l:n.l}));return o}equals(t){const n=new Nn(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function Y1(e){return new Nn(e||"").isValid}function Lg(e,t){const{c1:n,c2:s}={c1:new Nn(e),c2:new Nn(t)};return n.equals(s)}const l3=["src","alt"],Ih=_t(rt({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=V(""),s=V(!1),o=V(null),i=V(!1),r=Y(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),a=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.bgColor)||"#CCCCCC";return Y1(w)?w:"#CCCCCC"}),l=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.textColor)||"var(--background-color)";return Y1(w)?w:"var(--background-color)"}),u=Y(()=>{if(!t.isUseShortLabel)return"";const{initial:w,name:_}=r.value;if(typeof w=="string"&&w.trim())return w.trim();if(!(_!=null&&_.trim()))return"";const R=_.trim().split(/\s+/).filter(Boolean);return R.length===1?R[0].slice(0,2).toUpperCase():(R[0][0]+R[1][0]).toUpperCase()}),c=Y(()=>r.value.profile_image?"image":"text"),d=Y(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":a.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":l.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),h=()=>{n.value="",i.value=!0},{getCachedImage:f,setCachedImage:p}=Wz(),g=async()=>{if(o.value&&o.value.abort(),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),!r.value.id||!r.value.profile_image){n.value="";return}o.value=new AbortController;const w=o.value;try{const _=await Yz({userId:r.value.id,avatarUrl:r.value.profile_image,cacheInterface:{getCachedImage:f,setCachedImage:p},onLoadingChange:R=>{w.signal.aborted||(s.value=R)}});if(!w.signal.aborted&&(n.value=_,_.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),h(),new Error("Empty image source")}catch(_){w.signal.aborted||(console.error("Failed to load avatar:",_),n.value="")}},{retry:v,errorRetry:C,isRetrying:S}=Zz(g,3,2e3),b=tt(()=>[r.value.id,r.value.profile_image],v,{immediate:!0});return vs(()=>{b(),o.value&&(o.value.abort(),o.value=null),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),n.value="",s.value=!1}),(w,_)=>(j(),ue("div",{class:Q([w.$style["avatar-wrapper"],{[w.$style.me]:e.isMe,[w.$style.loading]:s.value,[w.$style.disabled]:e.disabled,[w.$style.readOnly]:t.readOnly}]),style:dn(d.value)},[s.value||U(S)?(j(),ue("div",{key:0,class:Q(w.$style["skeleton-loader"])},null,2)):(j(),ue(xt,{key:1},[c.value==="text"||U(C)||i.value?(j(),ue("div",{key:0,class:Q(w.$style["short-label"])},wt(u.value),3)):n.value.length>0||r.value.profile_image?(j(),ue("img",{key:1,src:n.value||r.value.profile_image||"",alt:r.value.name||"Avatar",loading:"lazy"},null,8,l3)):Je("",!0)],64))],6))}}),[["__cssModules",{$style:{"avatar-wrapper":"_avatar-wrapper_1pd1f_1",me:"_me_1pd1f_17","short-label":"_short-label_1pd1f_20",action:"_action_1pd1f_38",loading:"_loading_1pd1f_56",disabled:"_disabled_1pd1f_59",readOnly:"_readOnly_1pd1f_62"}}]]),u3=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],c3=["UploadInProgress"],Pu=class Pu{constructor(){es(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"});Object.values(this.KEY_PAIR).every(n=>{const s=sessionStorage.getItem(n);return(s==null||s==="")&&console.error(`[SessionStorageHelper] Key "${n}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return Pu.instance||(Pu.instance=new Pu),Pu.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(s){console.error("Error setting sessionStorage item:",s)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};es(Pu,"instance");let En=Pu;const Vg={},Oa={},Z1=(e,t,n,s,o="base64")=>{const i=V(""),r=V(""),a=V(!0),l=Y(()=>`${t}:${e.value.name}`),u=g=>new Promise((v,C)=>{const S=new FileReader;S.onload=()=>v(S.result),S.onerror=C,S.readAsDataURL(g)}),c=g=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,d=async(g,v)=>{if(Oa[v])return Oa[v];if(v in Vg){const b=await Vg[v];return b&&(Oa[v]=b),b}const C=await s(l.value);if(C&&typeof C=="string")return Oa[v]=C,C;const S=(async()=>{try{const b=await fetch(g,{cache:"no-cache"});if(!b.ok)throw new Error("Failed to fetch visual");const w=b.headers.get("Content-Type")||"";let _;if(w.includes("svg")||w.includes("xml")){const R=await b.text();if(!R.trim())throw new Error("Empty SVG content");_=o==="svg"?R:c(R),Oa[v]=_}else if(w.match(/image\/(jpeg|jpg|png|gif|webp)/)){const R=await b.blob();if(!R.size)throw new Error("Empty image blob");_=await u(R),Oa[v]=_}else throw new Error(`Unsupported content type: ${w}`);return await n(l.value,_),_}catch(b){return console.error("Error fetching visual:",b),""}})();return Vg[v]=S,S.finally(()=>{delete Vg[v]}),await S},h=async g=>{a.value=!0;try{if(Oa[l.value]){const _=Oa[l.value];i.value=_,_.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(_.split(",")[1]):(_.startsWith("<svg")||_.includes("<svg"))&&(r.value=_),a.value=!1;return}const v=En.getInstance().getItem("ASSET_URL")||"",C={icon:`${v}/icon/tess/TESSRAPP_Icon_${g}`,visual:`${v}/icon/visual/TESSRAPP_Visual_${g}`,ratting:`${v}/icon/tess/rating/TESSRAPP_Icon_${g}_Outline`,flag:`${v}/icon/flags/4x3/${g}`},S=u3.includes(g)?"png":c3.includes(g)?"gif":"svg",b=`${C[t]}.${S}`,w=await d(b,l.value);w&&(i.value=w,w.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(w.split(",")[1]):(w.startsWith("<svg")||w.includes("<svg"))&&(r.value=w))}catch(v){console.error("Error fetching remote visual:",v)}finally{a.value=!1}},f=async()=>{i.value="",r.value="",e.value.name&&(a.value=!0,await h(e.value.name),a.value=!1)},p=Y(()=>r.value?r.value:"");return tt(()=>e,()=>{f()},{deep:!0,immediate:!0}),{svgContent:p,url:i,loading:a}},d3=["innerHTML","about"],h3="IconCache",f3="icons",lt=_t(rt({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){jG(h=>({v1555daee:h.size+"px"}));const t=e,n=h=>{if(typeof h=="number")return h;switch(h){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof h=="string"?Number.parseInt(h,10):14}},s=Y(()=>n(t.size)),o=Y(()=>({width:s.value+"px",height:s.value+"px",color:t.color})),{getCachedValue:i,setCachedValue:r}=Dh({dbName:h3,storeName:f3}),a=async h=>{const f=await i(h);if(typeof f=="string")return f},l=async(h,f)=>{await r(h,f)},u=Y(()=>t.source==="rating"?"ratting":"icon"),c=Y(()=>({name:t.src,size:s.value,color:t.color||"currentColor"})),{svgContent:d}=Z1(c,u.value,l,a,"svg");return(h,f)=>(j(),ue("div",{class:Q(h.$style.iconWrapper),innerHTML:U(d),style:dn(o.value),about:t.src,"data-icon":"true"},null,14,d3))}}),[["__cssModules",{$style:{iconWrapper:"_iconWrapper_1n0y9_1"}}]]),p3={review:"{reviewDomain}/{ws_code}",review_take:"{reviewDomain}/{ws_code}?id={take_id}",review_scene:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",review_rendition:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",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}",review_rendition_comment:"{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}",review_comment:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",review_multiple_scenes:"{reviewDomain}/{ws_code}?scene_ids={scene_ids}",scene_hub:"{baseDomain}/{ws_code}/{scene_id}?o=st",hub_rendition:"{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",hub_comment:"{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",people_insight:"{baseDomain}/{ws_code}/{user_id}?o=pt",people_detail:"{baseDomain}/{ws_code}/ws/ppl/{display_name}-${user_id}",project:"{baseDomain}/{ws_code}/pl/dir/{entity_id}",woohoo:"{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",update:"{baseDomain}/{ws_code}/pl/au?id={entity_id}",core:"{baseDomain}/{ws_code}",project_focusMode:"{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",access_setting:"{baseDomain}/{ws_code}/pl/dir?f={entity_id}&o=as"},co=({type:e,config:t})=>{const n=[];try{const s=p3[e];if(!s)throw new Error(`Link template for link type "${e}" not found`);const o=s.replace(/{(.*?)}/g,(i,r)=>{const a=t[String(r)];if(a!==void 0)return a;n.push(r)});return n.length>0?{url:o,hasError:!0,error:`Missing required keys: ${n.join(", ")}`,missingKeys:n}:{url:o,hasError:!1,error:void 0}}catch(s){return console.error("Link Creator ERROR at:",s),{url:"",hasError:!0,error:s instanceof Error?s.message:`Missing required keys: ${n.join(", ")}`}}};var X1=typeof global=="object"&&global&&global.Object===Object&&global,g3=typeof self=="object"&&self&&self.Object===Object&&self,Ri=X1||g3||Function("return this")(),Xo=Ri.Symbol,J1=Object.prototype,m3=J1.hasOwnProperty,v3=J1.toString,xh=Xo?Xo.toStringTag:void 0;function y3(e){var t=m3.call(e,xh),n=e[xh];try{e[xh]=void 0;var s=!0}catch{}var o=v3.call(e);return s&&(t?e[xh]=n:delete e[xh]),o}var w3=Object.prototype,C3=w3.toString;function b3(e){return C3.call(e)}var S3="[object Null]",E3="[object Undefined]",Q1=Xo?Xo.toStringTag:void 0;function rc(e){return e==null?e===void 0?E3:S3:Q1&&Q1 in Object(e)?y3(e):b3(e)}function jr(e){return e!=null&&typeof e=="object"}var _3="[object Symbol]";function Bg(e){return typeof e=="symbol"||jr(e)&&rc(e)==_3}function R3(e,t){for(var n=-1,s=e==null?0:e.length,o=Array(s);++n<s;)o[n]=t(e[n],n,e);return o}var Jo=Array.isArray,eI=Xo?Xo.prototype:void 0,tI=eI?eI.toString:void 0;function nI(e){if(typeof e=="string")return e;if(Jo(e))return R3(e,nI)+"";if(Bg(e))return tI?tI.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var D3=/\s/;function T3(e){for(var t=e.length;t--&&D3.test(e.charAt(t)););return t}var I3=/^\s+/;function x3(e){return e&&e.slice(0,T3(e)+1).replace(I3,"")}function Ma(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sI=NaN,F3=/^[-+]0x[0-9a-f]+$/i,P3=/^0b[01]+$/i,A3=/^0o[0-7]+$/i,k3=parseInt;function RC(e){if(typeof e=="number")return e;if(Bg(e))return sI;if(Ma(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ma(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=x3(e);var n=P3.test(e);return n||A3.test(e)?k3(e.slice(2),n?2:8):F3.test(e)?sI:+e}var oI=1/0,O3=17976931348623157e292;function M3(e){if(!e)return e===0?e:0;if(e=RC(e),e===oI||e===-oI){var t=e<0?-1:1;return t*O3}return e===e?e:0}function N3(e){var t=M3(e),n=t%1;return t===t?n?t-n:t:0}function DC(e){return e}var L3="[object AsyncFunction]",V3="[object Function]",B3="[object GeneratorFunction]",$3="[object Proxy]";function iI(e){if(!Ma(e))return!1;var t=rc(e);return t==V3||t==B3||t==L3||t==$3}var TC=Ri["__core-js_shared__"],rI=function(){var e=/[^.]+$/.exec(TC&&TC.keys&&TC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function H3(e){return!!rI&&rI in e}var G3=Function.prototype,U3=G3.toString;function Hl(e){if(e!=null){try{return U3.call(e)}catch{}try{return e+""}catch{}}return""}var W3=/[\\^$.*+?()[\]{}|]/g,z3=/^\[object .+?Constructor\]$/,j3=Function.prototype,K3=Object.prototype,q3=j3.toString,Y3=K3.hasOwnProperty,Z3=RegExp("^"+q3.call(Y3).replace(W3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X3(e){if(!Ma(e)||H3(e))return!1;var t=iI(e)?Z3:z3;return t.test(Hl(e))}function J3(e,t){return e==null?void 0:e[t]}function Gl(e,t){var n=J3(e,t);return X3(n)?n:void 0}var IC=Gl(Ri,"WeakMap"),aI=Object.create,Q3=function(){function e(){}return function(t){if(!Ma(t))return{};if(aI)return aI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function e6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function t6(){}var n6=800,s6=16,o6=Date.now;function i6(e){var t=0,n=0;return function(){var s=o6(),o=s6-(s-n);if(n=s,o>0){if(++t>=n6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function r6(e){return function(){return e}}var $g=function(){try{var e=Gl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),a6=$g?function(e,t){return $g(e,"toString",{configurable:!0,enumerable:!1,value:r6(t),writable:!0})}:DC,l6=i6(a6);function u6(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}function c6(e,t,n,s){for(var o=e.length,i=n+-1;++i<o;)if(t(e[i],i,e))return i;return-1}function d6(e){return e!==e}function h6(e,t,n){for(var s=n-1,o=e.length;++s<o;)if(e[s]===t)return s;return-1}function f6(e,t,n){return t===t?h6(e,t,n):c6(e,d6,n)}function p6(e,t){var n=e==null?0:e.length;return!!n&&f6(e,t,0)>-1}var g6=9007199254740991,m6=/^(?:0|[1-9]\d*)$/;function lI(e,t){var n=typeof e;return t=t??g6,!!t&&(n=="number"||n!="symbol"&&m6.test(e))&&e>-1&&e%1==0&&e<t}function v6(e,t,n){t=="__proto__"&&$g?$g(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xC(e,t){return e===t||e!==e&&t!==t}var y6=Object.prototype,w6=y6.hasOwnProperty;function C6(e,t,n){var s=e[t];(!(w6.call(e,t)&&xC(s,n))||n===void 0&&!(t in e))&&v6(e,t,n)}var uI=Math.max;function b6(e,t,n){return t=uI(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,i=uI(s.length-t,0),r=Array(i);++o<i;)r[o]=s[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=s[o];return a[t]=n(r),e6(e,this,a)}}function S6(e,t){return l6(b6(e,t,DC),e+"")}var E6=9007199254740991;function FC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=E6}function PC(e){return e!=null&&FC(e.length)&&!iI(e)}var _6=Object.prototype;function AC(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_6;return e===n}function R6(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var D6="[object Arguments]";function cI(e){return jr(e)&&rc(e)==D6}var dI=Object.prototype,T6=dI.hasOwnProperty,I6=dI.propertyIsEnumerable,Hg=cI(function(){return arguments}())?cI:function(e){return jr(e)&&T6.call(e,"callee")&&!I6.call(e,"callee")};function x6(){return!1}var hI=typeof On=="object"&&On&&!On.nodeType&&On,fI=hI&&typeof module=="object"&&module&&!module.nodeType&&module,F6=fI&&fI.exports===hI,pI=F6?Ri.Buffer:void 0,P6=pI?pI.isBuffer:void 0,Fh=P6||x6,A6="[object Arguments]",k6="[object Array]",O6="[object Boolean]",M6="[object Date]",N6="[object Error]",L6="[object Function]",V6="[object Map]",B6="[object Number]",$6="[object Object]",H6="[object RegExp]",G6="[object Set]",U6="[object String]",W6="[object WeakMap]",z6="[object ArrayBuffer]",j6="[object DataView]",K6="[object Float32Array]",q6="[object Float64Array]",Y6="[object Int8Array]",Z6="[object Int16Array]",X6="[object Int32Array]",J6="[object Uint8Array]",Q6="[object Uint8ClampedArray]",e4="[object Uint16Array]",t4="[object Uint32Array]",Ln={};Ln[K6]=Ln[q6]=Ln[Y6]=Ln[Z6]=Ln[X6]=Ln[J6]=Ln[Q6]=Ln[e4]=Ln[t4]=!0,Ln[A6]=Ln[k6]=Ln[z6]=Ln[O6]=Ln[j6]=Ln[M6]=Ln[N6]=Ln[L6]=Ln[V6]=Ln[B6]=Ln[$6]=Ln[H6]=Ln[G6]=Ln[U6]=Ln[W6]=!1;function n4(e){return jr(e)&&FC(e.length)&&!!Ln[rc(e)]}function kC(e){return function(t){return e(t)}}var gI=typeof On=="object"&&On&&!On.nodeType&&On,Ph=gI&&typeof module=="object"&&module&&!module.nodeType&&module,s4=Ph&&Ph.exports===gI,OC=s4&&X1.process,ac=function(){try{var e=Ph&&Ph.require&&Ph.require("util").types;return e||OC&&OC.binding&&OC.binding("util")}catch{}}(),mI=ac&&ac.isTypedArray,MC=mI?kC(mI):n4,o4=Object.prototype,i4=o4.hasOwnProperty;function r4(e,t){var n=Jo(e),s=!n&&Hg(e),o=!n&&!s&&Fh(e),i=!n&&!s&&!o&&MC(e),r=n||s||o||i,a=r?R6(e.length,String):[],l=a.length;for(var u in e)i4.call(e,u)&&!(r&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lI(u,l)))&&a.push(u);return a}function vI(e,t){return function(n){return e(t(n))}}var a4=vI(Object.keys,Object),l4=Object.prototype,u4=l4.hasOwnProperty;function yI(e){if(!AC(e))return a4(e);var t=[];for(var n in Object(e))u4.call(e,n)&&n!="constructor"&&t.push(n);return t}function wI(e){return PC(e)?r4(e):yI(e)}var c4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d4=/^\w*$/;function NC(e,t){if(Jo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bg(e)?!0:d4.test(e)||!c4.test(e)||t!=null&&e in Object(t)}var Ah=Gl(Object,"create");function h4(){this.__data__=Ah?Ah(null):{},this.size=0}function f4(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p4="__lodash_hash_undefined__",g4=Object.prototype,m4=g4.hasOwnProperty;function v4(e){var t=this.__data__;if(Ah){var n=t[e];return n===p4?void 0:n}return m4.call(t,e)?t[e]:void 0}var y4=Object.prototype,w4=y4.hasOwnProperty;function C4(e){var t=this.__data__;return Ah?t[e]!==void 0:w4.call(t,e)}var b4="__lodash_hash_undefined__";function S4(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ah&&t===void 0?b4:t,this}function Ul(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ul.prototype.clear=h4,Ul.prototype.delete=f4,Ul.prototype.get=v4,Ul.prototype.has=C4,Ul.prototype.set=S4;function E4(){this.__data__=[],this.size=0}function Gg(e,t){for(var n=e.length;n--;)if(xC(e[n][0],t))return n;return-1}var _4=Array.prototype,R4=_4.splice;function D4(e){var t=this.__data__,n=Gg(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():R4.call(t,n,1),--this.size,!0}function T4(e){var t=this.__data__,n=Gg(t,e);return n<0?void 0:t[n][1]}function I4(e){return Gg(this.__data__,e)>-1}function x4(e,t){var n=this.__data__,s=Gg(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function Kr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Kr.prototype.clear=E4,Kr.prototype.delete=D4,Kr.prototype.get=T4,Kr.prototype.has=I4,Kr.prototype.set=x4;var kh=Gl(Ri,"Map");function F4(){this.size=0,this.__data__={hash:new Ul,map:new(kh||Kr),string:new Ul}}function P4(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ug(e,t){var n=e.__data__;return P4(t)?n[typeof t=="string"?"string":"hash"]:n.map}function A4(e){var t=Ug(this,e).delete(e);return this.size-=t?1:0,t}function k4(e){return Ug(this,e).get(e)}function O4(e){return Ug(this,e).has(e)}function M4(e,t){var n=Ug(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function qr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}qr.prototype.clear=F4,qr.prototype.delete=A4,qr.prototype.get=k4,qr.prototype.has=O4,qr.prototype.set=M4;var N4="Expected a function";function LC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(N4);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],i=n.cache;if(i.has(o))return i.get(o);var r=e.apply(this,s);return n.cache=i.set(o,r)||i,r};return n.cache=new(LC.Cache||qr),n}LC.Cache=qr;var L4=500;function V4(e){var t=LC(e,function(s){return n.size===L4&&n.clear(),s}),n=t.cache;return t}var B4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$4=/\\(\\)?/g,H4=V4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(B4,function(n,s,o,i){t.push(o?i.replace($4,"$1"):s||n)}),t});function G4(e){return e==null?"":nI(e)}function CI(e,t){return Jo(e)?e:NC(e,t)?[e]:H4(G4(e))}function Wg(e){if(typeof e=="string"||Bg(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bI(e,t){t=CI(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[Wg(t[n++])];return n&&n==s?e:void 0}function U4(e,t,n){var s=e==null?void 0:bI(e,t);return s===void 0?n:s}function SI(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var EI=Xo?Xo.isConcatSpreadable:void 0;function W4(e){return Jo(e)||Hg(e)||!!(EI&&e&&e[EI])}function z4(e,t,n,s,o){var i=-1,r=e.length;for(n||(n=W4),o||(o=[]);++i<r;){var a=e[i];n(a)&&SI(o,a)}return o}var j4=vI(Object.getPrototypeOf,Object);function K4(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++s<o;)i[s]=e[s+t];return i}var q4=Math.ceil,Y4=Math.max;function Z4(e,t,n){t===void 0?t=1:t=Y4(N3(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,i=0,r=Array(q4(s/t));o<s;)r[i++]=K4(e,o,o+=t);return r}function X4(){this.__data__=new Kr,this.size=0}function J4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Q4(e){return this.__data__.get(e)}function e5(e){return this.__data__.has(e)}var t5=200;function n5(e,t){var n=this.__data__;if(n instanceof Kr){var s=n.__data__;if(!kh||s.length<t5-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new qr(s)}return n.set(e,t),this.size=n.size,this}function or(e){var t=this.__data__=new Kr(e);this.size=t.size}or.prototype.clear=X4,or.prototype.delete=J4,or.prototype.get=Q4,or.prototype.has=e5,or.prototype.set=n5;var _I=typeof On=="object"&&On&&!On.nodeType&&On,RI=_I&&typeof module=="object"&&module&&!module.nodeType&&module,s5=RI&&RI.exports===_I,DI=s5?Ri.Buffer:void 0;DI&&DI.allocUnsafe;function o5(e,t){return e.slice()}function i5(e,t){for(var n=-1,s=e==null?0:e.length,o=0,i=[];++n<s;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function r5(){return[]}var a5=Object.prototype,l5=a5.propertyIsEnumerable,TI=Object.getOwnPropertySymbols,u5=TI?function(e){return e==null?[]:(e=Object(e),i5(TI(e),function(t){return l5.call(e,t)}))}:r5;function c5(e,t,n){var s=t(e);return Jo(e)?s:SI(s,n(e))}function VC(e){return c5(e,wI,u5)}var BC=Gl(Ri,"DataView"),$C=Gl(Ri,"Promise"),lc=Gl(Ri,"Set"),II="[object Map]",d5="[object Object]",xI="[object Promise]",FI="[object Set]",PI="[object WeakMap]",AI="[object DataView]",h5=Hl(BC),f5=Hl(kh),p5=Hl($C),g5=Hl(lc),m5=Hl(IC),Qo=rc;(BC&&Qo(new BC(new ArrayBuffer(1)))!=AI||kh&&Qo(new kh)!=II||$C&&Qo($C.resolve())!=xI||lc&&Qo(new lc)!=FI||IC&&Qo(new IC)!=PI)&&(Qo=function(e){var t=rc(e),n=t==d5?e.constructor:void 0,s=n?Hl(n):"";if(s)switch(s){case h5:return AI;case f5:return II;case p5:return xI;case g5:return FI;case m5:return PI}return t});var v5=Object.prototype,y5=v5.hasOwnProperty;function w5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&y5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var zg=Ri.Uint8Array;function HC(e){var t=new e.constructor(e.byteLength);return new zg(t).set(new zg(e)),t}function C5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var b5=/\w*$/;function S5(e){var t=new e.constructor(e.source,b5.exec(e));return t.lastIndex=e.lastIndex,t}var kI=Xo?Xo.prototype:void 0,OI=kI?kI.valueOf:void 0;function E5(e){return OI?Object(OI.call(e)):{}}function _5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var R5="[object Boolean]",D5="[object Date]",T5="[object Map]",I5="[object Number]",x5="[object RegExp]",F5="[object Set]",P5="[object String]",A5="[object Symbol]",k5="[object ArrayBuffer]",O5="[object DataView]",M5="[object Float32Array]",N5="[object Float64Array]",L5="[object Int8Array]",V5="[object Int16Array]",B5="[object Int32Array]",$5="[object Uint8Array]",H5="[object Uint8ClampedArray]",G5="[object Uint16Array]",U5="[object Uint32Array]";function W5(e,t,n){var s=e.constructor;switch(t){case k5:return HC(e);case R5:case D5:return new s(+e);case O5:return C5(e);case M5:case N5:case L5:case V5:case B5:case $5:case H5:case G5:case U5:return _5(e);case T5:return new s;case I5:case P5:return new s(e);case x5:return S5(e);case F5:return new s;case A5:return E5(e)}}function z5(e){return typeof e.constructor=="function"&&!AC(e)?Q3(j4(e)):{}}var j5="[object Map]";function K5(e){return jr(e)&&Qo(e)==j5}var MI=ac&&ac.isMap,q5=MI?kC(MI):K5,Y5="[object Set]";function Z5(e){return jr(e)&&Qo(e)==Y5}var NI=ac&&ac.isSet,X5=NI?kC(NI):Z5,LI="[object Arguments]",J5="[object Array]",Q5="[object Boolean]",e8="[object Date]",t8="[object Error]",VI="[object Function]",n8="[object GeneratorFunction]",s8="[object Map]",o8="[object Number]",BI="[object Object]",i8="[object RegExp]",r8="[object Set]",a8="[object String]",l8="[object Symbol]",u8="[object WeakMap]",c8="[object ArrayBuffer]",d8="[object DataView]",h8="[object Float32Array]",f8="[object Float64Array]",p8="[object Int8Array]",g8="[object Int16Array]",m8="[object Int32Array]",v8="[object Uint8Array]",y8="[object Uint8ClampedArray]",w8="[object Uint16Array]",C8="[object Uint32Array]",Fn={};Fn[LI]=Fn[J5]=Fn[c8]=Fn[d8]=Fn[Q5]=Fn[e8]=Fn[h8]=Fn[f8]=Fn[p8]=Fn[g8]=Fn[m8]=Fn[s8]=Fn[o8]=Fn[BI]=Fn[i8]=Fn[r8]=Fn[a8]=Fn[l8]=Fn[v8]=Fn[y8]=Fn[w8]=Fn[C8]=!0,Fn[t8]=Fn[VI]=Fn[u8]=!1;function jg(e,t,n,s,o,i){var r;if(r!==void 0)return r;if(!Ma(e))return e;var a=Jo(e);if(a)r=w5(e);else{var l=Qo(e),u=l==VI||l==n8;if(Fh(e))return o5(e);if(l==BI||l==LI||u&&!o)r=u?{}:z5(e);else{if(!Fn[l])return o?e:{};r=W5(e,l)}}i||(i=new or);var c=i.get(e);if(c)return c;i.set(e,r),X5(e)?e.forEach(function(f){r.add(jg(f,t,n,f,e,i))}):q5(e)&&e.forEach(function(f,p){r.set(p,jg(f,t,n,p,e,i))});var d=VC,h=a?void 0:d(e);return u6(h||e,function(f,p){h&&(p=f,f=e[p]),C6(r,p,jg(f,t,n,p,e,i))}),r}var b8=1,S8=4;function $I(e){return jg(e,b8|S8)}var E8="__lodash_hash_undefined__";function _8(e){return this.__data__.set(e,E8),this}function R8(e){return this.__data__.has(e)}function Oh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new qr;++t<n;)this.add(e[t])}Oh.prototype.add=Oh.prototype.push=_8,Oh.prototype.has=R8;function D8(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function HI(e,t){return e.has(t)}var T8=1,I8=2;function GI(e,t,n,s,o,i){var r=n&T8,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=n&I8?new Oh:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var p=e[d],g=t[d];if(s)var v=r?s(g,p,d,t,e,i):s(p,g,d,e,t,i);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!D8(t,function(C,S){if(!HI(f,S)&&(p===C||o(p,C,n,s,i)))return f.push(S)})){h=!1;break}}else if(!(p===g||o(p,g,n,s,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function x8(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function GC(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var F8=1,P8=2,A8="[object Boolean]",k8="[object Date]",O8="[object Error]",M8="[object Map]",N8="[object Number]",L8="[object RegExp]",V8="[object Set]",B8="[object String]",$8="[object Symbol]",H8="[object ArrayBuffer]",G8="[object DataView]",UI=Xo?Xo.prototype:void 0,UC=UI?UI.valueOf:void 0;function U8(e,t,n,s,o,i,r){switch(n){case G8:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case H8:return!(e.byteLength!=t.byteLength||!i(new zg(e),new zg(t)));case A8:case k8:case N8:return xC(+e,+t);case O8:return e.name==t.name&&e.message==t.message;case L8:case B8:return e==t+"";case M8:var a=x8;case V8:var l=s&F8;if(a||(a=GC),e.size!=t.size&&!l)return!1;var u=r.get(e);if(u)return u==t;s|=P8,r.set(e,t);var c=GI(a(e),a(t),s,o,i,r);return r.delete(e),c;case $8:if(UC)return UC.call(e)==UC.call(t)}return!1}var W8=1,z8=Object.prototype,j8=z8.hasOwnProperty;function K8(e,t,n,s,o,i){var r=n&W8,a=VC(e),l=a.length,u=VC(t),c=u.length;if(l!=c&&!r)return!1;for(var d=l;d--;){var h=a[d];if(!(r?h in t:j8.call(t,h)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=r;++d<l;){h=a[d];var C=e[h],S=t[h];if(s)var b=r?s(S,C,h,t,e,i):s(C,S,h,e,t,i);if(!(b===void 0?C===S||o(C,S,n,s,i):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return i.delete(e),i.delete(t),g}var q8=1,WI="[object Arguments]",zI="[object Array]",Kg="[object Object]",Y8=Object.prototype,jI=Y8.hasOwnProperty;function Z8(e,t,n,s,o,i){var r=Jo(e),a=Jo(t),l=r?zI:Qo(e),u=a?zI:Qo(t);l=l==WI?Kg:l,u=u==WI?Kg:u;var c=l==Kg,d=u==Kg,h=l==u;if(h&&Fh(e)){if(!Fh(t))return!1;r=!0,c=!1}if(h&&!c)return i||(i=new or),r||MC(e)?GI(e,t,n,s,o,i):U8(e,t,l,n,s,o,i);if(!(n&q8)){var f=c&&jI.call(e,"__wrapped__"),p=d&&jI.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return i||(i=new or),o(g,v,n,s,i)}}return h?(i||(i=new or),K8(e,t,n,s,o,i)):!1}function WC(e,t,n,s,o){return e===t?!0:e==null||t==null||!jr(e)&&!jr(t)?e!==e&&t!==t:Z8(e,t,n,s,WC,o)}var X8=1,J8=2;function Q8(e,t,n,s){var o=n.length,i=o;if(e==null)return!i;for(e=Object(e);o--;){var r=n[o];if(r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){r=n[o];var a=r[0],l=e[a],u=r[1];if(r[2]){if(l===void 0&&!(a in e))return!1}else{var c=new or,d;if(!(d===void 0?WC(u,l,X8|J8,s,c):d))return!1}}return!0}function KI(e){return e===e&&!Ma(e)}function ej(e){for(var t=wI(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,KI(o)]}return t}function qI(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function tj(e){var t=ej(e);return t.length==1&&t[0][2]?qI(t[0][0],t[0][1]):function(n){return n===e||Q8(n,e,t)}}function nj(e,t){return e!=null&&t in Object(e)}function sj(e,t,n){t=CI(t,e);for(var s=-1,o=t.length,i=!1;++s<o;){var r=Wg(t[s]);if(!(i=e!=null&&n(e,r)))break;e=e[r]}return i||++s!=o?i:(o=e==null?0:e.length,!!o&&FC(o)&&lI(r,o)&&(Jo(e)||Hg(e)))}function oj(e,t){return e!=null&&sj(e,t,nj)}var ij=1,rj=2;function aj(e,t){return NC(e)&&KI(t)?qI(Wg(e),t):function(n){var s=U4(n,e);return s===void 0&&s===t?oj(n,e):WC(t,s,ij|rj)}}function lj(e){return function(t){return t==null?void 0:t[e]}}function uj(e){return function(t){return bI(t,e)}}function cj(e){return NC(e)?lj(Wg(e)):uj(e)}function dj(e){return typeof e=="function"?e:e==null?DC:typeof e=="object"?Jo(e)?aj(e[0],e[1]):tj(e):cj(e)}var zC=function(){return Ri.Date.now()},hj="Expected a function",fj=Math.max,pj=Math.min;function Di(e,t,n){var s,o,i,r,a,l,u=0,c=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(hj);t=RC(t)||0,Ma(n)&&(c=!!n.leading,d="maxWait"in n,i=d?fj(RC(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function f(R){var T=s,I=o;return s=o=void 0,u=R,r=e.apply(I,T),r}function p(R){return u=R,a=setTimeout(C,t),c?f(R):r}function g(R){var T=R-l,I=R-u,x=t-T;return d?pj(x,i-I):x}function v(R){var T=R-l,I=R-u;return l===void 0||T>=t||T<0||d&&I>=i}function C(){var R=zC();if(v(R))return S(R);a=setTimeout(C,g(R))}function S(R){return a=void 0,h&&s?f(R):(s=o=void 0,r)}function b(){a!==void 0&&clearTimeout(a),u=0,s=l=o=a=void 0}function w(){return a===void 0?r:S(zC())}function _(){var R=zC(),T=v(R);if(s=arguments,o=this,l=R,T){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(C,t),f(l)}return a===void 0&&(a=setTimeout(C,t)),r}return _.cancel=b,_.flush=w,_}function YI(e){return jr(e)&&PC(e)}function gj(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var mj="[object Map]",vj="[object Set]",yj=Object.prototype,wj=yj.hasOwnProperty;function Cj(e){if(e==null)return!0;if(PC(e)&&(Jo(e)||typeof e=="string"||typeof e.splice=="function"||Fh(e)||MC(e)||Hg(e)))return!e.length;var t=Qo(e);if(t==mj||t==vj)return!e.size;if(AC(e))return!yI(e).length;for(var n in e)if(wj.call(e,n))return!1;return!0}var bj=1/0,Sj=lc&&1/GC(new lc([,-0]))[1]==bj?function(e){return new lc(e)}:t6,Ej=200;function _j(e,t,n){var s=-1,o=p6,i=e.length,r=!0,a=[],l=a;if(i>=Ej){var u=t?null:Sj(e);if(u)return GC(u);r=!1,o=HI,l=new Oh}else l=t?[]:a;e:for(;++s<i;){var c=e[s],d=t?t(c):c;if(c=c!==0?c:0,r&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(c)}else o(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}var uc=S6(function(e){var t=gj(e);return YI(t)&&(t=void 0),_j(z4(e,1,YI),dj(t))});const ts=(e,t)=>{const n=Yn();return{apiServices:Y(()=>{var r;const o=n==null?void 0:n.appContext.config.globalProperties,i=(r=t.params)==null?void 0:r.context;if(o!=null&&o.apiServices)return o.apiServices;if(e&&(i!=null&&i.apiServices))return i.apiServices})}},Rj=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let Wl=class extends Error{};class Dj extends Wl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Tj extends Wl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ij extends Wl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class cc extends Wl{}class ZI extends Wl{constructor(t){super(`Invalid unit ${t}`)}}class Bs extends Wl{}let Na=class extends Wl{constructor(){super("Zone is an abstract class")}};const Et="numeric",Ti="short",ko="long",qg={year:Et,month:Et,day:Et},XI={year:Et,month:Ti,day:Et},xj={year:Et,month:Ti,day:Et,weekday:Ti},JI={year:Et,month:ko,day:Et},QI={year:Et,month:ko,day:Et,weekday:ko},ex={hour:Et,minute:Et},tx={hour:Et,minute:Et,second:Et},nx={hour:Et,minute:Et,second:Et,timeZoneName:Ti},sx={hour:Et,minute:Et,second:Et,timeZoneName:ko},ox={hour:Et,minute:Et,hourCycle:"h23"},ix={hour:Et,minute:Et,second:Et,hourCycle:"h23"},rx={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:Ti},ax={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:ko},lx={year:Et,month:Et,day:Et,hour:Et,minute:Et},ux={year:Et,month:Et,day:Et,hour:Et,minute:Et,second:Et},cx={year:Et,month:Ti,day:Et,hour:Et,minute:Et},dx={year:Et,month:Ti,day:Et,hour:Et,minute:Et,second:Et},Fj={year:Et,month:Ti,day:Et,weekday:Ti,hour:Et,minute:Et},hx={year:Et,month:ko,day:Et,hour:Et,minute:Et,timeZoneName:Ti},fx={year:Et,month:ko,day:Et,hour:Et,minute:Et,second:Et,timeZoneName:Ti},px={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,timeZoneName:ko},gx={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,second:Et,timeZoneName:ko};let Mh=class{get type(){throw new Na}get name(){throw new Na}get ianaName(){return this.name}get isUniversal(){throw new Na}offsetName(t,n){throw new Na}formatOffset(t,n){throw new Na}offset(t){throw new Na}equals(t){throw new Na}get isValid(){throw new Na}},jC=null;class Yg extends Mh{static get instance(){return jC===null&&(jC=new Yg),jC}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const KC=new Map;function Pj(e){let t=KC.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"}),KC.set(e,t)),t}const Aj={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function kj(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function Oj(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=Aj[i];i==="era"?s[a]=r:Ht(a)||(s[a]=parseInt(r,10))}return s}const qC=new Map;let dc=class Q_ extends Mh{static create(t){let n=qC.get(t);return n===void 0&&qC.set(t,n=new Q_(t)),n}static resetCache(){qC.clear(),KC.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=Q_.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s,this.name)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=Pj(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?Oj(s,n):kj(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=em({year:o,month:i,day:r,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}},mx={};function Mj(e,t={}){const n=JSON.stringify([e,t]);let s=mx[n];return s||(s=new Intl.ListFormat(e,t),mx[n]=s),s}const YC=new Map;function ZC(e,t={}){const n=JSON.stringify([e,t]);let s=YC.get(n);return s===void 0&&(s=new Intl.DateTimeFormat(e,t),YC.set(n,s)),s}const XC=new Map;function Nj(e,t={}){const n=JSON.stringify([e,t]);let s=XC.get(n);return s===void 0&&(s=new Intl.NumberFormat(e,t),XC.set(n,s)),s}const JC=new Map;function Lj(e,t={}){const{base:n,...s}=t,o=JSON.stringify([e,s]);let i=JC.get(o);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),JC.set(o,i)),i}let Nh=null;function Vj(){return Nh||(Nh=new Intl.DateTimeFormat().resolvedOptions().locale,Nh)}const QC=new Map;function vx(e){let t=QC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),QC.set(e,t)),t}const eb=new Map;function Bj(e){let t=eb.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...yx,...t}),eb.set(e,t)}return t}function $j(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let s,o;try{s=ZC(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);s=ZC(l).resolvedOptions(),o=l}const{numberingSystem:i,calendar:r}=s;return[o,i,r]}}function Hj(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Gj(e){const t=[];for(let n=1;n<=12;n++){const s=bt.utc(2009,n,1);t.push(e(s))}return t}function Uj(e){const t=[];for(let n=1;n<=7;n++){const s=bt.utc(2016,11,13+n);t.push(e(s))}return t}function Zg(e,t,n,s){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):s(t)}function Wj(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||vx(e.locale).numberingSystem==="latn"}class zj{constructor(t,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:o,floor:i,...r}=s;if(!n||Object.keys(r).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Nj(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ub(t,3);return ds(n,this.padTo)}}}class jj{constructor(t,n,s){this.opts=s,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const r=-1*(t.offset/60),a=r>=0?`Etc/GMT+${r}`:`Etc/GMT${r}`;t.offset!==0&&dc.create(a).valid?(o=a,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=ZC(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Kj{constructor(t,n,s){this.opts={style:"long",...s},!n&&Lx()&&(this.rtf=Lj(t,s))}format(t,n){return this.rtf?this.rtf.format(t,n):gK(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const yx={firstDay:1,minimalDays:4,weekend:[6,7]};class bn{static fromOpts(t){return bn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,s,o,i=!1){const r=t||Zn.defaultLocale,a=r||(i?"en-US":Vj()),l=n||Zn.defaultNumberingSystem,u=s||Zn.defaultOutputCalendar,c=ab(o)||Zn.defaultWeekSettings;return new bn(a,l,u,c,r)}static resetCache(){Nh=null,YC.clear(),XC.clear(),JC.clear(),QC.clear(),eb.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:s,weekSettings:o}={}){return bn.create(t,n,s,o)}constructor(t,n,s,o,i){const[r,a,l]=$j(t);this.locale=r,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=o,this.intl=Hj(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Wj(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:bn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ab(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Zg(this,t,Wx,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");n&=!s;const o=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";if(!this.monthsCache[i][t]){const r=s?a=>this.dtFormatter(a,o).format():a=>this.extract(a,o,"month");this.monthsCache[i][t]=Gj(r)}return this.monthsCache[i][t]})}weekdays(t,n=!1){return Zg(this,t,Kx,()=>{const s=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Uj(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return Zg(this,void 0,()=>qx,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bt.utc(2016,11,13,9),bt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Zg(this,t,Yx,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[bt.utc(-40,1,1),bt.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[t]})}extract(t,n,s){const o=this.dtFormatter(t,n),i=o.formatToParts(),r=i.find(a=>a.type.toLowerCase()===s);return r?r.value:null}numberFormatter(t={}){return new zj(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new jj(t,this.intl,n)}relFormatter(t={}){return new Kj(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Mj(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||vx(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Vx()?Bj(this.locale):yx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let tb=null,ir=class Tp extends Mh{static get utcInstance(){return tb===null&&(tb=new Tp(0)),tb}static instance(t){return t===0?Tp.utcInstance:new Tp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tp(tm(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Bh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Bh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Bh(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}};class qj extends Mh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function La(e,t){if(Ht(e)||e===null)return t;if(e instanceof Mh)return e;if(eK(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Yg.instance:n==="utc"||n==="gmt"?ir.utcInstance:ir.parseSpecifier(n)||dc.create(e)}else return Va(e)?ir.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new qj(e)}const nb={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wx={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yj=nb.hanidec.replace(/[\[|\]]/g,"").split("");function Zj(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);if(e[n].search(nb.hanidec)!==-1)t+=Yj.indexOf(e[n]);else for(const o in wx){const[i,r]=wx[o];s>=i&&s<=r&&(t+=s-i)}}return parseInt(t,10)}else return t}const sb=new Map;function Xj(){sb.clear()}function Ii({numberingSystem:e},t=""){const n=e||"latn";let s=sb.get(n);s===void 0&&(s=new Map,sb.set(n,s));let o=s.get(t);return o===void 0&&(o=new RegExp(`${nb[n]}${t}`),s.set(t,o)),o}let Cx=()=>Date.now(),bx="system",Sx=null,Ex=null,_x=null,Rx=60,Dx,Tx=null;class Zn{static get now(){return Cx}static set now(t){Cx=t}static set defaultZone(t){bx=t}static get defaultZone(){return La(bx,Yg.instance)}static get defaultLocale(){return Sx}static set defaultLocale(t){Sx=t}static get defaultNumberingSystem(){return Ex}static set defaultNumberingSystem(t){Ex=t}static get defaultOutputCalendar(){return _x}static set defaultOutputCalendar(t){_x=t}static get defaultWeekSettings(){return Tx}static set defaultWeekSettings(t){Tx=ab(t)}static get twoDigitCutoffYear(){return Rx}static set twoDigitCutoffYear(t){Rx=t%100}static get throwOnInvalid(){return Dx}static set throwOnInvalid(t){Dx=t}static resetCaches(){bn.resetCache(),dc.resetCache(),bt.resetCache(),Xj()}}class xi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ix=[0,31,59,90,120,151,181,212,243,273,304,334],xx=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new xi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ob(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const o=s.getUTCDay();return o===0?7:o}function Fx(e,t,n){return n+(Lh(e)?xx:Ix)[t-1]}function Px(e,t){const n=Lh(e)?xx:Ix,s=n.findIndex(i=>i<t),o=t-n[s];return{month:s+1,day:o}}function ib(e,t){return(e-t+7)%7+1}function Xg(e,t=4,n=1){const{year:s,month:o,day:i}=e,r=Fx(s,o,i),a=ib(ob(s,o,i),n);let l=Math.floor((r-a+14-t)/7),u;return l<1?(u=s-1,l=Vh(u,t,n)):l>Vh(s,t,n)?(u=s+1,l=1):u=s,{weekYear:u,weekNumber:l,weekday:a,...sm(e)}}function Ax(e,t=4,n=1){const{weekYear:s,weekNumber:o,weekday:i}=e,r=ib(ob(s,1,t),n),a=fc(s);let l=o*7+i-r-7+t,u;l<1?(u=s-1,l+=fc(u)):l>a?(u=s+1,l-=fc(s)):u=s;const{month:c,day:d}=Px(u,l);return{year:u,month:c,day:d,...sm(e)}}function rb(e){const{year:t,month:n,day:s}=e,o=Fx(t,n,s);return{year:t,ordinal:o,...sm(e)}}function kx(e){const{year:t,ordinal:n}=e,{month:s,day:o}=Px(t,n);return{year:t,month:s,day:o,...sm(e)}}function Ox(e,t){if(!Ht(e.localWeekday)||!Ht(e.localWeekNumber)||!Ht(e.localWeekYear)){if(!Ht(e.weekday)||!Ht(e.weekNumber)||!Ht(e.weekYear))throw new cc("Cannot mix locale-based week fields with ISO-based week fields");return Ht(e.localWeekday)||(e.weekday=e.localWeekday),Ht(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ht(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Jj(e,t=4,n=1){const s=Jg(e.weekYear),o=ti(e.weekNumber,1,Vh(e.weekYear,t,n)),i=ti(e.weekday,1,7);return s?o?i?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Qj(e){const t=Jg(e.year),n=ti(e.ordinal,1,fc(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Mx(e){const t=Jg(e.year),n=ti(e.month,1,12),s=ti(e.day,1,Qg(e.year,e.month));return t?n?s?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Nx(e){const{hour:t,minute:n,second:s,millisecond:o}=e,i=ti(t,0,23)||t===24&&n===0&&s===0&&o===0,r=ti(n,0,59),a=ti(s,0,59),l=ti(o,0,999);return i?r?a?l?!1:ei("millisecond",o):ei("second",s):ei("minute",n):ei("hour",t)}function Ht(e){return typeof e>"u"}function Va(e){return typeof e=="number"}function Jg(e){return typeof e=="number"&&e%1===0}function eK(e){return typeof e=="string"}function tK(e){return Object.prototype.toString.call(e)==="[object Date]"}function Lx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Vx(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function nK(e){return Array.isArray(e)?e:[e]}function Bx(e,t,n){if(e.length!==0)return e.reduce((s,o)=>{const i=[t(o),o];return s&&n(s[0],i[0])===s[0]?s:i},null)[1]}function sK(e,t){return t.reduce((n,s)=>(n[s]=e[s],n),{})}function hc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ab(e){if(e==null)return null;if(typeof e!="object")throw new Bs("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new Bs("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Jg(e)&&e>=t&&e<=n}function oK(e,t){return e-t*Math.floor(e/t)}function ds(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Ba(e){if(!(Ht(e)||e===null||e===""))return parseInt(e,10)}function zl(e){if(!(Ht(e)||e===null||e===""))return parseFloat(e)}function lb(e){if(!(Ht(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ub(e,t,n="round"){const s=10**t;switch(n){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Lh(e){return e%4===0&&(e%100!==0||e%400===0)}function fc(e){return Lh(e)?366:365}function Qg(e,t){const n=oK(t-1,12)+1,s=e+(t-n)/12;return n===2?Lh(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function em(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 $x(e,t,n){return-ib(ob(e,1,t),n)+t-1}function Vh(e,t=4,n=1){const s=$x(e,t,n),o=$x(e+1,t,n);return(fc(e)-s+o)/7}function cb(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function Hx(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function tm(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Gx(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Bs(`Invalid unit value ${e}`);return t}function nm(e,t){const n={};for(const s in e)if(hc(e,s)){const o=e[s];if(o==null)continue;n[t(s)]=Gx(o)}return n}function Bh(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${ds(n,2)}:${ds(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${ds(n,2)}${ds(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function sm(e){return sK(e,["hour","minute","second","millisecond"])}const iK=["January","February","March","April","May","June","July","August","September","October","November","December"],Ux=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rK=["J","F","M","A","M","J","J","A","S","O","N","D"];function Wx(e){switch(e){case"narrow":return[...rK];case"short":return[...Ux];case"long":return[...iK];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const zx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],aK=["M","T","W","T","F","S","S"];function Kx(e){switch(e){case"narrow":return[...aK];case"short":return[...jx];case"long":return[...zx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qx=["AM","PM"],lK=["Before Christ","Anno Domini"],uK=["BC","AD"],cK=["B","A"];function Yx(e){switch(e){case"narrow":return[...cK];case"short":return[...uK];case"long":return[...lK];default:return null}}function dK(e){return qx[e.hour<12?0:1]}function hK(e,t){return Kx(t)[e.weekday-1]}function fK(e,t){return Wx(t)[e.month-1]}function pK(e,t){return Yx(t)[e.year<0?0:1]}function gK(e,t,n="always",s=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${o[e][0]}`;case-1:return d?"yesterday":`last ${o[e][0]}`;case 0:return d?"today":`this ${o[e][0]}`}}const r=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=o[e],c=s?l?u[1]:u[2]||u[1]:l?o[e][0]:e;return r?`${a} ${c} ago`:`in ${a} ${c}`}function Zx(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const mK={D:qg,DD:XI,DDD:JI,DDDD:QI,t:ex,tt:tx,ttt:nx,tttt:sx,T:ox,TT:ix,TTT:rx,TTTT:ax,f:lx,ff:cx,fff:hx,ffff:px,F:ux,FF:dx,FFF:fx,FFFF:gx};class $s{static create(t,n={}){return new $s(t,n)}static parseFormat(t){let n=null,s="",o=!1;const i=[];for(let r=0;r<t.length;r++){const a=t.charAt(r);a==="'"?((s.length>0||o)&&i.push({literal:o||/^\s+$/.test(s),val:s===""?"'":s}),n=null,s="",o=!o):o||a===n?s+=a:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&i.push({literal:o||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return mK[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,s=void 0){if(this.opts.forceSimple)return ds(t,n);const o={...this.opts};return n>0&&(o.padTo=n),s&&(o.signDisplay=s),this.loc.numberFormatter(o).format(t)}formatDateTimeFromString(t,n){const s=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,p)=>this.loc.extract(t,f,p),r=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?dK(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,p)=>s?fK(t,f):i(p?{month:f}:{month:f,day:"numeric"},"month"),u=(f,p)=>s?hK(t,f):i(p?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{const p=$s.macroTokenToFormatOpts(f);return p?this.formatWithSystemDefault(t,p):f},d=f=>s?pK(t,f):i({era:f},"era"),h=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(f)}};return Zx($s.parseFormat(n),h)}formatDurationFromString(t,n){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,o=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(c,d)=>h=>{const f=o(h);if(f){const p=d.isNegativeDuration&&f!==d.largestUnit?s:1;let g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(c.get(f)*p,h.length,g)}else return h},r=$s.parseFormat(n),a=r.reduce((c,{literal:d,val:h})=>d?c:c.concat(h),[]),l=t.shiftTo(...a.map(o).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return Zx(r,i(l,u))}}const Xx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pc(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function gc(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function mc(e,...t){if(e==null)return[null,null];for(const[n,s]of t){const o=n.exec(e);if(o)return s(o)}return[null,null]}function Jx(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Ba(t[n+o]);return[s,null,n+o]}}const Qx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,vK=`(?:${Qx.source}?(?:\\[(${Xx.source})\\])?)?`,db=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,eF=RegExp(`${db.source}${vK}`),hb=RegExp(`(?:[Tt]${eF.source})?`),yK=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,wK=/(\d{4})-?W(\d\d)(?:-?(\d))?/,CK=/(\d{4})-?(\d{3})/,bK=Jx("weekYear","weekNumber","weekDay"),SK=Jx("year","ordinal"),EK=/(\d{4})-(\d\d)-(\d\d)/,tF=RegExp(`${db.source} ?(?:${Qx.source}|(${Xx.source}))?`),_K=RegExp(`(?: ${tF.source})?`);function vc(e,t,n){const s=e[t];return Ht(s)?n:Ba(s)}function RK(e,t){return[{year:vc(e,t),month:vc(e,t+1,1),day:vc(e,t+2,1)},null,t+3]}function yc(e,t){return[{hours:vc(e,t,0),minutes:vc(e,t+1,0),seconds:vc(e,t+2,0),milliseconds:lb(e[t+3])},null,t+4]}function $h(e,t){const n=!e[t]&&!e[t+1],s=tm(e[t+1],e[t+2]),o=n?null:ir.instance(s);return[{},o,t+3]}function Hh(e,t){const n=e[t]?dc.create(e[t]):null;return[{},n,t+1]}const DK=RegExp(`^T?${db.source}$`),TK=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function IK(e){const[t,n,s,o,i,r,a,l,u]=e,c=t[0]==="-",d=l&&l[0]==="-",h=(f,p=!1)=>f!==void 0&&(p||f&&c)?-f:f;return[{years:h(zl(n)),months:h(zl(s)),weeks:h(zl(o)),days:h(zl(i)),hours:h(zl(r)),minutes:h(zl(a)),seconds:h(zl(l),l==="-0"),milliseconds:h(lb(u),d)}]}const xK={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fb(e,t,n,s,o,i,r){const a={year:t.length===2?cb(Ba(t)):Ba(t),month:Ux.indexOf(n)+1,day:Ba(s),hour:Ba(o),minute:Ba(i)};return r&&(a.second=Ba(r)),e&&(a.weekday=e.length>3?zx.indexOf(e)+1:jx.indexOf(e)+1),a}const FK=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function PK(e){const[,t,n,s,o,i,r,a,l,u,c,d]=e,h=fb(t,o,s,n,i,r,a);let f;return l?f=xK[l]:u?f=0:f=tm(c,d),[h,new ir(f)]}function AK(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const kK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,OK=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,MK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nF(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,o,s,n,i,r,a),ir.utcInstance]}function NK(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,a,n,s,o,i,r),ir.utcInstance]}const LK=pc(yK,hb),VK=pc(wK,hb),BK=pc(CK,hb),$K=pc(eF),sF=gc(RK,yc,$h,Hh),HK=gc(bK,yc,$h,Hh),GK=gc(SK,yc,$h,Hh),UK=gc(yc,$h,Hh);function WK(e){return mc(e,[LK,sF],[VK,HK],[BK,GK],[$K,UK])}function zK(e){return mc(AK(e),[FK,PK])}function jK(e){return mc(e,[kK,nF],[OK,nF],[MK,NK])}function KK(e){return mc(e,[TK,IK])}const qK=gc(yc);function YK(e){return mc(e,[DK,qK])}const ZK=pc(EK,_K),XK=pc(tF),JK=gc(yc,$h,Hh);function QK(e){return mc(e,[ZK,sF],[XK,JK])}const oF="Invalid Duration",iF={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},e7={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...iF},ni=146097/400,wc=146097/4800,t7={years:{quarters:4,months:12,weeks:ni/7,days:ni,hours:ni*24,minutes:ni*24*60,seconds:ni*24*60*60,milliseconds:ni*24*60*60*1e3},quarters:{months:3,weeks:ni/28,days:ni/4,hours:ni*24/4,minutes:ni*24*60/4,seconds:ni*24*60*60/4,milliseconds:ni*24*60*60*1e3/4},months:{weeks:wc/7,days:wc,hours:wc*24,minutes:wc*24*60,seconds:wc*24*60*60,milliseconds:wc*24*60*60*1e3},...iF},jl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],n7=jl.slice(0).reverse();function Yr(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new hn(s)}function rF(e,t){let n=t.milliseconds??0;for(const s of n7.slice(1))t[s]&&(n+=t[s]*e[s].milliseconds);return n}function aF(e,t){const n=rF(e,t)<0?-1:1;jl.reduceRight((s,o)=>{if(Ht(t[o]))return s;if(s){const i=t[s]*n,r=e[o][s],a=Math.floor(i/r);t[o]+=a*n,t[s]-=a*r*n}return o},null),jl.reduce((s,o)=>{if(Ht(t[o]))return s;if(s){const i=t[s]%1;t[s]-=i,t[o]+=i*e[s][o]}return o},null)}function lF(e){const t={};for(const[n,s]of Object.entries(e))s!==0&&(t[n]=s);return t}class hn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let s=n?t7:e7;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||bn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,n){return hn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Bs(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new hn({values:nm(t,hn.normalizeUnit),loc:bn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Va(t))return hn.fromMillis(t);if(hn.isDuration(t))return t;if(typeof t=="object")return hn.fromObject(t);throw new Bs(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[s]=KK(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[s]=YK(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Duration is invalid");const s=t instanceof xi?t:new xi(t,n);if(Zn.throwOnInvalid)throw new Ij(s);return new hn({invalid:s})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new ZI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?$s.create(this.loc,s).formatDurationFromString(this,t):oF}toHuman(t={}){if(!this.isValid)return oF;const n=t.showZeros!==!1,s=jl.map(o=>{const i=this.values[o];return Ht(i)||i===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:o.slice(0,-1)}).format(i)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ub(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},bt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?rF(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t),s={};for(const o of jl)(hc(n.values,o)||hc(this.values,o))&&(s[o]=n.get(o)+this.get(o));return Yr(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=Gx(t(this.values[s],s));return Yr(this,{values:n},!0)}get(t){return this[hn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...nm(t,hn.normalizeUnit)};return Yr(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:s,matrix:o}={}){const r={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:s};return Yr(this,r)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return aF(this.matrix,t),Yr(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=lF(this.normalize().shiftToAll().toObject());return Yr(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(r=>hn.normalizeUnit(r));const n={},s={},o=this.toObject();let i;for(const r of jl)if(t.indexOf(r)>=0){i=r;let a=0;for(const u in s)a+=this.matrix[u][r]*s[u],s[u]=0;Va(o[r])&&(a+=o[r]);const l=Math.trunc(a);n[r]=l,s[r]=(a*1e3-l*1e3)/1e3}else Va(o[r])&&(s[r]=o[r]);for(const r in s)s[r]!==0&&(n[i]+=r===i?s[r]:s[r]/this.matrix[i][r]);return aF(this.matrix,n),Yr(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Yr(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=lF(this.values);return Yr(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(s,o){return s===void 0||s===0?o===void 0||o===0:s===o}for(const s of jl)if(!n(this.values[s],t.values[s]))return!1;return!0}}const Cc="Invalid Interval";function s7(e,t){return!e||!e.isValid?Xn.invalid("missing or invalid start"):!t||!t.isValid?Xn.invalid("missing or invalid end"):t<e?Xn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Xn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Interval is invalid");const s=t instanceof xi?t:new xi(t,n);if(Zn.throwOnInvalid)throw new Tj(s);return new Xn({invalid:s})}static fromDateTimes(t,n){const s=Wh(t),o=Wh(n),i=s7(s,o);return i??new Xn({start:s,end:o})}static after(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o,o.plus(s))}static before(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o.minus(s),o)}static fromISO(t,n){const[s,o]=(t||"").split("/",2);if(s&&o){let i,r;try{i=bt.fromISO(s,n),r=i.isValid}catch{r=!1}let a,l;try{a=bt.fromISO(o,n),l=a.isValid}catch{l=!1}if(r&&l)return Xn.fromDateTimes(i,a);if(r){const u=hn.fromISO(o,n);if(u.isValid)return Xn.after(i,u)}else if(l){const u=hn.fromISO(s,n);if(u.isValid)return Xn.before(a,u)}}return Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:s.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(s,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Xn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Wh).filter(r=>this.contains(r)).sort((r,a)=>r.toMillis()-a.toMillis()),s=[];let{s:o}=this,i=0;for(;o<this.e;){const r=n[i]||this.e,a=+r>+this.e?this.e:r;s.push(Xn.fromDateTimes(o,a)),o=a,i+=1}return s}splitBy(t){const n=hn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,o=1,i;const r=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*o));i=+a>+this.e?this.e:a,r.push(Xn.fromDateTimes(s,i)),s=i,o+=1}return r}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return n>=s?null:Xn.fromDateTimes(n,s)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return Xn.fromDateTimes(n,s)}static merge(t){const[n,s]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],r)=>i?i.overlaps(r)||i.abutsStart(r)?[o,i.union(r)]:[o.concat([i]),r]:[o,r],[[],null]);return s&&n.push(s),n}static xor(t){let n=null,s=0;const o=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),r=Array.prototype.concat(...i),a=r.sort((l,u)=>l.time-u.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&o.push(Xn.fromDateTimes(n,l.time)),n=null);return Xn.merge(o)}difference(...t){return Xn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.s.loc.clone(n),t).formatInterval(this):Cc}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Cc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cc}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Cc}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Cc}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):hn.invalid(this.invalidReason)}mapEndpoints(t){return Xn.fromDateTimes(t(this.s),t(this.e))}}class bc{static hasDST(t=Zn.defaultZone){const n=bt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return dc.isValidZone(t)}static normalizeZone(t){return La(t,Zn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return bn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return bn.create(n,null,"gregory").eras(t)}static features(){return{relative:Lx(),localeWeek:Vx()}}}function uF(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(hn.fromMillis(s).as("days"))}function o7(e,t,n){const s=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=uF(l,u);return(c-c%7)/7}],["days",uF]],o={},i=e;let r,a;for(const[l,u]of s)n.indexOf(l)>=0&&(r=l,o[l]=u(e,t),a=i.plus(o),a>t?(o[l]--,e=i.plus(o),e>t&&(a=e,o[l]--,e=i.plus(o))):e=a);return[e,o,a,r]}function i7(e,t,n,s){let[o,i,r,a]=o7(e,t,n);const l=t-o,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(r<t&&(r=o.plus({[a]:1})),r!==o&&(i[a]=(i[a]||0)+l/(r-o)));const c=hn.fromObject(i,s);return u.length>0?hn.fromMillis(l,s).shiftTo(...u).plus(c):c}const r7="missing Intl.DateTimeFormat.formatToParts support";function vn(e,t=n=>n){return{regex:e,deser:([n])=>t(Zj(n))}}const cF="[  ]",dF=new RegExp(cF,"g");function a7(e){return e.replace(/\./g,"\\.?").replace(dF,cF)}function hF(e){return e.replace(/\./g,"").replace(dF," ").toLowerCase()}function Fi(e,t){return e===null?null:{regex:RegExp(e.map(a7).join("|")),deser:([n])=>e.findIndex(s=>hF(n)===hF(s))+t}}function fF(e,t){return{regex:e,deser:([,n,s])=>tm(n,s),groups:t}}function om(e){return{regex:e,deser:([t])=>t}}function l7(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function u7(e,t){const n=Ii(t),s=Ii(t,"{2}"),o=Ii(t,"{3}"),i=Ii(t,"{4}"),r=Ii(t,"{6}"),a=Ii(t,"{1,2}"),l=Ii(t,"{1,3}"),u=Ii(t,"{1,6}"),c=Ii(t,"{1,9}"),d=Ii(t,"{2,4}"),h=Ii(t,"{4,6}"),f=v=>({regex:RegExp(l7(v.val)),deser:([C])=>C,literal:!0}),g=(v=>{if(e.literal)return f(v);switch(v.val){case"G":return Fi(t.eras("short"),0);case"GG":return Fi(t.eras("long"),0);case"y":return vn(u);case"yy":return vn(d,cb);case"yyyy":return vn(i);case"yyyyy":return vn(h);case"yyyyyy":return vn(r);case"M":return vn(a);case"MM":return vn(s);case"MMM":return Fi(t.months("short",!0),1);case"MMMM":return Fi(t.months("long",!0),1);case"L":return vn(a);case"LL":return vn(s);case"LLL":return Fi(t.months("short",!1),1);case"LLLL":return Fi(t.months("long",!1),1);case"d":return vn(a);case"dd":return vn(s);case"o":return vn(l);case"ooo":return vn(o);case"HH":return vn(s);case"H":return vn(a);case"hh":return vn(s);case"h":return vn(a);case"mm":return vn(s);case"m":return vn(a);case"q":return vn(a);case"qq":return vn(s);case"s":return vn(a);case"ss":return vn(s);case"S":return vn(l);case"SSS":return vn(o);case"u":return om(c);case"uu":return om(a);case"uuu":return vn(n);case"a":return Fi(t.meridiems(),0);case"kkkk":return vn(i);case"kk":return vn(d,cb);case"W":return vn(a);case"WW":return vn(s);case"E":case"c":return vn(n);case"EEE":return Fi(t.weekdays("short",!1),1);case"EEEE":return Fi(t.weekdays("long",!1),1);case"ccc":return Fi(t.weekdays("short",!0),1);case"cccc":return Fi(t.weekdays("long",!0),1);case"Z":case"ZZ":return fF(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return fF(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return om(/[a-z_+-/]{1,256}?/i);case" ":return om(/[^\S\n\r]/);default:return f(v)}})(e)||{invalidReason:r7};return g.token=e,g}const c7={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function d7(e,t,n){const{type:s,value:o}=e;if(s==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const i=t[s];let r=s;s==="hour"&&(t.hour12!=null?r=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?r="hour12":r="hour24":r=n.hour12?"hour12":"hour24");let a=c7[r];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function h7(e){return[`^${e.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,e]}function f7(e,t,n){const s=e.match(t);if(s){const o={};let i=1;for(const r in n)if(hc(n,r)){const a=n[r],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(o[a.token.val[0]]=a.deser(s.slice(i,i+l))),i+=l}return[s,o]}else return[s,{}]}function p7(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return Ht(e.z)||(n=dc.create(e.z)),Ht(e.Z)||(n||(n=new ir(e.Z)),s=e.Z),Ht(e.q)||(e.M=(e.q-1)*3+1),Ht(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Ht(e.u)||(e.S=lb(e.u)),[Object.keys(e).reduce((i,r)=>{const a=t(r);return a&&(i[a]=e[r]),i},{}),n,s]}let pb=null;function g7(){return pb||(pb=bt.fromMillis(1555555555555)),pb}function m7(e,t){if(e.literal)return e;const n=$s.macroTokenToFormatOpts(e.val),s=vF(n,t);return s==null||s.includes(void 0)?e:s}function pF(e,t){return Array.prototype.concat(...e.map(n=>m7(n,t)))}class gF{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=pF($s.parseFormat(n),t),this.units=this.tokens.map(s=>u7(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,o]=h7(this.units);this.regex=RegExp(s,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,s]=f7(t,this.regex,this.handlers),[o,i,r]=s?p7(s):[null,null,void 0];if(hc(s,"a")&&hc(s,"H"))throw new cc("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:o,zone:i,specificOffset:r}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function mF(e,t,n){return new gF(e,n).explainFromTokens(t)}function v7(e,t,n){const{result:s,zone:o,specificOffset:i,invalidReason:r}=mF(e,t,n);return[s,o,i,r]}function vF(e,t){if(!e)return null;const s=$s.create(t,e).dtFormatter(g7()),o=s.formatToParts(),i=s.resolvedOptions();return o.map(r=>d7(r,e,i))}const gb="Invalid DateTime",yF=864e13;function Gh(e){return new xi("unsupported zone",`the zone "${e.name}" is not supported`)}function mb(e){return e.weekData===null&&(e.weekData=Xg(e.c)),e.weekData}function vb(e){return e.localWeekData===null&&(e.localWeekData=Xg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Kl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bt({...n,...t,old:n})}function wF(e,t,n){let s=e-t*60*1e3;const o=n.offset(s);if(t===o)return[s,t];s-=(o-t)*60*1e3;const i=n.offset(s);return o===i?[s,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function im(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function rm(e,t,n){return wF(em(e),t,n)}function CF(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:s,month:o,day:Math.min(e.c.day,Qg(s,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},r=hn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=em(i);let[l,u]=wF(a,n,e.zone);return r!==0&&(l+=r,u=e.zone.offset(l)),{ts:l,o:u}}function Sc(e,t,n,s,o,i){const{setZone:r,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,u=bt.fromObject(e,{...n,zone:l,specificOffset:i});return r?u:u.setZone(a)}else return bt.invalid(new xi("unparsable",`the input "${o}" can't be parsed as ${s}`))}function am(e,t,n=!0){return e.isValid?$s.create(bn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function yb(e,t,n){const s=e.c.year>9999||e.c.year<0;let o="";if(s&&e.c.year>=0&&(o+="+"),o+=ds(e.c.year,s?6:4),n==="year")return o;if(t){if(o+="-",o+=ds(e.c.month),n==="month")return o;o+="-"}else if(o+=ds(e.c.month),n==="month")return o;return o+=ds(e.c.day),o}function bF(e,t,n,s,o,i,r){let a=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(r){case"day":case"month":case"year":break;default:if(l+=ds(e.c.hour),r==="hour")break;if(t){if(l+=":",l+=ds(e.c.minute),r==="minute")break;a&&(l+=":",l+=ds(e.c.second))}else{if(l+=ds(e.c.minute),r==="minute")break;a&&(l+=ds(e.c.second))}if(r==="second")break;a&&(!s||e.c.millisecond!==0)&&(l+=".",l+=ds(e.c.millisecond,3))}return o&&(e.isOffsetFixed&&e.offset===0&&!i?l+="Z":e.o<0?(l+="-",l+=ds(Math.trunc(-e.o/60)),l+=":",l+=ds(Math.trunc(-e.o%60))):(l+="+",l+=ds(Math.trunc(e.o/60)),l+=":",l+=ds(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const SF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},y7={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},w7={ordinal:1,hour:0,minute:0,second:0,millisecond:0},lm=["year","month","day","hour","minute","second","millisecond"],C7=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],b7=["year","ordinal","hour","minute","second","millisecond"];function um(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ZI(e);return t}function EF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return um(e)}}function S7(e){if(Uh===void 0&&(Uh=Zn.now()),e.type!=="iana")return e.offset(Uh);const t=e.name;let n=wb.get(t);return n===void 0&&(n=e.offset(Uh),wb.set(t,n)),n}function _F(e,t){const n=La(t.zone,Zn.defaultZone);if(!n.isValid)return bt.invalid(Gh(n));const s=bn.fromObject(t);let o,i;if(Ht(e.year))o=Zn.now();else{for(const l of lm)Ht(e[l])&&(e[l]=SF[l]);const r=Mx(e)||Nx(e);if(r)return bt.invalid(r);const a=S7(n);[o,i]=rm(e,a,n)}return new bt({ts:o,zone:n,loc:s,o:i})}function RF(e,t,n){const s=Ht(n.round)?!0:n.round,o=Ht(n.rounding)?"trunc":n.rounding,i=(a,l)=>(a=ub(a,s||n.calendary?0:2,n.calendary?"round":o),t.loc.clone(n).relFormatter(n).format(a,l)),r=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return i(r(n.unit),n.unit);for(const a of n.units){const l=r(a);if(Math.abs(l)>=1)return i(l,a)}return i(e>t?-0:0,n.units[n.units.length-1])}function DF(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Uh;const wb=new Map;class bt{constructor(t){const n=t.zone||Zn.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new xi("invalid input"):null)||(n.isValid?null:Gh(n));this.ts=Ht(t.ts)?Zn.now():t.ts;let o=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const a=Va(t.o)&&!t.old?t.o:n.offset(this.ts);o=im(this.ts,a),s=Number.isNaN(o.year)?new xi("invalid input"):null,o=s?null:o,i=s?null:a}this._zone=n,this.loc=t.loc||bn.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new bt({})}static local(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return _F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return t.zone=ir.utcInstance,_F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const s=tK(t)?t.valueOf():NaN;if(Number.isNaN(s))return bt.invalid("invalid input");const o=La(n.zone,Zn.defaultZone);return o.isValid?new bt({ts:s,zone:o,loc:bn.fromObject(n)}):bt.invalid(Gh(o))}static fromMillis(t,n={}){if(Va(t))return t<-yF||t>yF?bt.invalid("Timestamp out of range"):new bt({ts:t,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Va(t))return new bt({ts:t*1e3,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const s=La(n.zone,Zn.defaultZone);if(!s.isValid)return bt.invalid(Gh(s));const o=bn.fromObject(n),i=nm(t,EF),{minDaysInFirstWeek:r,startOfWeek:a}=Ox(i,o),l=Zn.now(),u=Ht(n.specificOffset)?s.offset(l):n.specificOffset,c=!Ht(i.ordinal),d=!Ht(i.year),h=!Ht(i.month)||!Ht(i.day),f=d||h,p=i.weekYear||i.weekNumber;if((f||c)&&p)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new cc("Can't mix ordinal dates with month/day");const g=p||i.weekday&&!f;let v,C,S=im(l,u);g?(v=C7,C=y7,S=Xg(S,r,a)):c?(v=b7,C=w7,S=rb(S)):(v=lm,C=SF);let b=!1;for(const P of v){const D=i[P];Ht(D)?b?i[P]=C[P]:i[P]=S[P]:b=!0}const w=g?Jj(i,r,a):c?Qj(i):Mx(i),_=w||Nx(i);if(_)return bt.invalid(_);const R=g?Ax(i,r,a):c?kx(i):i,[T,I]=rm(R,u,s),x=new bt({ts:T,zone:s,o:I,loc:o});return i.weekday&&f&&t.weekday!==x.weekday?bt.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${x.toISO()}`):x.isValid?x:bt.invalid(x.invalid)}static fromISO(t,n={}){const[s,o]=WK(t);return Sc(s,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[s,o]=zK(t);return Sc(s,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[s,o]=jK(t);return Sc(s,o,n,"HTTP",n)}static fromFormat(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[a,l,u,c]=v7(r,t,n);return c?bt.invalid(c):Sc(a,l,s,`format ${n}`,t,u)}static fromString(t,n,s={}){return bt.fromFormat(t,n,s)}static fromSQL(t,n={}){const[s,o]=QK(t);return Sc(s,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the DateTime is invalid");const s=t instanceof xi?t:new xi(t,n);if(Zn.throwOnInvalid)throw new Dj(s);return new bt({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const s=vF(t,bn.fromObject(n));return s?s.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return pF($s.parseFormat(t),bn.fromObject(n)).map(o=>o.val).join("")}static resetCache(){Uh=void 0,wb.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?mb(this).weekYear:NaN}get weekNumber(){return this.isValid?mb(this).weekNumber:NaN}get weekday(){return this.isValid?mb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?vb(this).weekday:NaN}get localWeekNumber(){return this.isValid?vb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?vb(this).weekYear:NaN}get ordinal(){return this.isValid?rb(this.c).ordinal:NaN}get monthShort(){return this.isValid?bc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?bc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?bc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?bc.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,s=em(this.c),o=this.zone.offset(s-t),i=this.zone.offset(s+t),r=this.zone.offset(s-o*n),a=this.zone.offset(s-i*n);if(r===a)return[this];const l=s-r*n,u=s-a*n,c=im(l,r),d=im(u,a);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[Kl(this,{ts:l}),Kl(this,{ts:u})]:[this]}get isInLeapYear(){return Lh(this.year)}get daysInMonth(){return Qg(this.year,this.month)}get daysInYear(){return this.isValid?fc(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:s,calendar:o}=$s.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ir.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(t=La(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||s){const i=t.offset(this.ts),r=this.toObject();[o]=rm(r,i,t)}return Kl(this,{ts:o,zone:t})}else return bt.invalid(Gh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:s}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:s});return Kl(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=nm(t,EF),{minDaysInFirstWeek:s,startOfWeek:o}=Ox(n,this.loc),i=!Ht(n.weekYear)||!Ht(n.weekNumber)||!Ht(n.weekday),r=!Ht(n.ordinal),a=!Ht(n.year),l=!Ht(n.month)||!Ht(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||r)&&c)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new cc("Can't mix ordinal dates with month/day");let d;i?d=Ax({...Xg(this.c,s,o),...n},s,o):Ht(n.ordinal)?(d={...this.toObject(),...n},Ht(n.day)&&(d.day=Math.min(Qg(d.year,d.month),d.day))):d=kx({...rb(this.c),...n});const[h,f]=rm(d,this.o,this.zone);return Kl(this,{ts:h,o:f})}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return Kl(this,CF(this,n))}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t).negate();return Kl(this,CF(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},o=hn.normalizeUnit(t);switch(o){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:r}=this;r<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?$s.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):gb}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.loc.clone(n),t).formatDateTime(this):gb}toLocaleParts(t={}){return this.isValid?$s.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:o=!0,extendedZone:i=!1,precision:r="milliseconds"}={}){if(!this.isValid)return null;r=um(r);const a=t==="extended";let l=yb(this,a,r);return lm.indexOf(r)>=3&&(l+="T"),l+=bF(this,a,n,s,o,i,r),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?yb(this,t==="extended",um(n)):null}toISOWeekDate(){return am(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:o=!1,extendedZone:i=!1,format:r="extended",precision:a="milliseconds"}={}){return this.isValid?(a=um(a),(o&&lm.indexOf(a)>=3?"T":"")+bF(this,r==="extended",n,t,s,i,a)):null}toRFC2822(){return am(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return am(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yb(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(s&&(o+=" "),n?o+="z":t&&(o+="ZZ")),am(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():gb}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",s={}){if(!this.isValid||!t.isValid)return hn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=nK(n).map(hn.normalizeUnit),r=t.valueOf()>this.valueOf(),a=r?this:t,l=r?t:this,u=i7(a,l,i,o);return r?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(bt.now(),t,n)}until(t){return this.isValid?Xn.fromDateTimes(this,t):this}hasSame(t,n,s){if(!this.isValid)return!1;const o=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,s)<=o&&o<=i.endOf(n,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||bt.fromObject({},{zone:this.zone}),s=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),RF(n,this.plus(s),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?RF(t.base||bt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(bt.isDateTime))throw new Bs("min requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(bt.isDateTime))throw new Bs("max requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,s={}){const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return mF(r,t,n)}static fromStringExplain(t,n,s={}){return bt.fromFormatExplain(t,n,s)}static buildFormatParser(t,n={}){const{locale:s=null,numberingSystem:o=null}=n,i=bn.fromOpts({locale:s,numberingSystem:o,defaultToEN:!0});return new gF(i,t)}static fromFormatParser(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!r.equals(n.locale))throw new Bs(`fromFormatParser called with a locale of ${r}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(t);return c?bt.invalid(c):Sc(a,l,s,`format ${n.format}`,t,u)}static get DATE_SHORT(){return qg}static get DATE_MED(){return XI}static get DATE_MED_WITH_WEEKDAY(){return xj}static get DATE_FULL(){return JI}static get DATE_HUGE(){return QI}static get TIME_SIMPLE(){return ex}static get TIME_WITH_SECONDS(){return tx}static get TIME_WITH_SHORT_OFFSET(){return nx}static get TIME_WITH_LONG_OFFSET(){return sx}static get TIME_24_SIMPLE(){return ox}static get TIME_24_WITH_SECONDS(){return ix}static get TIME_24_WITH_SHORT_OFFSET(){return rx}static get TIME_24_WITH_LONG_OFFSET(){return ax}static get DATETIME_SHORT(){return lx}static get DATETIME_SHORT_WITH_SECONDS(){return ux}static get DATETIME_MED(){return cx}static get DATETIME_MED_WITH_SECONDS(){return dx}static get DATETIME_MED_WITH_WEEKDAY(){return Fj}static get DATETIME_FULL(){return hx}static get DATETIME_FULL_WITH_SECONDS(){return fx}static get DATETIME_HUGE(){return px}static get DATETIME_HUGE_WITH_SECONDS(){return gx}}function Wh(e){if(bt.isDateTime(e))return e;if(e&&e.valueOf&&Va(e.valueOf()))return bt.fromJSDate(e);if(e&&typeof e=="object")return bt.fromObject(e);throw new Bs(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const TF="account.last_prefered_timezone",rr=500;var Lt=(e=>(e[e.UNCHECK=0]="UNCHECK",e[e.INDETERMINATE=1]="INDETERMINATE",e[e.CHECKED=2]="CHECKED",e))(Lt||{});function zh(e){if(!e)return null;if(bt.isDateTime(e))return e;if(e instanceof Date){const t=bt.fromJSDate(e);return t.isValid?t:null}if(typeof e=="number"){const t=bt.fromMillis(e);return t.isValid?t:null}if(typeof e=="string"){let t=bt.fromISO(e);return t.isValid||(t=bt.fromRFC2822(e)),t.isValid?t:null}return null}function IF(e,t,n){const s=zh(e);if(!s)return"";const o=n?s.setZone(n):s;return o.isValid?o.toFormat(t):""}const cm=()=>Rj(TF)||"UTC",xF=e=>({id:e.id,name:(e==null?void 0:e.name)??e.display_name,initial:e.initial,profile_image:e.profile_image,color:{bgColor:e.color.bgColor,textColor:e.color.textColor}}),Ec=e=>e!=null&&e.length?e.map(xF):[],E7=e=>{if(!(e!=null&&e.length))return[];const t=new Set;return e.filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))},FF=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t},_7=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0)),PF=(e,t)=>{var s,o,i;const n={id:e.id,name:e.name,assignees:void 0,status:e.template_flow_status,dateRange:[FF(e.start_date),FF(e.due_date)],isStarted:!!Number(e.is_started),isCompleted:!!Number(e.is_completed),lastUpdated:{tooltip:e!=null&&e.last_updated_by?e.last_updated_by:"",value:IF(e.updated_at,"MMM dd, yyyy | HH:mm",t)||""},completedOn:{tooltip:e.actual_due_date==null?"Pending":e.last_completed_by?e.last_completed_by:"",value:IF(e.actual_due_date,"MMM dd, yyyy | HH:mm",t)},isDeleted:!1,isProcessing:e!=null&&e.bulk_process?{state:e==null?void 0:e.bulk_process.state,message:(e==null?void 0:e.bulk_process.message)||""}:void 0,disabled:((s=e==null?void 0:e.bulk_process)==null?void 0:s.state)==0,isArchived:((o=e.property)==null?void 0:o.is_archived)===1||e.status==0,isLocked:((i=e.property)==null?void 0:i.is_locked)===1};return _7(n)},AF={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},Cb=e=>e.toLowerCase().trim(),R7=e=>Cb(e).split(/\s+/).filter(Boolean),kF=e=>e.replace(/(ing|ed|s)$/i,"");function D7(e){const t=new Set;for(const n of e){const s=kF(n);if(t.add(s),t.add(n),AF[s])for(const o of AF[s])t.add(kF(o))}return Array.from(t)}function T7(e,t){const n=Cb(e),s=D7(R7(t));let o=0;for(const i of s)i&&(n.includes(i)&&(o+=i.length*2),n.startsWith(i)&&(o+=3));return o}function I7(e,t){const n=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=t.split(/\s+/).filter(Boolean).map(n);if(!s.length)return e;const o=new RegExp(`(${s.join("|")})`,"ig");return e.replace(o,"<mark>$1</mark>")}const OF=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},bb=e=>!isNaN(e)&&isFinite(e),dm=(e,t)=>{var i;const{restricted_type:n}=e,s=Math.floor(Number(t)),o=((i=e.restricted_value)==null?void 0:i.split(",").map(Number))||[];if(n=="none")return!0;if(e.restricted_type=="not")return bb(s)&&!o.includes(s);if(e.restricted_type=="range"){const[r,a]=o;return bb(Number(t))&&Number(t)>=Number(r)&&Number(t)<=Number(a)}else if(n=="exact")return bb(s)&&o.includes(s);return!1},x7=(e,t)=>{var i;const n=En.getInstance().getItem("ws.terminology"),s=n?JSON.parse(n):null;return` ${((i=s==null?void 0:s.find(r=>r.code==="scene"))==null?void 0:i.name)||"Scene"} ${t}`.trim()};/*! js-cookie v3.0.5 | MIT */function hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var F7={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Sb(e,t){function n(o,i,r){if(!(typeof document>"u")){r=hm({},t,r),typeof r.expires=="number"&&(r.expires=new Date(Date.now()+r.expires*864e5)),r.expires&&(r.expires=r.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in r)r[l]&&(a+="; "+l,r[l]!==!0&&(a+="="+r[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],r={},a=0;a<i.length;a++){var l=i[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(r[c]=e.read(u,c),o===c)break}catch{}}return o?r[o]:r}}return Object.create({set:n,get:s,remove:function(o,i){n(o,"",hm({},i,{expires:-1}))},withAttributes:function(o){return Sb(this.converter,hm({},this.attributes,o))},withConverter:function(o){return Sb(hm({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var MF=Sb(F7,{path:"/"});const fm=({date:e,timezone:t,format:n})=>{if(!e)return"";const s=typeof e=="string"?bt.fromISO(e,{zone:t}):e,o=bt.now().setZone(t||"local"),i=s.setZone(t||"local"),r=o.startOf("day"),l=i.startOf("day").diff(r,"days").days;let u="";if(l===0?u="Today":l===-1?u="Yesterday":l===1&&(u="Tomorrow"),u&&(n!=null&&n.includes("HH:mm"))){const c=i.toFormat("HH:mm");return`${u} at ${c}`}else if(u)return u;return i.toFormat(n)},Eb=()=>MF.get("account.last_prefered_timezone")||"UTC",pm=e=>`${bt.fromJSDate(e,{zone:"UTC"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,gm=e=>({id:e.id,label:e.name,value:e.id,data:e,color:e.color||{bgColor:"#CCCCCC",textColor:"#FFFFFF"},selected:!1,hover:!1,type:"text",disabled:!1,clickable:!0,danger:!1}),mm=(e,t)=>{var P;const n=_n("filterParams",null),s=V(((P=e.value)==null?void 0:P.map(D=>D.id))??[]),o=V([]),i=V(!1),r=Ki(e,"workspaceId"),a=Ki(e,"entityId"),l=Ki(e,"id"),u=Ki(e,"isSelectAll"),c=Ki(e,"isBulkUpdate"),d=e.updateRowData,h=V([]),{apiServices:f}=ts(!!e.params,e),p=Y(()=>{var O,B;const D=new Set(((O=e.value)==null?void 0:O.map(Z=>Z.id))??[]),F=((B=e.value)==null?void 0:B.map(Z=>({...gm(Z),selected:!0})))??[],k=o.value.filter(Z=>!D.has(Z.id));return uc(F,k,"id")}),g=D=>{const F=p.value.find(k=>k.id===D);return F==null?void 0:F.data},v=()=>{var D;return c.value&&u.value?[]:(D=t==null?void 0:t.value)!=null&&D.length?t.value:[String(l.value)]},C=async(D,F,k)=>{if(i.value||!f.value)return!1;i.value=!0;try{const O=await D();if((O==null?void 0:O.message)!=="Done")throw new Error("API call failed");return F(),!0}catch(O){return console.error("API call error:",O),k==null||k(O),!1}finally{i.value=!1}},S=Y(()=>!!(c.value&&u.value)),b=async()=>await C(()=>f.value.unAssignAll({workspaceId:String(r.value),userIds:[],itemIds:S.value?void 0:v(),entityId:S.value?String(a.value):void 0,filterParams:n!=null&&n.value?n.value:void 0}),()=>{d==null||d({assignees:[],type:"removeAll"}),s.value=[]},()=>{var F;console.error("Failed to unassign all assignees"),(F=e.errorCallback)==null||F.call(e)}),w=async D=>await C(()=>f.value.replaceAssignee(R(D)),()=>{s.value=[D];const k=g(D);k&&(d==null||d({assignees:Ec([k]),type:"overwrite"}))},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),_=async D=>await C(()=>f.value.addAssignee(R(D)),()=>{var O,B,Z;s.value.push(D);const k=g(D);if(k){const J=(Z=(B=(O=e.params)==null?void 0:O.api)==null?void 0:B.getRowNode(String(e.id)))==null?void 0:Z.data,ee=(J==null?void 0:J.assignees)||[],X=uc([...ee,...Ec([k])],"id");d==null||d({assignees:X,type:"add"})}},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),R=D=>{const F={workspaceId:String(r.value),userIds:[D],filterParams:n!=null&&n.value?n.value:void 0};return console.log("Creating payload with filterParams:",e),S.value?(F.itemIds=void 0,F.entityId=String(a.value)):F.itemIds=v(),F},T=async D=>await C(()=>f.value.removeAssignee(R(D)),()=>{var B,Z,J;const k=(J=(Z=(B=e.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(e.id)))==null?void 0:J.data;s.value=s.value.filter(ee=>ee!==D);const O=Ec(((k==null?void 0:k.assignees)||[]).filter(ee=>ee.id!==D));d==null||d({assignees:O,type:"remove"})},()=>{var k;(k=e.errorCallback)==null||k.call(e)});return{isSubmitting:i,options:h,unAssignAll:b,replaceAssignees:w,addAssignee:_,removeAssignee:T,handleSelect:D=>{const F=String(D.id);s.value.includes(F)?T(F):_(F)},openPeopleInsight:D=>{if(!D||!r.value)return;const F=co({type:"people_insight",config:{user_id:D,ws_code:r.value,baseDomain:En.getInstance().getItem("BASE_URL")||""}}).url;window.open(F,"_blank")},assigneeList:o,mergedOptions:p,selectedUserIds:s}},P7={placement:"bottom-start",theme:"light",trigger:"click",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0};function A7(e){return e.value?"$el"in e.value?e.value.$el:e.value:null}function Fs(e={}){const t=V(!1),n={...P7,...e},s=V(null),o=V(null),i=V(null),r=V(!1);let a=null,l=null;const u=S=>{(S.key==="Escape"||S.key==="Esc")&&p()},c=()=>{a&&l&&(l.removeEventListener("click",a),a=null,l=null),i.value&&(i.value.destroy(),i.value=null,r.value=!1),document.removeEventListener("keydown",u)},d=S=>{const{showOnInit:b,alwaysShow:w,showArrow:_,debug:R,...T}=n;return{...T,content:S,theme:n.theme,trigger:w||n.toggleOnClick?"manual":n.trigger,placement:n.placement||"bottom-start",arrow:!1,offset:n.offset,interactive:n.interactive,appendTo:n.appendTo,animation:"fade",maxWidth:n.maxWidth||350,onShow:I=>{if(e.disabled)return!1;if(r.value=!0,document.addEventListener("keydown",u),e.onShow)return e.onShow(I)},onHide:I=>{if(t.value)return setTimeout(()=>{t.value=!1},200),!1;if(w)return!1;if(r.value=!1,document.removeEventListener("keydown",u),e.onHide)return e.onHide(I)},onClickOutside:n.onClickOutside?n.onClickOutside:(I,x)=>{const P=x.target.closest(".notification-center"),D=x.target.closest("#people-insight-container");if(P||D){t.value=!0;return}if(e.onClickOutside)return e.onClickOutside(I,x);w||I.hide()},popperOptions:n.popperOptions||{modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}},{name:"preventOverflow",options:{padding:8}}]},hideOnClick:n.hideOnClick!==void 0?n.hideOnClick:!1}},h=()=>{var w;c();const S=A7(s),b=o.value;if(!(!S||!b)){b.style.display==="none"&&(b.style.display="");try{const _=d(b),R=Pa(S,_);i.value=Array.isArray(R)?R[0]:R,n.toggleOnClick&&!n.alwaysShow&&(a=()=>g(),l=S,S.addEventListener("click",a)),(n.showOnInit||n.alwaysShow)&&((w=i.value)==null||w.show())}catch(_){console.error("[useTippyComposable] Failed to create Tippy instance:",_)}}},f=S=>{S&&C(S),i.value&&i.value.show()},p=()=>{n.alwaysShow||i.value&&i.value.hide()},g=()=>{r.value?p():f()},v=S=>{i.value&&i.value.setContent(S)},C=S=>{i.value&&i.value.setProps(S)};return tt([s,o],h,{flush:"post"}),vs(()=>{c()}),{instance:i,isVisible:r,show:f,hide:p,toggle:g,triggerRef:s,popupRef:o,destroyTippy:c,setContent:v,setProps:C}}const NF=(e,t,n)=>{const s=V("Copy"),o=()=>{setTimeout(()=>{s.value="Copy"},5e3)};return{copyToClipboard:async r=>{r.stopPropagation(),r.preventDefault(),r.stopImmediatePropagation();try{return await navigator.clipboard.writeText(e),s.value="Copied",t==null||t(),o(),!0}catch(a){return console.error("Failed to copy text to clipboard:",a),s.value="Copy failed",o(),!1}},tooltip:s}},k7=(e,t,n)=>{const s={truncate:"End date cleared because it was before start. Please pick an end date.",swap:"Dates auto-swapped because start was after end.",...e.messages},o=Eo({startDate:null,endDate:null,timezone:e.timezone||"UTC",format:e.format||"",isSelectingStart:!1,isSelectingEnd:!1,rangeFeedback:{status:"idle",action:null,message:""},cacheStartDate:null,cacheEndDate:null,isDirty:!1});eh(()=>{var P;((P=e.value)==null?void 0:P.length)===2&&(o.startDate=e.value[0],o.endDate=e.value[1]),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isSelectingStart=!1,o.isSelectingEnd=!1,e.timezone&&(o.timezone=e.timezone)});const i=V(!1),r=V(!1),a=()=>{var Z,J,ee,X,ve,ne,L,H;const P=i.value||((J=(Z=o.startDate)==null?void 0:Z.getTime)==null?void 0:J.call(Z))!==((X=(ee=o.cacheStartDate)==null?void 0:ee.getTime)==null?void 0:X.call(ee)),D=r.value||((ne=(ve=o.endDate)==null?void 0:ve.getTime)==null?void 0:ne.call(ve))!==((H=(L=o.cacheEndDate)==null?void 0:L.getTime)==null?void 0:H.call(L)),F=o.startDate===null,k=o.endDate===null;let O,B;P&&D&&F&&k?(O=!0,B=!0,t("clearAll")):P&&!D?(O=!0,F?t("clearStart"):t("update:start",o.startDate)):D&&!P?(B=!0,k?t("clearDue"):t("update:end",o.endDate)):P&&D&&(O=!0,B=!0,t("update",[o.startDate,o.endDate])),!(!O&&!B)&&(O&&!B?t("confirmed",{start:o.startDate}):!O&&B?t("confirmed",{end:o.endDate}):t("confirmed",{start:o.startDate,end:o.endDate}),o.isDirty=P||D)},l=(P,D)=>{const F=bt.fromObject({year:P.year,month:P.month,day:P.day},{zone:o.timezone});return(D==="start"?F.startOf("day"):F.endOf("day")).toJSDate()},u=()=>{o.rangeFeedback.status="idle",o.rangeFeedback.action=null,o.rangeFeedback.message=""},c=P=>{e.enableRangeFeedback&&(o.rangeFeedback.status="corrected",o.rangeFeedback.action=P,o.rangeFeedback.message=P==="swap"?s.swap:s.truncate)},d=P=>{if(!(!o.startDate||!o.endDate)){if(o.startDate.getTime()<=o.endDate.getTime()){e.enableRangeFeedback&&u();return}if(P==="select-start"){const D={start:o.startDate,end:o.endDate};o.endDate=null,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"truncate"}),o.isSelectingEnd=!0,c("truncate")}else{const D={start:o.startDate,end:o.endDate},F=o.startDate;o.startDate=o.endDate,o.endDate=F,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"swap"}),c("swap")}}},h=V(!1),f=V(!1),p=(P,D=!0)=>{i.value=!0,h.value=!1,!(e.disabled||e.readOnly)&&(o.startDate=l(P,"start"),D?(o.isSelectingStart=!1,o.isSelectingEnd=!0):(o.isSelectingStart=!0,o.isSelectingEnd=!1),d("select-start"))},g=P=>{r.value=!0,f.value=!1,!(e.disabled||e.readOnly)&&(o.endDate=l(P,"end"),d("select-end"))},v=()=>{i.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,u())},C=()=>{r.value=!0,!(e.disabled||e.readOnly)&&(o.endDate=null,u())},S=()=>{i.value=!0,r.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,o.endDate=null,u(),w())},b=()=>{e.disabled||e.readOnly||o.isDirty||(o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate)},w=()=>{e.disabled||e.readOnly||(a(),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isDirty=!1)},_=()=>{e.disabled||e.readOnly||(o.startDate=o.cacheStartDate,o.endDate=o.cacheEndDate,u(),o.isDirty=!1)},R=Y(()=>o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat(o.format):e.startPlaceholder),T=Y(()=>o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat(o.format):e.duePlaceholder),I=Y(()=>!o.startDate&&!e.disabled?e.startTooltip:!o.startDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.startTooltip),x=Y(()=>!o.endDate&&!e.disabled?e.dueTooltip:!o.endDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.dueTooltip);return{states:o,displayStartDate:R,displayEndDate:T,tooltipStartDate:I,tooltipEndDate:x,showMultipleDueDates:f,showMultipleStartDates:h,selectEndDate:g,selectStartDate:p,clearDue:C,clearStart:v,clearAll:S,beginInteraction:b,confirmSelection:w,cancelSelection:_}},LF="MMM dd",O7=e=>{const t=e.timezone,n=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:LF}):"No start"),s=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:LF}):"No due"),o=d=>{if(!d)return null;const h=bt.now().setZone(t).startOf("day"),f=bt.fromISO(d).setZone(t).startOf("day");if(!f.isValid)return console.warn("Invalid date:",d,f.invalidReason),null;const p=f.diff(h,"days").days;return p===0?"today":p===1?"tomorrow":p===-1?"yesterday":p<-1?"past":"future"},i=Y(()=>o(e.start)),r=Y(()=>o(e.end)),a=Y(()=>{if(n.value==="No start")return["empty"];const d=[];return i.value&&d.push(`start-${i.value}`),e.isStarted&&d.push("actual"),d}),l=Y(()=>{if(s.value==="No due")return["empty"];const d=[];return r.value&&d.push(`end-${r.value}`),e.isEnded&&d.push("actual"),d}),u=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No start"),c=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No due");return{startDate:n,endDate:s,startClasses:a,endClasses:l,fullStartDate:u,fullEndDate:c}},M7="UserCache",N7="user",L7=()=>{const e=V({}),{getCachedValue:t,setCachedValue:n}=Dh({dbName:M7,storeName:N7}),s=async u=>u?await t(u):null;return{getCachedUser:s,setCachedUser:async u=>{if(!(u!=null&&u.id)){console.warn("Cannot cache user without id:",u);return}await n(u.id,u),e.value[u.id]=!0},getCachedUsers:async u=>{if(!u||u.length===0)return[];const c=u.map(h=>s(h));return(await Promise.all(c)).filter(h=>h!==null)},setCachedUsers:async u=>{if(!u||u.length===0)return;const d=uc(u,"id").filter(h=>h.id&&!e.value[h.id]).map(async h=>{await n(h.id,h),e.value[h.id]=!0});await Promise.all(d)},isUserCached:u=>!!e.value[u],clearCacheTracking:()=>{e.value={}}}},V7={placement:"bottom-start",theme:"light",trigger:"manual",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0,useTrigger:!0,showOverlay:!1,overlayOpacity:.5,closeOnOverlayClick:!0,centered:!1};let jh=0,Oo=null;function B7(e){return Oo||(Oo=document.createElement("div"),Oo.className="popup-overlay",Oo.style.cssText=`
114
114
  position: fixed;
115
115
  top: 0;
116
116
  left: 0;
@@ -143,7 +143,7 @@ This will fail in production.`);r=Zl,r._s.has(e)||(o?Jb(e,t,s,r):VA(e,s,r),K.env
143
143
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[pk]=this[pk]={accessors:{}}).accessors,o=this.prototype;function i(r){const a=cf(r);s[a]||(fX(o,r),s[a]=!0)}return Be.isArray(t)?t.forEach(i):i(t),this}};fo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(fo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),Be.freezeMethods(fo);function pS(e,t){const n=this||uf,s=t||n,o=fo.from(s.headers);let i=s.data;return Be.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function gk(e){return!!(e&&e.__CANCEL__)}function Vc(e,t,n){qt.call(this,e??"canceled",qt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Vc,qt,{__CANCEL__:!0});function mk(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pX(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gX(e,t){e=e||10;const n=new Array(e),s=new Array(e);let o=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=s[i];r||(r=u),n[o]=l,s[o]=u;let d=i,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-r<t)return;const f=c&&u-c;return f?Math.round(h*1e3/f):void 0}}function mX(e,t){let n=0,s=1e3/t,o,i;const r=(u,c=Date.now())=>{n=c,o=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=s?r(u,c):(o=u,i||(i=setTimeout(()=>{i=null,r(o)},s-d)))},()=>o&&r(o)]}const Bm=(e,t,n=3)=>{let s=0;const o=gX(50,250);return mX(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-s,u=o(l),c=r<=a;s=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-r)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},vk=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},yk=e=>(...t)=>Be.asap(()=>e(...t)),vX=Gs.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Gs.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Gs.origin),Gs.navigator&&/(msie|trident)/i.test(Gs.navigator.userAgent)):()=>!0,yX=Gs.hasStandardBrowserEnv?{write(e,t,n,s,o,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(s)&&a.push(`path=${s}`),Be.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),Be.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function wX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function CX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function wk(e,t,n){let s=!wX(t);return e&&(s||n==!1)?CX(e,t):t}const Ck=e=>e instanceof fo?{...e}:e;function nu(e,t){t=t||{};const n={};function s(u,c,d,h){return Be.isPlainObject(u)&&Be.isPlainObject(c)?Be.merge.call({caseless:h},u,c):Be.isPlainObject(c)?Be.merge({},c):Be.isArray(c)?c.slice():c}function o(u,c,d,h){if(Be.isUndefined(c)){if(!Be.isUndefined(u))return s(void 0,u,d,h)}else return s(u,c,d,h)}function i(u,c){if(!Be.isUndefined(c))return s(void 0,c)}function r(u,c){if(Be.isUndefined(c)){if(!Be.isUndefined(u))return s(void 0,u)}else return s(void 0,c)}function a(u,c,d){if(d in t)return s(u,c);if(d in e)return s(void 0,u)}const l={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(u,c,d)=>o(Ck(u),Ck(c),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(c){const d=l[c]||o,h=d(e[c],t[c],c);Be.isUndefined(h)&&d!==a||(n[c]=h)}),n}const bk=e=>{const t=nu({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=fo.from(r),t.url=ck(wk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(Gs.hasStandardBrowserEnv||Gs.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&r.set(c,d)})}}if(Gs.hasStandardBrowserEnv&&(s&&Be.isFunction(s)&&(s=s(t)),s||s!==!1&&vX(t.url))){const l=o&&i&&yX.read(i);l&&r.set(o,l)}return t},bX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const o=bk(e);let i=o.data;const r=fo.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=o,c,d,h,f,p;function g(){f&&f(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function C(){if(!v)return;const b=fo.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:b,config:e,request:v};mk(function(T){n(T),g()},function(T){s(T),g()},_),v=null}"onloadend"in v?v.onloadend=C:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(C)},v.onabort=function(){v&&(s(new qt("Request aborted",qt.ECONNABORTED,e,v)),v=null)},v.onerror=function(w){const _=w&&w.message?w.message:"Network Error",R=new qt(_,qt.ERR_NETWORK,e,v);R.event=w||null,s(R),v=null},v.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||hk;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),s(new qt(w,_.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Be.forEach(r.toJSON(),function(w,_){v.setRequestHeader(_,w)}),Be.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),u&&([h,p]=Bm(u,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=Bm(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(o.cancelToken||o.signal)&&(c=b=>{v&&(s(!b||b.type?new Vc(null,e,v):b),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const S=pX(o.url);if(S&&Gs.protocols.indexOf(S)===-1){s(new qt("Unsupported protocol "+S+":",qt.ERR_BAD_REQUEST,e));return}v.send(i||null)})},SX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,o;const i=function(u){if(!o){o=!0,a();const c=u instanceof Error?u:this.reason;s.abort(c instanceof qt?c:new Vc(c instanceof Error?c.message:c))}};let r=t&&setTimeout(()=>{r=null,i(new qt(`timeout ${t} of ms exceeded`,qt.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>Be.asap(a),l}},EX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,o;for(;s<n;)o=s+t,yield e.slice(s,o),s=o},_X=async function*(e,t){for await(const n of RX(e))yield*EX(n,t)},RX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Sk=(e,t,n,s)=>{const o=_X(e,t);let i=0,r,a=l=>{r||(r=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await o.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},Ek=64*1024,{isFunction:$m}=Be,DX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:_k,TextEncoder:Rk}=Be.global,Dk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},TX=e=>{e=Be.merge.call({skipUndefined:!0},DX,e);const{fetch:t,Request:n,Response:s}=e,o=t?$m(t):typeof fetch=="function",i=$m(n),r=$m(s);if(!o)return!1;const a=o&&$m(_k),l=o&&(typeof Rk=="function"?(p=>g=>p.encode(g))(new Rk):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&a&&Dk(()=>{let p=!1;const g=new n(Gs.origin,{body:new _k,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),c=r&&a&&Dk(()=>Be.isReadableStream(new s("").body)),d={stream:c&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let C=g&&g[p];if(C)return C.call(g);throw new qt(`Response type '${p}' is not supported`,qt.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Be.isBlob(p))return p.size;if(Be.isSpecCompliantForm(p))return(await new n(Gs.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Be.isArrayBufferView(p)||Be.isArrayBuffer(p))return p.byteLength;if(Be.isURLSearchParams(p)&&(p=p+""),Be.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Be.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:C,signal:S,cancelToken:b,timeout:w,onDownloadProgress:_,onUploadProgress:R,responseType:T,headers:I,withCredentials:x="same-origin",fetchOptions:P}=bk(p),D=t||fetch;T=T?(T+"").toLowerCase():"text";let F=SX([S,b&&b.toAbortSignal()],w),k=null;const O=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let B;try{if(R&&u&&v!=="get"&&v!=="head"&&(B=await f(I,C))!==0){let ne=new n(g,{method:"POST",body:C,duplex:"half"}),L;if(Be.isFormData(C)&&(L=ne.headers.get("content-type"))&&I.setContentType(L),ne.body){const[H,te]=vk(B,Bm(yk(R)));C=Sk(ne.body,Ek,H,te)}}Be.isString(x)||(x=x?"include":"omit");const Z=i&&"credentials"in n.prototype,J={...P,signal:F,method:v.toUpperCase(),headers:I.normalize().toJSON(),body:C,duplex:"half",credentials:Z?x:void 0};k=i&&new n(g,J);let ee=await(i?D(k,P):D(g,J));const X=c&&(T==="stream"||T==="response");if(c&&(_||X&&O)){const ne={};["status","statusText","headers"].forEach(he=>{ne[he]=ee[he]});const L=Be.toFiniteNumber(ee.headers.get("content-length")),[H,te]=_&&vk(L,Bm(yk(_),!0))||[];ee=new s(Sk(ee.body,Ek,H,()=>{te&&te(),O&&O()}),ne)}T=T||"text";let ve=await d[Be.findKey(d,T)||"text"](ee,p);return!X&&O&&O(),await new Promise((ne,L)=>{mk(ne,L,{data:ve,headers:fo.from(ee.headers),status:ee.status,statusText:ee.statusText,config:p,request:k})})}catch(Z){throw O&&O(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,p,k),{cause:Z.cause||Z}):qt.from(Z,Z&&Z.code,p,k)}}},IX=new Map,Tk=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:o}=t,i=[s,o,n];let r=i.length,a=r,l,u,c=IX;for(;a--;)l=i[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:TX(t)),c=u;return u};Tk();const gS={http:ZZ,xhr:bX,fetch:{get:Tk}};Be.forEach(gS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ik=e=>`- ${e}`,xX=e=>Be.isFunction(e)||e===null||e===!1;function FX(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let s,o;const i={};for(let r=0;r<n;r++){s=e[r];let a;if(o=s,!xX(s)&&(o=gS[(a=String(s)).toLowerCase()],o===void 0))throw new qt(`Unknown adapter '${a}'`);if(o&&(Be.isFunction(o)||(o=o.get(t))))break;i[a||"#"+r]=o}if(!o){const r=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
144
144
  `+r.map(Ik).join(`
145
145
  `):" "+Ik(r[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const xk={getAdapter:FX,adapters:gS};function mS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Vc(null,e)}function Fk(e){return mS(e),e.headers=fo.from(e.headers),e.data=pS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xk.getAdapter(e.adapter||uf.adapter,e)(e).then(function(s){return mS(e),s.data=pS.call(e,e.transformResponse,s),s.headers=fo.from(s.headers),s},function(s){return gk(s)||(mS(e),s&&s.response&&(s.response.data=pS.call(e,e.transformResponse,s.response),s.response.headers=fo.from(s.response.headers))),Promise.reject(s)})}const Pk="1.13.2",Hm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hm[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ak={};Hm.transitional=function(t,n,s){function o(i,r){return"[Axios v"+Pk+"] Transitional option '"+i+"'"+r+(s?". "+s:"")}return(i,r,a)=>{if(t===!1)throw new qt(o(r," has been removed"+(n?" in "+n:"")),qt.ERR_DEPRECATED);return n&&!Ak[r]&&(Ak[r]=!0,console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,r,a):!0}},Hm.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function PX(e,t,n){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const i=s[o],r=t[i];if(r){const a=e[i],l=a===void 0||r(a,i,e);if(l!==!0)throw new qt("option "+i+" must be "+l,qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qt("Unknown option "+i,qt.ERR_BAD_OPTION)}}const Gm={assertOptions:PX,validators:Hm},ur=Gm.validators;let su=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dk,response:new dk}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
146
- `+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nu(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&Gm.assertOptions(s,{silentJSONParsing:ur.transitional(ur.boolean),forcedJSONParsing:ur.transitional(ur.boolean),clarifyTimeoutError:ur.transitional(ur.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Gm.assertOptions(o,{encode:ur.function,serialize:ur.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gm.assertOptions(n,{baseUrl:ur.spelling("baseURL"),withXsrfToken:ur.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Be.merge(i.common,i[n.method]);i&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=fo.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,h;if(!l){const p=[Fk.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{c=Fk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=nu(this.defaults,t);const n=wk(t.baseURL,t.url,t.allowAbsoluteUrls);return ck(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){su.prototype[t]=function(n,s){return this.request(nu(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(nu(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}su.prototype[t]=n(),su.prototype[t+"Form"]=n(!0)});let AX=class c${constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new Vc(i,r,a),n(s.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=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new c$(function(o){t=o}),cancel:t}}};function kX(e){return function(n){return e.apply(null,n)}}function OX(e){return Be.isObject(e)&&e.isAxiosError===!0}const vS={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vS).forEach(([e,t])=>{vS[t]=e});function kk(e){const t=new su(e),n=YA(su.prototype.request,t);return Be.extend(n,su.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return kk(nu(e,o))},n}const ns=kk(uf);ns.Axios=su,ns.CanceledError=Vc,ns.CancelToken=AX,ns.isCancel=gk,ns.VERSION=Pk,ns.toFormData=Lm,ns.AxiosError=qt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=kX,ns.isAxiosError=OX,ns.mergeConfig=nu,ns.AxiosHeaders=fo,ns.formToJSON=e=>fk(Be.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=xk.getAdapter,ns.HttpStatusCode=vS,ns.default=ns;const{Axios:s0e,AxiosError:o0e,CanceledError:i0e,isCancel:r0e,CancelToken:a0e,VERSION:l0e,all:u0e,Cancel:c0e,isAxiosError:MX,spread:d0e,toFormData:h0e,AxiosHeaders:f0e,HttpStatusCode:p0e,formToJSON:g0e,getAdapter:m0e,mergeConfig:v0e}=ns,NX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},LX=6e4,Ok=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Um=new Map,Mk=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},VX=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Um.has(i)||Um.set(i,{ongoing:0,queue:[]});const r=Um.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Nk=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=Um.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},BX=(()=>{const e=ns.create({timeout:LX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await VX(n);const s=NX("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Nk(t.config.url||""),t),async t=>{var s,o,i;if(((s=t.response)==null?void 0:s.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Nk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class df extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,df.prototype)}}const hf=e=>{var t,n;if(MX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===Mc.UNAUTHORIZED||s===Mc.FORBIDDEN?l="AUTH":s===Mc.UNPROCESSABLE_ENTITY||s===Mc.BAD_REQUEST?l="VALIDATION":s>=Mc.BAD_REQUEST&&(l="CLIENT"),new df(i,s,r,a,l)}return e instanceof Error?new df(e.message,void 0,void 0,void 0,"UNKNOWN"):new df("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class $X{constructor(){this.axios=BX}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(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw hf(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw hf(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw hf(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw hf(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw hf(o)}}}const HX=({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}/workspace/${t}/entities/${n}/metric`,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"}}),GX=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class Lk extends $X{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=HX({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var u,c;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";GX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.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},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}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:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==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=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}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){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}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:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const UX=(e,t,n,s,o,i,r)=>{const{apiServices:a}=ts(n,s),l=V(!1),u=()=>{l.value=!0},c=()=>{Ct(()=>{setTimeout(()=>{l.value=!1},500)})},d=Y(()=>!!(o!=null&&o.value&&(i!=null&&i.value))),h=_n("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;u();try{const C={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?C.clear=1:C.value=g,d.value?(delete C.itemIds,C.entityId=String(s.entityId)):C.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(C));(S==null?void 0:S.message)=="Done"&&t(p)}catch(C){console.error("Error during bulk metric update:",C)}c()}}},WX=_t(rt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=zA(),s=V([]),o=e,i=t,r=V([]),a=V(null),l=J=>{var ve,ne,L;const ee=s.value.findIndex(H=>H.id===J.id);a.value=ee;const X=(ve=r.value[ee])==null?void 0:ve.$el;(ne=_.value)==null||ne.scrollTo(ee*30),X&&X.scrollIntoView({behavior:"smooth",block:"center"}),u(ee),(L=r.value[ee])==null||L.show()},u=J=>{a.value=J,r.value.forEach((ee,X)=>{X!==J&&ee&&ee.hide()})},c=V(""),d=()=>{c.value="",r.value.forEach(J=>{J==null||J.hide()}),a.value=null},h=Y(()=>o.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(o.workspaceId)})),p=_n("isSelectAll",V(!1)),g=_n("bulkUpdate",V(!1)),v=V(null),{handleUpdate:C,isUpdating:S}=UX(f,J=>{var ee;i("update",J),d(),(ee=v.value)==null||ee.hide()},!1,o,g,p),b=async J=>{var ee;i("update-start");try{await C(J),i("update-completed")}catch{i("update-failed"),(ee=v.value)==null||ee.open()}},w=J=>{d(),Ct(()=>{var ee;(ee=_.value)==null||ee.focus()})},_=V(null),R=(J,ee)=>{var X;J?(X=_.value)==null||X.focus():d(),J&&ee!==J&&Z("")},T=V(!0),I=V(!0),{apiServices:x}=ts(!1,o),P=async(J,ee,X)=>{var ve;try{return X?I.value=!0:T.value=!0,await((ve=x.value)==null?void 0:ve.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:J,query:ee,per_page:10}))}catch(ne){throw console.error("Failed to fetch metric list:",ne),ne}finally{T.value=!1,I.value=!1}},D=V(0),F=V(!0),k=J=>({id:String(J.id),label:String(J.name),value:String(J.id),description:J.morpheme_value?`${String(J.morpheme_value)}`:"",type:n.checkEditType(J),metricConfig:J}),O=J=>J.filter(ee=>!ee.formula).filter(ee=>{var X;return((X=ee==null?void 0:ee.auth_permission)==null?void 0:X.permission)==2}).map(k),B=async()=>{D.value+=1;const J=await P(D.value,c.value,!0);if(J&&J.data){const ee=O(J.data);s.value=[...s.value,...ee],F.value=J.meta.last_page!=J.meta.current_page}else F.value=!1},Z=async J=>{c.value=J,D.value=1;try{const ee=await P(D.value,c.value);ee&&ee.data?(s.value=O(ee.data),F.value=ee.meta.last_page!=ee.meta.current_page):s.value=[]}catch{s.value=[]}};return(J,ee)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:v,isUpdating:U(S),disabled:o.disabled||U(S),onOnVisibleChange:R},{trigger:ge(({hide:X,disabled:ve})=>[fe(mt,{variant:o.variant,loading:U(S),disabled:ve,onEscape:X},{default:ge(()=>[fe(lt,{src:"SquareRootVariable",class:"icon"}),ee[1]||(ee[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({isVisible:X,popupRef:ve,hide:ne})=>[Ke(fe(Jr,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:s.value,loading:T.value,"loading-more":I.value,"selected-id":void 0,"has-more":F.value,onSearch:Z,onSelect:l,onLoadMore:ee[0]||(ee[0]=()=>B()),onCancel:ne},{item:ge(({item:L,index:H,selectedIndex:te})=>[fe(dZ,{ref:he=>r.value[H]=he,label:L.label,type:L.type,morpheme:L.description||"",onFocusOnSearch:w,onOpen:he=>u(H),attachTo:ve,config:L.metricConfig,onHandleUpdate:b,class:Q(["metric-update-item",{selected:a.value===H||te===H}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ge(()=>[...ee[2]||(ee[2]=[_e("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ge(()=>[...ee[3]||(ee[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[To,X]])]),default:ge(()=>[ee[4]||(ee[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-f5df50e8"]]),Wm=Ql("bulkUpdate",()=>{const e=V(Vt.UNCHECK),t=Eo({loaded:0,total:0}),n=c=>{t.total=c},s=c=>{t.loaded=c},o=Eo({isBulkUpdating:!1});function i(c){o.isBulkUpdating=c}const r=V({}),a=c=>{r.value=c},l=(c,d)=>{r.value[c]=d},u=c=>{e.value=c};return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:u,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{u(Vt.CHECKED)}}}),zX={class:"status-label"},Vk=_t(rt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{o("select",a)},r=a=>new Nn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(j(),ue("div",{class:Q(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=u=>i(e.status.id))},[_e("div",{class:"status-color",style:dn({backgroundColor:e.status.color,borderColor:r(e.status.color)})},null,4),Ke((j(),ue("div",zX,[Tt(a.$slots,"label",{},()=>[nt(wt(e.status.name),1)],!0)])),[[U(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),jX=["innerHTML"],Bk=_t(rt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const s={PER_PAGE:50,INITIAL_PAGE:1},o=e,i=n,r=V([]),a=V(!1),l=V(!1),u=V(null),c=V(s.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=Y(()=>{var O;return(O=o.value)==null?void 0:O.id}),g=Y(()=>!!(o.id||o.ids&&o.ids.length>0)),v=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),C=Y(()=>{const O=new Set;return o.id&&O.add(String(o.id)),o.ids&&o.ids.forEach(B=>{B&&O.add(String(B))}),Array.from(O)}),S=_n("bulkUpdate",!1),{apiServices:b}=ts(!S,o),w=Wm(),{selectionStatus:_}=Qs(w),R=_n("filterParams",null),T=async(O=s.INITIAL_PAGE,B="",Z=!1)=>{var J,ee,X,ve;if(!g.value){console.error("Missing required props",o);return}Z?l.value=!0:a.value=!0,u.value=null;try{const ne={workspaceId:String(o.workspaceId),itemIds:C.value,page:O,perPage:s.PER_PAGE,name_like:B.trim(),...R||{}};if(((J=b.value)==null?void 0:J.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const L=await((ee=b.value)==null?void 0:ee.getAssignableStatus(ne));if(!(L!=null&&L.data)){Z||(r.value=[]),d.value=!1;return}const H=L.data.map(v);r.value=Z?[...r.value,...H]:H,h.value=((X=L.meta)==null?void 0:X.total)??L.data.length,d.value=!((ve=L.meta)!=null&&ve.on_last_page),c.value=O}catch(ne){console.error("Error fetching statuses:",ne),u.value="Failed to load statuses",Z||(r.value=[]),d.value=!1,i("error",u.value)}finally{a.value=!1,l.value=!1}},I=Di(async O=>{f.value=O,c.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,O,!1)},rr),x=async()=>{!d.value||l.value||await T(c.value+1,f.value,!0)},P=()=>{var O;i("cancel"),(O=o.params)==null||O.api.stopEditing()},D=async O=>{var B,Z,J;if(!g.value){console.error("Missing required props for updating status",o);return}try{const ee={workspaceId:String(o.workspaceId),itemIds:C.value,statusId:String(O.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(_.value==Vt.CHECKED&&S&&(ee.itemIds=void 0,ee.entityId=String(o.entityId)),i("start-update"),!await b.value.updateItemStatus(ee))throw new Error("Status update failed: empty response");const ve={workspaceId:String(o.workspaceId),itemIds:C.value,data:{id:O.id,name:O.label,color:O.color}};i("updated",ve),o.params&&((Z=o.params)==null||Z.node.setData({...(B=o.params)==null?void 0:B.node.data,status:{id:O.id,name:O.label,color:O.color}}),(J=o.params)==null||J.api.stopEditing()),i("finish-update")}catch(ee){console.error("Error updating status:",ee),u.value="Failed to update status",i("error",u.value)}},F=Y(()=>r.value.map(O=>({...O})));tt([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const k=V(null);return nn(()=>{Ct(()=>{var O;(O=k.value)==null||O.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:x,focus:()=>{var O;return(O=k.value)==null?void 0:O.focus()}}),(O,B)=>{var Z;return j(),qe(Jr,Xt({ref_key:"popupRef",ref:k},o,{"selected-id":(Z=o.value)==null?void 0:Z.id,options:F.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:U(I),onSelect:D,onLoadMore:x,onCancel:P,onClose:P}),{item:ge(({item:J,selectedIndex:ee,isSelected:X,handleItemHover:ve,getHighlightedLabel:ne,query:L,idx:H})=>[(j(),qe(Vk,{key:J.value,status:J.data,selected:X(J),onMouseover:te=>ve(H),onSelect:te=>D(J),hovered:H===ee},{label:ge(()=>[L?(j(),ue("span",{key:0,class:Q([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:ne(J.label)},null,10,jX)):(j(),ue("span",{key:1,class:Q(O.$style["item-label"]),style:{flex:"1"}},wt(J.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"}}]]);var ou=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 s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&n&&(o=new Set,s.set(e,o)),o}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 s=this.getListeners(e,n,!1);s&&(s.delete(t),s.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:s}=this,o=a=>{const l=s?()=>s.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},i=this.getListeners(n,t,!1);if(((i==null?void 0:i.size)??0)>0){const a=new Set(i);for(const l of a)i!=null&&i.has(l)&&o(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)o(()=>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 Qr(e){return e==null||e===""?null:e}function dt(e){return e!=null&&e!==""}function Vn(e){return!dt(e)}function yS(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function ff(e,t){const n=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return n===s}function KX(e,t,n=!1){const s=e==null,o=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function i(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!n)return i(e,t);try{return e.localeCompare(t)}catch{return i(e,t)}}var qX=/[&<>"']/g,YX={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bc(e){return(e==null?void 0:e.toString().toString())??null}function pf(e){var t;return((t=Bc(e))==null?void 0:t.replace(qX,n=>YX[n]))??null}function cr(e){return e.eRootDiv.getRootNode()}function Hn(e){return cr(e).activeElement}function Rs(e){const{gos:t,eRootDiv:n}=e;let s=null;const o=t.get("getDocument");return o&&dt(o)?s=o():n&&(s=n.ownerDocument),s&&dt(s)?s:document}function $k(e){const t=Hn(e);return t===null||t===Rs(e).body}function Hk(e){return Rs(e).defaultView||window}function wS(e){let t=null,n=null;try{t=Rs(e).fullscreenElement}catch{}finally{t||(t=cr(e));const s=t.querySelector("body");s?n=s:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function ZX(e){const t=wS(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function XX(e){const t=wS(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function ki(e,t,n){n==null||typeof n=="string"&&n==""?Gk(e,t):oi(e,t,n)}function oi(e,t,n){e.setAttribute(Uk(t),n.toString())}function Gk(e,t){e.removeAttribute(Uk(t))}function Uk(e){return`aria-${e}`}function Ua(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function JX(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function QX(e){return e.getAttribute("aria-label")}function $c(e,t){ki(e,"label",t)}function gf(e,t){ki(e,"labelledby",t)}function Wk(e,t){ki(e,"live",t)}function eJ(e,t){ki(e,"atomic",t)}function tJ(e,t){ki(e,"relevant",t)}function nJ(e,t){ki(e,"invalid",t)}function sJ(e,t){ki(e,"disabled",t)}function zk(e,t){ki(e,"hidden",t)}function CS(e,t){oi(e,"expanded",t)}function oJ(e,t){oi(e,"setsize",t)}function iJ(e,t){oi(e,"posinset",t)}function rJ(e,t){oi(e,"multiselectable",t)}function aJ(e,t){oi(e,"rowcount",t)}function zm(e,t){oi(e,"rowindex",t)}function lJ(e,t){oi(e,"rowspan",t)}function uJ(e,t){oi(e,"colcount",t)}function jk(e,t){oi(e,"colindex",t)}function cJ(e,t){oi(e,"colspan",t)}function dJ(e,t){oi(e,"sort",t)}function hJ(e){Gk(e,"sort")}function Kk(e,t){ki(e,"selected",t)}function fJ(e,t){ki(e,"controls",t)}function pJ(e,t){fJ(e,t.id),gf(t,e.id)}function qk(e,t){ki(e,"owns",t)}function jm(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var gJ="[tabindex], input, select, button, textarea, [href]",Yk="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function mf(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(Yk)?!1:dr(e)}function Bn(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-hidden",!t),s||zk(e,!t)}function mJ(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-invisible",!t),s||zk(e,!t)}function vf(e,t){const n="disabled",s=t?i=>i.setAttribute(n,""):i=>i.removeAttribute(n);s(e);const o=e.querySelectorAll("input")??[];for(const i of o)s(i)}function iu(e,t,n){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++s>n)break}else if(e===n)break}return!1}function ru(e){const{height:t,width:n,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:i,borderLeftWidth:r,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(s||"0"),borderRightWidth:v(o||"0"),borderBottomWidth:v(i||"0"),borderLeftWidth:v(r||"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 bS(e){const t=ru(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function yf(e){const t=ru(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Zk(e){const{height:t,marginBottom:n,marginTop:s}=ru(e);return Math.floor(t+n+s)}function Km(e){const{width:t,marginLeft:n,marginRight:s}=ru(e);return Math.floor(t+n+s)}function Xk(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:i}=ru(e);return{top:t.top+(n||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(i||0)}}function qm(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function Ym(e,t,n){n&&(t*=-1),e.scrollLeft=t}function Ps(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function Oi(e){e!=null&&e.parentNode&&e.remove()}function Jk(e){return!!e.offsetParent}function dr(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!Jk(e)||window.getComputedStyle(e).visibility!=="visible")}function SS(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Qk(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 eO(e,t){for(let n=0;n<t.length;n++){const s=t[n],o=e.children[n];o!==s&&e.insertBefore(s,o)}}function vJ(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function wf(e,t){if(t)for(const n of Object.keys(t)){const s=t[n];if(!(n!=null&&n.length)||s==null)continue;const o=vJ(n),i=s.toString(),r=i.replace(/\s*!important/g,""),a=r.length!=i.length?"important":void 0;e.style.setProperty(o,r,a)}}function Zm(e){return()=>{const t=e();return t?ES(t)||tO(t):!0}}function ES(e){return e.clientWidth<e.scrollWidth}function tO(e){return e.clientHeight<e.scrollHeight}function Xm(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):hr(e,t)}function hr(e,t){t=_S(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Cf(e,t){t=_S(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function _S(e){return typeof e=="number"?`${e}px`:e}function RS(e){return e instanceof Node||e instanceof HTMLElement}function No(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function Wa(e,t,n){const o=Hk(e).ResizeObserver,i=o?new o(n):null;return i==null||i.observe(t),()=>i==null?void 0:i.disconnect()}function ea(e,t){const n=Hk(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var nO="data-ref",DS;function sO(){return DS??(DS=document.createTextNode(" ")),DS.cloneNode()}function bf(e){const{attrs:t,children:n,cls:s,ref:o,role:i,tag:r}=e,a=document.createElement(r);if(s&&(a.className=s),o&&a.setAttribute(nO,o),i&&a.setAttribute("role",i),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(sO()),l=!1),a.append(bf(u)),a.appendChild(sO())))}return a}var yJ=["touchstart","touchend","touchmove","touchcancel","scroll"],wJ=["wheel"],TS={},oO=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof TS[n]=="boolean")return TS[n];const s=document.createElement(e[n]||"div");return n="on"+n,TS[n]=n in s}})();function CJ(e,t){return!t||!e?!1:SJ(t).indexOf(e)>=0}function bJ(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function SJ(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():bJ(t)}function EJ(e,t,n){const s=_J(t);let o;s!=null&&(o={passive:s}),e.addEventListener(t,n,o)}var _J=e=>{const t=yJ.includes(e),n=wJ.includes(e);if(t)return!0;if(n)return!1};function iO(e,t,n){if(n===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=n}var Sf=(e,t)=>{const n=e.identifier;for(let s=0,o=t.length;s<o;++s){const i=t[s];if(i.identifier===n)return i}return null};function Ef(e,t){return e.gos.isElementInThisInstance(t.target)}function RJ(e,t,n){const o=e.getBoundingClientRect().height,i=ZX(n)-2,r=XX(n)-2;if(!e.offsetParent)return;const l=Xk(e.offsetParent),{clientY:u,clientX:c}=t;let d=u-l.top-o/2,h=c-l.left-10;const f=Rs(n),p=f.defaultView||window,g=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;i>0&&h+e.clientWidth>i+v&&(h=i+v-e.clientWidth),h<0&&(h=0),r>0&&d+e.clientHeight>r+g&&(d=r+g-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Jm=(e,...t)=>{for(const n of t){const[s,o,i,r]=n;s.addEventListener(o,i,r),e.push(n)}},IS=e=>{if(e){for(const[t,n,s,o]of e)t.removeEventListener(n,s,o);e.length=0}},za=e=>{e.cancelable&&e.preventDefault()};function DJ(e,t){return t}function rO(e){return(e==null?void 0:e.getLocaleTextFunc())??DJ}function TJ(e,t,n,s){const o=t[n];return e.getLocaleTextFunc()(n,typeof o=="function"?o(s):o,s)}function IJ(e){return(t,n,s)=>e({key:t,defaultValue:n,variableValues:s})}function xJ(e){return(t,n,s)=>{let o=e==null?void 0:e[t];if(o&&(s!=null&&s.length)){let i=0;for(;!(i>=s.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",s[i++])}return o??n}}var fr=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 ou),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var s;(s=this.localEventService)==null||s.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 s of Object.keys(t)){const o=t[s];o&&n.push(this._setupListener(e,s,o))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let s;if(FJ(e))e.__addEventListener(t,n),s=()=>(e.__removeEventListener(t,n),null);else{const o=PJ(e);e instanceof HTMLElement?EJ(e,t,n):o?e.addListener(t,n):e.addEventListener(t,n),s=o?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const s=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),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++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=o.changeSet.id}const i={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(i)};for(const o of e)this.setupPropertyListener(o,s)}getLocaleTextFunc(){return rO(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 FJ(e){return e.__addEventListener!==void 0}function PJ(e){return e.eventServiceType==="global"}var We=class extends fr{},aO={};function xS(e,t){aO[t]||(e(),aO[t]=!0)}var AJ={pending:!1,funcs:[]},kJ={pending:!1,funcs:[]};function FS(e,t="setTimeout",n){const s=t==="raf"?kJ:AJ;if(s.funcs.push(e),s.pending)return;s.pending=!0;const o=()=>{const i=s.funcs.slice();s.funcs.length=0,s.pending=!1;for(const r of i)r()};t==="raf"?ea(n,o):window.setTimeout(o,0)}function As(e,t,n){let s;return function(...o){const i=this;window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(i,o)},n)}}function lO(e,t){let n=0;return function(...s){const o=this,i=Date.now();i-n<t||(n=i,e.apply(o,s))}}function OJ(e,t,n,s=100){const o=Date.now();let i=null,r=!1;const a=()=>{i!=null&&(window.clearInterval(i),i=null)};e.addDestroyFunc(a);const l=()=>{const u=Date.now()-o>s;(t()||u)&&(n(),r=!0,a())};l(),r||(i=window.setInterval(l,10))}var uO=new Set(["__proto__","constructor","prototype"]);function MJ(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(s=>!uO.has(s)))t(n,e[n])}}function eo(e,t,n=!0,s=!1){dt(t)&&MJ(t,(o,i)=>{let r=e[o];r!==i&&(s&&r==null&&i!=null&&typeof i=="object"&&i.constructor===Object&&(r={},e[o]=r),cO(i)&&cO(r)&&!Array.isArray(r)?eo(r,i,n,s):(n||i!==void 0)&&(e[o]=i))})}function cO(e){return typeof e=="object"&&e!==null}var PS=class ba{static applyGlobalGridOptions(t){if(!ba.gridOptions)return{...t};let n={};return eo(n,ba.gridOptions,!0,!0),ba.mergeStrategy==="deep"?eo(n,t,!0,!0):n={...n,...t},ba.gridOptions.context&&(n.context=ba.gridOptions.context),t.context&&(ba.mergeStrategy==="deep"&&n.context&&eo(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(ba.mergeStrategy==="deep"){const s=NJ(t);if(s&&typeof s=="object"&&typeof n=="object")return ba.applyGlobalGridOptions({[t]:n})[t]}return n}};PS.gridOptions=void 0,PS.mergeStrategy="shallow";var AS=PS;function NJ(e){var t;return(t=AS.gridOptions)==null?void 0:t[e]}var LJ={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},dO="https://www.ag-grid.com";function ja(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function _f(e,...t){xS(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function Hc(e,...t){xS(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var hO=new Set,Qm={},Gc={},ev,fO=!1,pO=!1,VJ=!1;function BJ(e){const[t,n]=e.version.split(".")||[],[s,o]=ev.split(".")||[];return t===s&&n===o}function $J(e){var s;ev||(ev=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?BJ(e)||Hc(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ev}.`)):Hc(t(`'${e.moduleName}' is incompatible.`));const n=(s=e.validate)==null?void 0:s.call(e);n&&!n.isValid&&Hc(`${n.message}`)}function Rf(e,t,n=!1){n||(fO=!0),$J(e);const s=e.rowModels??["all"];hO.add(e);let o;t!==void 0?(pO=!0,Gc[t]===void 0&&(Gc[t]={}),o=Gc[t]):o=Qm;for(const i of s)o[i]===void 0&&(o[i]={}),o[i][e.moduleName]=e;if(e.dependsOn)for(const i of e.dependsOn)Rf(i,t,n)}function HJ(e){delete Gc[e]}function kS(e,t,n){const s=o=>{var i,r,a;return!!((i=Qm[o])!=null&&i[e])||!!((a=(r=Gc[t])==null?void 0:r[o])!=null&&a[e])};return s(n)||s("all")}function OS(){return pO}function GJ(e,t){const n=Gc[e]??{};return[...Object.values(Qm.all??{}),...Object.values(n.all??{}),...Object.values(Qm[t]??{}),...Object.values(n[t]??{})]}function UJ(){return new Set(hO)}function WJ(){return fO}function zJ(){return VJ}var jJ=class{static register(e){Rf(e,void 0)}static registerModules(e){for(const t of e)Rf(t,void 0)}},ut="34.3.1",gO=2e3,mO=100,vO="_version_",tv=null,Uc=`${dO}/javascript-data-grid`;function KJ(e){tv=e}function qJ(e){Uc=e}function yO(e,t,n){return(tv==null?void 0:tv(e,t))??[JJ(e,t,n)]}function MS(e,t,n,s,o){e(`${s?"warning":"error"} #${t}`,...yO(t,n,o))}function YJ(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 ZJ(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=YJ(e)),t}function nv(e){return e===void 0?"undefined":e===null?"null":e}function NS(e,t){return`${e}?${t.toString()}`}function XJ(e,t,n){const s=Array.from(t.entries()).sort((i,r)=>r[1].length-i[1].length);let o=NS(e,t);for(const[i,r]of s){if(i===vO)continue;const a=o.length-n;if(a<=0)break;const l="...",u=a+l.length,c=r.length-u>mO?r.slice(0,r.length-u)+l:r.slice(0,mO)+l;t.set(i,c),o=NS(e,t)}return o}function wO(e,t){const n=new URLSearchParams;if(n.append(vO,ut),t)for(const i of Object.keys(t))n.append(i,ZJ(t[i]));const s=`${Uc}/errors/${e}`,o=NS(s,n);return o.length<=gO?o:XJ(s,n,gO)}var JJ=(e,t,n)=>{const s=wO(e,t);return`${`${n?n+`
146
+ `+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nu(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&Gm.assertOptions(s,{silentJSONParsing:ur.transitional(ur.boolean),forcedJSONParsing:ur.transitional(ur.boolean),clarifyTimeoutError:ur.transitional(ur.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Gm.assertOptions(o,{encode:ur.function,serialize:ur.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gm.assertOptions(n,{baseUrl:ur.spelling("baseURL"),withXsrfToken:ur.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Be.merge(i.common,i[n.method]);i&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=fo.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,h;if(!l){const p=[Fk.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{c=Fk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=nu(this.defaults,t);const n=wk(t.baseURL,t.url,t.allowAbsoluteUrls);return ck(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){su.prototype[t]=function(n,s){return this.request(nu(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(nu(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}su.prototype[t]=n(),su.prototype[t+"Form"]=n(!0)});let AX=class c${constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new Vc(i,r,a),n(s.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=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new c$(function(o){t=o}),cancel:t}}};function kX(e){return function(n){return e.apply(null,n)}}function OX(e){return Be.isObject(e)&&e.isAxiosError===!0}const vS={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vS).forEach(([e,t])=>{vS[t]=e});function kk(e){const t=new su(e),n=YA(su.prototype.request,t);return Be.extend(n,su.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return kk(nu(e,o))},n}const ns=kk(uf);ns.Axios=su,ns.CanceledError=Vc,ns.CancelToken=AX,ns.isCancel=gk,ns.VERSION=Pk,ns.toFormData=Lm,ns.AxiosError=qt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=kX,ns.isAxiosError=OX,ns.mergeConfig=nu,ns.AxiosHeaders=fo,ns.formToJSON=e=>fk(Be.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=xk.getAdapter,ns.HttpStatusCode=vS,ns.default=ns;const{Axios:s0e,AxiosError:o0e,CanceledError:i0e,isCancel:r0e,CancelToken:a0e,VERSION:l0e,all:u0e,Cancel:c0e,isAxiosError:MX,spread:d0e,toFormData:h0e,AxiosHeaders:f0e,HttpStatusCode:p0e,formToJSON:g0e,getAdapter:m0e,mergeConfig:v0e}=ns,NX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},LX=6e4,Ok=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Um=new Map,Mk=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},VX=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Um.has(i)||Um.set(i,{ongoing:0,queue:[]});const r=Um.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Nk=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=Um.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},BX=(()=>{const e=ns.create({timeout:LX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await VX(n);const s=NX("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Nk(t.config.url||""),t),async t=>{var s,o,i;if(((s=t.response)==null?void 0:s.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Nk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class df extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,df.prototype)}}const hf=e=>{var t,n;if(MX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===Mc.UNAUTHORIZED||s===Mc.FORBIDDEN?l="AUTH":s===Mc.UNPROCESSABLE_ENTITY||s===Mc.BAD_REQUEST?l="VALIDATION":s>=Mc.BAD_REQUEST&&(l="CLIENT"),new df(i,s,r,a,l)}return e instanceof Error?new df(e.message,void 0,void 0,void 0,"UNKNOWN"):new df("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class $X{constructor(){this.axios=BX}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(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw hf(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw hf(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw hf(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw hf(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw hf(o)}}}const HX=({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}/workspace/${t}/entities/${n}/metric`,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"}}),GX=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class Lk extends $X{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=HX({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var u,c;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";GX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.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},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}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:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==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=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}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){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}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:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const UX=(e,t,n,s,o,i,r)=>{const{apiServices:a}=ts(n,s),l=V(!1),u=()=>{l.value=!0},c=()=>{Ct(()=>{setTimeout(()=>{l.value=!1},500)})},d=Y(()=>!!(o!=null&&o.value&&(i!=null&&i.value))),h=_n("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;u();try{const C={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?C.clear=1:C.value=g,d.value?(delete C.itemIds,C.entityId=String(s.entityId)):C.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(C));(S==null?void 0:S.message)=="Done"&&t(p)}catch(C){console.error("Error during bulk metric update:",C)}c()}}},WX=_t(rt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=zA(),s=V([]),o=e,i=t,r=V([]),a=V(null),l=J=>{var ve,ne,L;const ee=s.value.findIndex(H=>H.id===J.id);a.value=ee;const X=(ve=r.value[ee])==null?void 0:ve.$el;(ne=_.value)==null||ne.scrollTo(ee*30),X&&X.scrollIntoView({behavior:"smooth",block:"center"}),u(ee),(L=r.value[ee])==null||L.show()},u=J=>{a.value=J,r.value.forEach((ee,X)=>{X!==J&&ee&&ee.hide()})},c=V(""),d=()=>{c.value="",r.value.forEach(J=>{J==null||J.hide()}),a.value=null},h=Y(()=>o.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(o.workspaceId)})),p=_n("isSelectAll",V(!1)),g=_n("bulkUpdate",V(!1)),v=V(null),{handleUpdate:C,isUpdating:S}=UX(f,J=>{var ee;i("update",J),d(),(ee=v.value)==null||ee.hide()},!1,o,g,p),b=async J=>{var ee;i("update-start");try{await C(J),i("update-completed")}catch{i("update-failed"),(ee=v.value)==null||ee.open()}},w=J=>{d(),Ct(()=>{var ee;(ee=_.value)==null||ee.focus()})},_=V(null),R=(J,ee)=>{var X;J?(X=_.value)==null||X.focus():d(),J&&ee!==J&&Z("")},T=V(!0),I=V(!0),{apiServices:x}=ts(!1,o),P=async(J,ee,X)=>{var ve;try{return X?I.value=!0:T.value=!0,await((ve=x.value)==null?void 0:ve.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:J,query:ee,per_page:10}))}catch(ne){throw console.error("Failed to fetch metric list:",ne),ne}finally{T.value=!1,I.value=!1}},D=V(0),F=V(!0),k=J=>({id:String(J.id),label:String(J.name),value:String(J.id),description:J.morpheme_value?`${String(J.morpheme_value)}`:"",type:n.checkEditType(J),metricConfig:J}),O=J=>J.filter(ee=>!ee.formula).filter(ee=>{var X;return((X=ee==null?void 0:ee.auth_permission)==null?void 0:X.permission)==2}).map(k),B=async()=>{D.value+=1;const J=await P(D.value,c.value,!0);if(J&&J.data){const ee=O(J.data);s.value=[...s.value,...ee],F.value=J.meta.last_page!=J.meta.current_page}else F.value=!1},Z=async J=>{c.value=J,D.value=1;try{const ee=await P(D.value,c.value);ee&&ee.data?(s.value=O(ee.data),F.value=ee.meta.last_page!=ee.meta.current_page):s.value=[]}catch{s.value=[]}};return(J,ee)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:v,isUpdating:U(S),disabled:o.disabled||U(S),onOnVisibleChange:R},{trigger:ge(({hide:X,disabled:ve})=>[fe(mt,{variant:o.variant,loading:U(S),disabled:ve,onEscape:X},{default:ge(()=>[fe(lt,{src:"SquareRootVariable",class:"icon"}),ee[1]||(ee[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({isVisible:X,popupRef:ve,hide:ne})=>[Ke(fe(Jr,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:s.value,loading:T.value,"loading-more":I.value,"selected-id":void 0,"has-more":F.value,onSearch:Z,onSelect:l,onLoadMore:ee[0]||(ee[0]=()=>B()),onCancel:ne},{item:ge(({item:L,index:H,selectedIndex:te})=>[fe(dZ,{ref:he=>r.value[H]=he,label:L.label,type:L.type,morpheme:L.description||"",onFocusOnSearch:w,onOpen:he=>u(H),attachTo:ve,config:L.metricConfig,onHandleUpdate:b,class:Q(["metric-update-item",{selected:a.value===H||te===H}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ge(()=>[...ee[2]||(ee[2]=[_e("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ge(()=>[...ee[3]||(ee[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[To,X]])]),default:ge(()=>[ee[4]||(ee[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-f5df50e8"]]),Wm=Ql("bulkUpdate",()=>{const e=V(Lt.UNCHECK),t=Eo({loaded:0,total:0}),n=c=>{t.total=c},s=c=>{t.loaded=c},o=Eo({isBulkUpdating:!1});function i(c){o.isBulkUpdating=c}const r=V({}),a=c=>{r.value=c},l=(c,d)=>{r.value[c]=d},u=c=>{e.value=c};return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:u,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{u(Lt.CHECKED)}}}),zX={class:"status-label"},Vk=_t(rt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{o("select",a)},r=a=>new Nn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(j(),ue("div",{class:Q(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=u=>i(e.status.id))},[_e("div",{class:"status-color",style:dn({backgroundColor:e.status.color,borderColor:r(e.status.color)})},null,4),Ke((j(),ue("div",zX,[Tt(a.$slots,"label",{},()=>[nt(wt(e.status.name),1)],!0)])),[[U(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),jX=["innerHTML"],Bk=_t(rt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const s={PER_PAGE:50,INITIAL_PAGE:1},o=e,i=n,r=V([]),a=V(!1),l=V(!1),u=V(null),c=V(s.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=Y(()=>{var O;return(O=o.value)==null?void 0:O.id}),g=Y(()=>!!(o.id||o.ids&&o.ids.length>0)),v=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),C=Y(()=>{const O=new Set;return o.id&&O.add(String(o.id)),o.ids&&o.ids.forEach(B=>{B&&O.add(String(B))}),Array.from(O)}),S=_n("bulkUpdate",!1),{apiServices:b}=ts(!S,o),w=Wm(),{selectionStatus:_}=Qs(w),R=_n("filterParams",null),T=async(O=s.INITIAL_PAGE,B="",Z=!1)=>{var J,ee,X,ve;if(!g.value){console.error("Missing required props",o);return}Z?l.value=!0:a.value=!0,u.value=null;try{const ne={workspaceId:String(o.workspaceId),itemIds:C.value,page:O,perPage:s.PER_PAGE,name_like:B.trim(),...R||{}};if(((J=b.value)==null?void 0:J.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const L=await((ee=b.value)==null?void 0:ee.getAssignableStatus(ne));if(!(L!=null&&L.data)){Z||(r.value=[]),d.value=!1;return}const H=L.data.map(v);r.value=Z?[...r.value,...H]:H,h.value=((X=L.meta)==null?void 0:X.total)??L.data.length,d.value=!((ve=L.meta)!=null&&ve.on_last_page),c.value=O}catch(ne){console.error("Error fetching statuses:",ne),u.value="Failed to load statuses",Z||(r.value=[]),d.value=!1,i("error",u.value)}finally{a.value=!1,l.value=!1}},I=Di(async O=>{f.value=O,c.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,O,!1)},rr),x=async()=>{!d.value||l.value||await T(c.value+1,f.value,!0)},P=()=>{var O;i("cancel"),(O=o.params)==null||O.api.stopEditing()},D=async O=>{var B,Z,J;if(!g.value){console.error("Missing required props for updating status",o);return}try{const ee={workspaceId:String(o.workspaceId),itemIds:C.value,statusId:String(O.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(_.value==Lt.CHECKED&&S&&(ee.itemIds=void 0,ee.entityId=String(o.entityId)),i("start-update"),!await b.value.updateItemStatus(ee))throw new Error("Status update failed: empty response");const ve={workspaceId:String(o.workspaceId),itemIds:C.value,data:{id:O.id,name:O.label,color:O.color}};i("updated",ve),o.params&&((Z=o.params)==null||Z.node.setData({...(B=o.params)==null?void 0:B.node.data,status:{id:O.id,name:O.label,color:O.color}}),(J=o.params)==null||J.api.stopEditing()),i("finish-update")}catch(ee){console.error("Error updating status:",ee),u.value="Failed to update status",i("error",u.value)}},F=Y(()=>r.value.map(O=>({...O})));tt([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const k=V(null);return nn(()=>{Ct(()=>{var O;(O=k.value)==null||O.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:x,focus:()=>{var O;return(O=k.value)==null?void 0:O.focus()}}),(O,B)=>{var Z;return j(),qe(Jr,Xt({ref_key:"popupRef",ref:k},o,{"selected-id":(Z=o.value)==null?void 0:Z.id,options:F.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:U(I),onSelect:D,onLoadMore:x,onCancel:P,onClose:P}),{item:ge(({item:J,selectedIndex:ee,isSelected:X,handleItemHover:ve,getHighlightedLabel:ne,query:L,idx:H})=>[(j(),qe(Vk,{key:J.value,status:J.data,selected:X(J),onMouseover:te=>ve(H),onSelect:te=>D(J),hovered:H===ee},{label:ge(()=>[L?(j(),ue("span",{key:0,class:Q([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:ne(J.label)},null,10,jX)):(j(),ue("span",{key:1,class:Q(O.$style["item-label"]),style:{flex:"1"}},wt(J.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"}}]]);var ou=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 s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&n&&(o=new Set,s.set(e,o)),o}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 s=this.getListeners(e,n,!1);s&&(s.delete(t),s.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:s}=this,o=a=>{const l=s?()=>s.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},i=this.getListeners(n,t,!1);if(((i==null?void 0:i.size)??0)>0){const a=new Set(i);for(const l of a)i!=null&&i.has(l)&&o(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)o(()=>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 Qr(e){return e==null||e===""?null:e}function dt(e){return e!=null&&e!==""}function Vn(e){return!dt(e)}function yS(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function ff(e,t){const n=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return n===s}function KX(e,t,n=!1){const s=e==null,o=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function i(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!n)return i(e,t);try{return e.localeCompare(t)}catch{return i(e,t)}}var qX=/[&<>"']/g,YX={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bc(e){return(e==null?void 0:e.toString().toString())??null}function pf(e){var t;return((t=Bc(e))==null?void 0:t.replace(qX,n=>YX[n]))??null}function cr(e){return e.eRootDiv.getRootNode()}function Hn(e){return cr(e).activeElement}function Rs(e){const{gos:t,eRootDiv:n}=e;let s=null;const o=t.get("getDocument");return o&&dt(o)?s=o():n&&(s=n.ownerDocument),s&&dt(s)?s:document}function $k(e){const t=Hn(e);return t===null||t===Rs(e).body}function Hk(e){return Rs(e).defaultView||window}function wS(e){let t=null,n=null;try{t=Rs(e).fullscreenElement}catch{}finally{t||(t=cr(e));const s=t.querySelector("body");s?n=s:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function ZX(e){const t=wS(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function XX(e){const t=wS(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function ki(e,t,n){n==null||typeof n=="string"&&n==""?Gk(e,t):oi(e,t,n)}function oi(e,t,n){e.setAttribute(Uk(t),n.toString())}function Gk(e,t){e.removeAttribute(Uk(t))}function Uk(e){return`aria-${e}`}function Ua(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function JX(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function QX(e){return e.getAttribute("aria-label")}function $c(e,t){ki(e,"label",t)}function gf(e,t){ki(e,"labelledby",t)}function Wk(e,t){ki(e,"live",t)}function eJ(e,t){ki(e,"atomic",t)}function tJ(e,t){ki(e,"relevant",t)}function nJ(e,t){ki(e,"invalid",t)}function sJ(e,t){ki(e,"disabled",t)}function zk(e,t){ki(e,"hidden",t)}function CS(e,t){oi(e,"expanded",t)}function oJ(e,t){oi(e,"setsize",t)}function iJ(e,t){oi(e,"posinset",t)}function rJ(e,t){oi(e,"multiselectable",t)}function aJ(e,t){oi(e,"rowcount",t)}function zm(e,t){oi(e,"rowindex",t)}function lJ(e,t){oi(e,"rowspan",t)}function uJ(e,t){oi(e,"colcount",t)}function jk(e,t){oi(e,"colindex",t)}function cJ(e,t){oi(e,"colspan",t)}function dJ(e,t){oi(e,"sort",t)}function hJ(e){Gk(e,"sort")}function Kk(e,t){ki(e,"selected",t)}function fJ(e,t){ki(e,"controls",t)}function pJ(e,t){fJ(e,t.id),gf(t,e.id)}function qk(e,t){ki(e,"owns",t)}function jm(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var gJ="[tabindex], input, select, button, textarea, [href]",Yk="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function mf(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(Yk)?!1:dr(e)}function Bn(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-hidden",!t),s||zk(e,!t)}function mJ(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-invisible",!t),s||zk(e,!t)}function vf(e,t){const n="disabled",s=t?i=>i.setAttribute(n,""):i=>i.removeAttribute(n);s(e);const o=e.querySelectorAll("input")??[];for(const i of o)s(i)}function iu(e,t,n){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++s>n)break}else if(e===n)break}return!1}function ru(e){const{height:t,width:n,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:i,borderLeftWidth:r,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(s||"0"),borderRightWidth:v(o||"0"),borderBottomWidth:v(i||"0"),borderLeftWidth:v(r||"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 bS(e){const t=ru(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function yf(e){const t=ru(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Zk(e){const{height:t,marginBottom:n,marginTop:s}=ru(e);return Math.floor(t+n+s)}function Km(e){const{width:t,marginLeft:n,marginRight:s}=ru(e);return Math.floor(t+n+s)}function Xk(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:i}=ru(e);return{top:t.top+(n||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(i||0)}}function qm(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function Ym(e,t,n){n&&(t*=-1),e.scrollLeft=t}function Ps(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function Oi(e){e!=null&&e.parentNode&&e.remove()}function Jk(e){return!!e.offsetParent}function dr(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!Jk(e)||window.getComputedStyle(e).visibility!=="visible")}function SS(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Qk(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 eO(e,t){for(let n=0;n<t.length;n++){const s=t[n],o=e.children[n];o!==s&&e.insertBefore(s,o)}}function vJ(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function wf(e,t){if(t)for(const n of Object.keys(t)){const s=t[n];if(!(n!=null&&n.length)||s==null)continue;const o=vJ(n),i=s.toString(),r=i.replace(/\s*!important/g,""),a=r.length!=i.length?"important":void 0;e.style.setProperty(o,r,a)}}function Zm(e){return()=>{const t=e();return t?ES(t)||tO(t):!0}}function ES(e){return e.clientWidth<e.scrollWidth}function tO(e){return e.clientHeight<e.scrollHeight}function Xm(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):hr(e,t)}function hr(e,t){t=_S(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Cf(e,t){t=_S(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function _S(e){return typeof e=="number"?`${e}px`:e}function RS(e){return e instanceof Node||e instanceof HTMLElement}function No(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function Wa(e,t,n){const o=Hk(e).ResizeObserver,i=o?new o(n):null;return i==null||i.observe(t),()=>i==null?void 0:i.disconnect()}function ea(e,t){const n=Hk(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var nO="data-ref",DS;function sO(){return DS??(DS=document.createTextNode(" ")),DS.cloneNode()}function bf(e){const{attrs:t,children:n,cls:s,ref:o,role:i,tag:r}=e,a=document.createElement(r);if(s&&(a.className=s),o&&a.setAttribute(nO,o),i&&a.setAttribute("role",i),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(sO()),l=!1),a.append(bf(u)),a.appendChild(sO())))}return a}var yJ=["touchstart","touchend","touchmove","touchcancel","scroll"],wJ=["wheel"],TS={},oO=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof TS[n]=="boolean")return TS[n];const s=document.createElement(e[n]||"div");return n="on"+n,TS[n]=n in s}})();function CJ(e,t){return!t||!e?!1:SJ(t).indexOf(e)>=0}function bJ(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function SJ(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():bJ(t)}function EJ(e,t,n){const s=_J(t);let o;s!=null&&(o={passive:s}),e.addEventListener(t,n,o)}var _J=e=>{const t=yJ.includes(e),n=wJ.includes(e);if(t)return!0;if(n)return!1};function iO(e,t,n){if(n===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=n}var Sf=(e,t)=>{const n=e.identifier;for(let s=0,o=t.length;s<o;++s){const i=t[s];if(i.identifier===n)return i}return null};function Ef(e,t){return e.gos.isElementInThisInstance(t.target)}function RJ(e,t,n){const o=e.getBoundingClientRect().height,i=ZX(n)-2,r=XX(n)-2;if(!e.offsetParent)return;const l=Xk(e.offsetParent),{clientY:u,clientX:c}=t;let d=u-l.top-o/2,h=c-l.left-10;const f=Rs(n),p=f.defaultView||window,g=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;i>0&&h+e.clientWidth>i+v&&(h=i+v-e.clientWidth),h<0&&(h=0),r>0&&d+e.clientHeight>r+g&&(d=r+g-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Jm=(e,...t)=>{for(const n of t){const[s,o,i,r]=n;s.addEventListener(o,i,r),e.push(n)}},IS=e=>{if(e){for(const[t,n,s,o]of e)t.removeEventListener(n,s,o);e.length=0}},za=e=>{e.cancelable&&e.preventDefault()};function DJ(e,t){return t}function rO(e){return(e==null?void 0:e.getLocaleTextFunc())??DJ}function TJ(e,t,n,s){const o=t[n];return e.getLocaleTextFunc()(n,typeof o=="function"?o(s):o,s)}function IJ(e){return(t,n,s)=>e({key:t,defaultValue:n,variableValues:s})}function xJ(e){return(t,n,s)=>{let o=e==null?void 0:e[t];if(o&&(s!=null&&s.length)){let i=0;for(;!(i>=s.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",s[i++])}return o??n}}var fr=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 ou),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var s;(s=this.localEventService)==null||s.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 s of Object.keys(t)){const o=t[s];o&&n.push(this._setupListener(e,s,o))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let s;if(FJ(e))e.__addEventListener(t,n),s=()=>(e.__removeEventListener(t,n),null);else{const o=PJ(e);e instanceof HTMLElement?EJ(e,t,n):o?e.addListener(t,n):e.addEventListener(t,n),s=o?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const s=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),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++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=o.changeSet.id}const i={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(i)};for(const o of e)this.setupPropertyListener(o,s)}getLocaleTextFunc(){return rO(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 FJ(e){return e.__addEventListener!==void 0}function PJ(e){return e.eventServiceType==="global"}var We=class extends fr{},aO={};function xS(e,t){aO[t]||(e(),aO[t]=!0)}var AJ={pending:!1,funcs:[]},kJ={pending:!1,funcs:[]};function FS(e,t="setTimeout",n){const s=t==="raf"?kJ:AJ;if(s.funcs.push(e),s.pending)return;s.pending=!0;const o=()=>{const i=s.funcs.slice();s.funcs.length=0,s.pending=!1;for(const r of i)r()};t==="raf"?ea(n,o):window.setTimeout(o,0)}function As(e,t,n){let s;return function(...o){const i=this;window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(i,o)},n)}}function lO(e,t){let n=0;return function(...s){const o=this,i=Date.now();i-n<t||(n=i,e.apply(o,s))}}function OJ(e,t,n,s=100){const o=Date.now();let i=null,r=!1;const a=()=>{i!=null&&(window.clearInterval(i),i=null)};e.addDestroyFunc(a);const l=()=>{const u=Date.now()-o>s;(t()||u)&&(n(),r=!0,a())};l(),r||(i=window.setInterval(l,10))}var uO=new Set(["__proto__","constructor","prototype"]);function MJ(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(s=>!uO.has(s)))t(n,e[n])}}function eo(e,t,n=!0,s=!1){dt(t)&&MJ(t,(o,i)=>{let r=e[o];r!==i&&(s&&r==null&&i!=null&&typeof i=="object"&&i.constructor===Object&&(r={},e[o]=r),cO(i)&&cO(r)&&!Array.isArray(r)?eo(r,i,n,s):(n||i!==void 0)&&(e[o]=i))})}function cO(e){return typeof e=="object"&&e!==null}var PS=class ba{static applyGlobalGridOptions(t){if(!ba.gridOptions)return{...t};let n={};return eo(n,ba.gridOptions,!0,!0),ba.mergeStrategy==="deep"?eo(n,t,!0,!0):n={...n,...t},ba.gridOptions.context&&(n.context=ba.gridOptions.context),t.context&&(ba.mergeStrategy==="deep"&&n.context&&eo(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(ba.mergeStrategy==="deep"){const s=NJ(t);if(s&&typeof s=="object"&&typeof n=="object")return ba.applyGlobalGridOptions({[t]:n})[t]}return n}};PS.gridOptions=void 0,PS.mergeStrategy="shallow";var AS=PS;function NJ(e){var t;return(t=AS.gridOptions)==null?void 0:t[e]}var LJ={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},dO="https://www.ag-grid.com";function ja(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function _f(e,...t){xS(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function Hc(e,...t){xS(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var hO=new Set,Qm={},Gc={},ev,fO=!1,pO=!1,VJ=!1;function BJ(e){const[t,n]=e.version.split(".")||[],[s,o]=ev.split(".")||[];return t===s&&n===o}function $J(e){var s;ev||(ev=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?BJ(e)||Hc(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ev}.`)):Hc(t(`'${e.moduleName}' is incompatible.`));const n=(s=e.validate)==null?void 0:s.call(e);n&&!n.isValid&&Hc(`${n.message}`)}function Rf(e,t,n=!1){n||(fO=!0),$J(e);const s=e.rowModels??["all"];hO.add(e);let o;t!==void 0?(pO=!0,Gc[t]===void 0&&(Gc[t]={}),o=Gc[t]):o=Qm;for(const i of s)o[i]===void 0&&(o[i]={}),o[i][e.moduleName]=e;if(e.dependsOn)for(const i of e.dependsOn)Rf(i,t,n)}function HJ(e){delete Gc[e]}function kS(e,t,n){const s=o=>{var i,r,a;return!!((i=Qm[o])!=null&&i[e])||!!((a=(r=Gc[t])==null?void 0:r[o])!=null&&a[e])};return s(n)||s("all")}function OS(){return pO}function GJ(e,t){const n=Gc[e]??{};return[...Object.values(Qm.all??{}),...Object.values(n.all??{}),...Object.values(Qm[t]??{}),...Object.values(n[t]??{})]}function UJ(){return new Set(hO)}function WJ(){return fO}function zJ(){return VJ}var jJ=class{static register(e){Rf(e,void 0)}static registerModules(e){for(const t of e)Rf(t,void 0)}},ut="34.3.1",gO=2e3,mO=100,vO="_version_",tv=null,Uc=`${dO}/javascript-data-grid`;function KJ(e){tv=e}function qJ(e){Uc=e}function yO(e,t,n){return(tv==null?void 0:tv(e,t))??[JJ(e,t,n)]}function MS(e,t,n,s,o){e(`${s?"warning":"error"} #${t}`,...yO(t,n,o))}function YJ(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 ZJ(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=YJ(e)),t}function nv(e){return e===void 0?"undefined":e===null?"null":e}function NS(e,t){return`${e}?${t.toString()}`}function XJ(e,t,n){const s=Array.from(t.entries()).sort((i,r)=>r[1].length-i[1].length);let o=NS(e,t);for(const[i,r]of s){if(i===vO)continue;const a=o.length-n;if(a<=0)break;const l="...",u=a+l.length,c=r.length-u>mO?r.slice(0,r.length-u)+l:r.slice(0,mO)+l;t.set(i,c),o=NS(e,t)}return o}function wO(e,t){const n=new URLSearchParams;if(n.append(vO,ut),t)for(const i of Object.keys(t))n.append(i,ZJ(t[i]));const s=`${Uc}/errors/${e}`,o=NS(s,n);return o.length<=gO?o:XJ(s,n,gO)}var JJ=(e,t,n)=>{const s=wO(e,t);return`${`${n?n+`
147
147
  `:""}Visit ${s}`}${n?"":`
148
148
  Alternatively register the ValidationModule to see the full message in the console.`}`};function Xe(...e){MS(_f,e[0],e[1],!0)}function Sn(...e){MS(Hc,e[0],e[1],!1)}function Df(e,t,n){MS(Hc,e,t,!1,n)}function QJ(e,t){const n=t[0];return`error #${n} `+yO(n,t[1],e).join(" ")}function pr(...e){return QJ(void 0,e)}function CO(e,t){return e.get("rowModelType")===t}function ss(e,t){return CO(e,"clientSide")}function Wc(e,t){return CO(e,"serverSide")}function ks(e,t){return e.get("domLayout")===t}function au(e){return iv(e)!==void 0}function bO(e){return typeof e.get("getRowHeight")=="function"}function eQ(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Ka(e,t,n=!1,s){const{gos:o,environment:i}=e;if(s==null&&(s=i.getDefaultRowHeight()),bO(o)){if(n)return{height:s,estimated:!0};const l={node:t,data:t.data},u=o.getCallback("getRowHeight")(l);if(LS(u))return u===0&&Xe(23),{height:Math.max(1,u),estimated:!1}}if(t.detail&&o.get("masterDetail"))return tQ(o);const r=o.get("rowHeight");return{height:r&&LS(r)?r:s,estimated:!1}}function tQ(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return LS(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function lu(e){const{environment:t,gos:n}=e,s=n.get("rowHeight");if(!s||Vn(s))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(Xe(24),t.getDefaultRowHeight())}function LS(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function SO(e,t,n){const s=t[e.getDomDataKey()];return s?s[n]:void 0}function uu(e,t,n,s){const o=e.getDomDataKey();let i=t[o];Vn(i)&&(i={},t[o]=i),i[n]=s}function zc(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function EO(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||ks(e,"print"))}function gr(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function VS(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function _O(e){return e.get("grandTotalRow")}function RO(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function DO(e,t,n){return!!t.group&&!t.footer&&RO(e,n)}function jc(e){const t=e.getCallback("getRowId");return t===void 0?t:n=>{let s=t(n);return typeof s!="string"&&(xS(()=>Xe(25,{id:s}),"getRowIdString"),s=String(s)),s}}function nQ(e,t){const n=e.get("groupHideParentOfSingleChild");return!!(n===!0||n==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function sQ(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function Kc(e){return(e==null?void 0:e.checkboxes)??!0}function sv(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function ov(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function BS(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function oQ(e){return typeof e.get("rowSelection")!="string"}function ta(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function TO(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const n=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return n&&s?!1:n?"enableDeselection":s?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function iQ(e){const t=TO(e);return t===!0||t==="enableSelection"}function rQ(e){const t=TO(e);return t===!0||t==="enableDeselection"}function $S(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function iv(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 Tf(e){return iv(e)==="multiRow"}function aQ(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function rv(e){const t=e.get("rowSelection");if(typeof t=="string"){const n=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return n&&s?"filteredDescendants":n?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function IO(e,t=!0){const n=e.get("rowSelection");return typeof n!="object"?t?"all":void 0:n.mode==="multiRow"?n.selectAll:"all"}function lQ(e){const t=e.get("rowSelection");return typeof t=="string"?!1:(t==null?void 0:t.mode)==="multiRow"?t.ctrlASelectsRows??!1:!1}function If(e){const t=rv(e);return t==="descendants"||t==="filteredDescendants"}function xO(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function uQ(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Lo(e){return e.get("columnMenu")==="legacy"}function cQ(e){return!Lo(e)}function dQ(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function Ft(e,t){return e.addCommon(t)}function FO({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var hQ={resizable:!0,sortable:!0},fQ=0;function PO(){return fQ++}function qa(e){return e instanceof cu}var cu=class extends We{constructor(e,t,n,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=n,this.primary=s,this.isColumn=!0,this.instanceId=PO(),this.autoHeaderHeight=null,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new ou,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=pf(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:s}}=this;t==null||t.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,n==null||n.initCol(this),s==null||s.initCol(this)}setColDef(e,t,n){var o;const s=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),s&&((o=this.beans.rowSpanSvc)==null||o.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,s=e.get("suppressFieldDotNotation");this.fieldContainsDots=dt(t)&&t.includes(".")&&!s,this.tooltipFieldContainsDots=dt(n)&&n.includes(".")&&!s}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 s=e.recreateColDef(this.colDef);this.setColDef(s,s,n.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const n=e.width,s=e.initialWidth;return n!=null?t=n:s!=null?t=s: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 s,o,i;this.frameworkEventListenerService=(o=(s=this.beans.frameworkOverrides).createLocalEventListenerWrapper)==null?void 0:o.call(s,this.frameworkEventListenerService,this.colEventSvc);const n=((i=this.frameworkEventListenerService)==null?void 0:i.wrap(e,t))??t;this.colEventSvc.addEventListener(e,n)}removeEventListener(e,t){var s;const n=((s=this.frameworkEventListenerService)==null?void 0:s.unwrap(e,t))??t;this.colEventSvc.removeEventListener(e,n)}createColumnFunctionCallbackParams(e){return Ft(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]??hQ[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 Ft(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 Vn(this.sort)}isSorting(){return dt(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 Xe(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 Ft(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(Vn(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.colSpan(t);return Math.max(n,1)}getRowSpan(e){if(Vn(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 s=this.createColumnEvent(e,t);n&&eo(s,n),this.colEventSvc.dispatchEvent(s)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function Us(e){return e instanceof av}var av=class extends We{constructor(e,t,n,s){super(),this.colGroupDef=e,this.groupId=t,this.padding=n,this.level=s,this.isColumn=!1,this.expandable=!1,this.instanceId=PO(),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)qa(t)?e(t):Us(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)qa(t)?e.push(t):Us(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 s=this.findChildrenRemovingPadding();for(let i=0,r=s.length;i<r;i++){const a=s[i];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 o=e&&t&&n;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=n=>{for(const s of n)Us(s)&&s.isPadding()?t(s.children):e.push(s)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},pQ={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function AO(e,t,n){const s={},o=e.gos;return Object.assign(s,o.get("defaultColGroupDef")),Object.assign(s,t),o.validateColDef(s,n),s}var gQ=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=yS(e);let n=0;for(;;){let s=e??t;if(s?n!==0&&(s+="_"+n):s=n,!this.existingKeys[s]){const o=String(s);return e&&n>0&&Xe(273,{providedId:e,usedId:o}),this.existingKeys[o]=!0,o}n++}}};function Rn(e){if(e!=null&&e.length)return e[e.length-1]}function Ya(e,t,n){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const s=e.length;if(s!==t.length)return!1;for(let o=0;o<s;o++)if(e[o]!==t[o]&&!(n!=null&&n(e[o],t[o])))return!1;return!0}function xf(e,t){if(e)for(const n of e)t(n)}function Mi(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function kO(e,t,n){for(let s=0;s<t.length;s++)Mi(e,t[s]);for(let s=t.length-1;s>=0;s--)e.splice(n,0,t[s])}var lv="ag-Grid-AutoColumn",OO="ag-Grid-SelectionColumn",MO="ag-Grid-RowNumbersColumn";function NO(e){const t=[],n=s=>{for(let o=0;o<s.length;o++){const i=s[o];qa(i)?t.push(i):Us(i)&&n(i.getChildren())}};return n(e),t}function na(e){return e.reduce((t,n)=>t+n.getActualWidth(),0)}function uv(e,t,n){const s={};if(!t)return;ia(null,t,i=>{s[i.getInstanceId()]=i}),n&&ia(null,n,i=>{s[i.getInstanceId()]=null});const o=Object.values(s).filter(i=>i!=null);e.context.destroyBeans(o)}function HS(e){return e.getId().startsWith(lv)}function sa(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(OO))??!1}function oa(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(MO))??!1}function mQ(e){return sa(e)||oa(e)}function cv(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function vQ(e,t){return Ya(e,t,(n,s)=>n.getColId()===s.getColId())}function yQ(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function qc(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Ff(e,t){const n=e===t,s=e.getColDef()===t,o=e.getColId()==t;return n||s||o}var wQ=(e,t)=>(n,s)=>{const o={value1:void 0,value2:void 0};let i=!1;return e&&(e[n]!==void 0&&(o.value1=e[n],i=!0),dt(s)&&e[s]!==void 0&&(o.value2=e[s],i=!0)),!i&&t&&(t[n]!==void 0&&(o.value1=t[n]),dt(s)&&t[s]!==void 0&&(o.value2=t[s])),o},CQ=(e,t)=>{Us(e)&&e.setupExpandable(),e.originalParent=t};function bQ(e,t=null,n,s,o){const i=new gQ,{existingCols:r,existingGroups:a,existingColKeys:l}=SQ(s);i.addExistingKeys(l);const u=LO(e,t,0,n,r,i,a,o),{colGroupSvc:c}=e,d=(c==null?void 0:c.findMaxDepth(u,0))??0,h=c?c.balanceColumnTree(u,0,d,i):u;return ia(null,h,CQ),{columnTree:h,treeDepth:d}}function SQ(e){const t=[],n=[],s=[];return e&&ia(null,e,o=>{if(Us(o)){const i=o;n.push(i)}else{const i=o;s.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:n,existingColKeys:s}}function LO(e,t,n,s,o,i,r,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&&IQ(d)?u[c]=l.createProvidedColumnGroup(s,d,n,o,i,r,a):u[c]=EQ(e,s,d,o,i,a)}return u}function EQ(e,t,n,s,o,i){var l;const r=RQ(n,s);r&&(s==null||s.splice(r.idx,1));let a=r==null?void 0:r.column;if(a){const u=GS(e,n,a.getColId());a.setColDef(u,n,i),_Q(e,a,u,i)}else{const u=o.getUniqueKey(n.colId,n.field),c=GS(e,n,u);a=new cu(c,n,u,t),e.context.createBean(a)}return(l=e.dataTypeSvc)==null||l.addColumnListeners(a),a}function VO(e,t,n,s,o,i,r,a){const{sortSvc:l,pinnedCols:u,colFlex:c}=e;n!==void 0&&t.setVisible(!n,a),l&&(l.updateColSort(t,s,a),o!==void 0&&l.setColSortIndex(t,o)),i!==void 0&&(u==null||u.setColPinned(t,i)),r!==void 0&&(c==null||c.setColFlex(t,r))}function _Q(e,t,n,s){VO(e,t,n.hide,n.sort,n.sortIndex,n.pinned,n.flex,s);const o=t.getFlex();if(!(o!=null&&o>0))if(n.width!=null)t.setActualWidth(n.width,s);else{const i=t.getActualWidth();t.setActualWidth(i,s)}}function RQ(e,t){if(t)for(let n=0;n<t.length;n++){const s=t[n].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[n].getId()===e.colId)return{idx:n,column:t[n]};continue}if(e.field!=null){if(s.field===e.field)return{idx:n,column:t[n]};continue}if(s===e)return{idx:n,column:t[n]}}}function GS(e,t,n,s){const{gos:o,dataTypeSvc:i}=e,r={},a=o.get("defaultColDef");eo(r,a,!1,!0);const l=DQ(e,r,t,n);l&&TQ(e,l,r);const u=r.cellDataType;eo(r,t,!1,!0),u!==void 0&&(r.cellDataType=u);const c=o.get("autoGroupColumnDef"),d=gr(o);return t.rowGroup&&c&&d&&eo(r,{sort:c.sort,initialSort:c.initialSort},!1,!0),i&&(i.postProcess(r),i.validateColDef(r)),o.validateColDef(r,n,s),r}function DQ(e,t,n,s){var r;const o=(r=e.dataTypeSvc)==null?void 0:r.updateColDefAndGetColumnType(t,n,s),i=n.type??o??t.type;return t.type=i,i?cv(i):void 0}function TQ(e,t,n){if(!t.length)return;const s=Object.assign({},pQ),o=e.gos.get("columnTypes")||{};for(const i of Object.keys(o)){const r=o[i];i in s?Xe(34,{key:i}):(r.type&&Xe(35),s[i]=r)}for(const i of t){const r=s[i.trim()];r?eo(n,r,!1,!0):Xe(36,{t:i})}}function IQ(e){return e.children!==void 0}function ia(e,t,n){if(t)for(let s=0;s<t.length;s++){const o=t[s];Us(o)&&ia(o,o.getChildren(),n),n(o,e)}}function BO(e,t){const n=[],s=[],o=[];return e.forEach(r=>{const a=r.getColDef().lockPosition;a==="right"?o.push(r):a==="left"||a===!0?n.push(r):s.push(r)}),t.get("enableRtl")?[...o,...s,...n]:[...n,...s,...o]}function $O(e,t){let n=!0;return ia(null,t,s=>{if(!Us(s))return;const o=s,i=o.getColGroupDef();if(!(i==null?void 0:i.marryChildren))return;const a=[];for(const h of o.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=o.getLeafColumns().length-1;c>d&&(n=!1)}),n}function HO(e,t){if(!e||e.length==0)return;const n=t(e[0]);for(let s=1;s<e.length;s++)if(n!==t(e[s]))return;return n}function GO(e,t,n){if(!t.length)return;const s=t.length===1?t[0]:null,o=HO(t,i=>i.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:s,source:n})}function xQ(e,t,n){if(!t.length)return;const s=t.length===1?t[0]:null,o=HO(t,i=>i.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:s,source:n})}function FQ(e,t,n,s){e.dispatchEvent({type:t,columns:n,column:n&&n.length==1?n[0]:null,source:s})}function Yc(e,t,n,s,o=null){t!=null&&t.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:n,source:s})}function Ni(e,t,n){var _;const{colModel:s,rowGroupColsSvc:o,pivotColsSvc:i,autoColSvc:r,selectionColSvc:a,colAnimation:l,visibleCols:u,pivotResultCols:c,environment:d,valueColsSvc:h,eventSvc:f,gos:p}=e,g=s.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 Xe(32),!1;const C=(R,T,I,x,P)=>{if(!R)return;const D=wQ(T,t.defaultState),F=D("flex").value1;if(VO(e,R,D("hide").value1,D("sort").value1,D("sortIndex").value1,D("pinned").value1,F,n),F==null){const k=D("width").value1;if(k!=null){const O=R.getColDef().minWidth??d.getDefaultColumnMinWidth();O!=null&&k>=O&&R.setActualWidth(k,n)}}P||!R.isPrimary()||(h==null||h.syncColumnWithState(R,n,D),o==null||o.syncColumnWithState(R,n,D,I),i==null||i.syncColumnWithState(R,n,D,x))},S=(R,T,I)=>{var ne,L;const x=UO(e,n),P=T.slice(),D={},F={},k=[],O=[],B=[];let Z=0;const J=(o==null?void 0:o.columns.slice())??[],ee=(i==null?void 0:i.columns.slice())??[];for(const H of R){const te=H.colId;if(te.startsWith(lv)){k.push(H),B.push(H);continue}if(sa(te)){O.push(H),B.push(H);continue}const me=I(te);me?(C(me,H,D,F,!1),Mi(P,me)):(B.push(H),Z+=1)}const X=H=>C(H,null,D,F,!1);P.forEach(X),o==null||o.sortColumns(zO.bind(o,D,J)),i==null||i.sortColumns(zO.bind(i,F,ee)),s.refreshCols(!1,n);const ve=(H,te,he=[])=>{for(const me of te){const re=H(me.colId);Mi(he,re),C(re,me,null,null,!0)}he.forEach(X)};return ve(H=>(r==null?void 0:r.getColumn(H))??null,k,(ne=r==null?void 0:r.getColumns())==null?void 0:ne.slice()),ve(H=>(a==null?void 0:a.getColumn(H))??null,O,(L=a==null?void 0:a.getColumns())==null?void 0:L.slice()),AQ(t,s,p),u.refresh(n),f.dispatchEvent({type:"columnEverythingChanged",source:n}),x(),{unmatchedAndAutoStates:B,unmatchedCount:Z}};l==null||l.start();let{unmatchedAndAutoStates:b,unmatchedCount:w}=S(t.state||[],g,R=>s.getColDefCol(R));if(b.length>0||dt(t.defaultState)){const R=((_=c==null?void 0:c.getPivotResultCols())==null?void 0:_.list)??[];w=S(b,R,T=>(c==null?void 0:c.getPivotResultCol(T))??null).unmatchedCount}return l==null||l.finish(),w===0}function PQ(e,t){var S,b;const{colModel:n,autoColSvc:s,selectionColSvc:o,eventSvc:i,gos:r}=e,a=n.getColDefCols();if(!(a!=null&&a.length))return;const l=n.getColDefColTree(),u=NO(l),c=[];let d=1e3,h=1e3;const f=w=>{const _=WO(w);Vn(_.rowGroupIndex)&&_.rowGroup&&(_.rowGroupIndex=d++),Vn(_.pivotIndex)&&_.pivot&&(_.pivotIndex=h++),c.push(_)};(S=s==null?void 0:s.getColumns())==null||S.forEach(f),(b=o==null?void 0:o.getColumns())==null||b.forEach(f),u==null||u.forEach(f),Ni(e,{state:c},t);const p=(s==null?void 0:s.getColumns())??[],C=[...(o==null?void 0:o.getColumns())??[],...p,...a].map(w=>({colId:w.colId}));Ni(e,{state:C,applyOrder:!0},t),i.dispatchEvent(Ft(r,{type:"columnsReset",source:t}))}function UO(e,t){const{rowGroupColsSvc:n,pivotColsSvc:s,valueColsSvc:o,colModel:i,sortSvc:r,eventSvc:a}=e,l={rowGroupColumns:(n==null?void 0:n.columns.slice())??[],pivotColumns:(s==null?void 0:s.columns.slice())??[],valueColumns:(o==null?void 0:o.columns.slice())??[]},u=dv(e),c={};for(const d of u)c[d.colId]=d;return()=>{const d=(R,T,I,x)=>{const P=T.map(x),D=I.map(x);if(Ya(P,D))return;const k=new Set(T);for(const B of I)k.delete(B)||k.add(B);const O=[...k];a.dispatchEvent({type:R,columns:O,column:O.length===1?O[0]:null,source:t})},h=R=>{const T=[];return i.forAllCols(I=>{const x=c[I.getColId()];x&&R(x,I)&&T.push(I)}),T},f=R=>R.getColId();d("columnRowGroupChanged",l.rowGroupColumns,(n==null?void 0:n.columns)??[],f),d("columnPivotChanged",l.pivotColumns,(s==null?void 0:s.columns)??[],f);const g=h((R,T)=>{const I=R.aggFunc!=null,x=I!=T.isValueActive(),P=I&&R.aggFunc!=T.getAggFunc();return x||P});g.length>0&&FQ(a,"columnValueChanged",g,t),Yc(a,h((R,T)=>R.width!=T.getActualWidth()),!0,t),GO(a,h((R,T)=>R.pinned!=T.getPinned()),t),xQ(a,h((R,T)=>R.hide==T.isVisible()),t);const w=h((R,T)=>R.sort!=T.getSort()||R.sortIndex!=T.getSortIndex());w.length>0&&(r==null||r.dispatchSortChangedEvents(t,w));const _=dv(e);OQ(u,_,t,i,a)}}function dv(e){const{colModel:t,rowGroupColsSvc:n,pivotColsSvc:s}=e,o=t.getColDefCols();if(Vn(o)||!t.isAlive())return[];const i=n==null?void 0:n.columns,r=s==null?void 0:s.columns,a=[],l=c=>{const d=c.isRowGroupActive()&&i?i.indexOf(c):null,h=c.isPivotActive()&&r?r.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 WO(e){const t=(p,g)=>p??g??null,n=e.getColDef(),s=t(n.sort,n.initialSort),o=t(n.sortIndex,n.initialSortIndex),i=t(n.hide,n.initialHide),r=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:s,sortIndex:o,hide:i,pinned:r,width:a,flex:l,rowGroup:c,rowGroupIndex:u,pivot:h,pivotIndex:d,aggFunc:f}}function AQ(e,t,n){if(!e.applyOrder||!e.state)return;const s=[];for(const o of e.state)o.colId!=null&&s.push(o.colId);kQ(t.cols,s,t,n)}function kQ(e,t,n,s){if(e==null)return;let o=[];const i={};for(const a of t){if(i[a])continue;const l=e.map[a];l&&(o.push(l),i[a]=!0)}let r=0;for(const a of e.list){const l=a.getColId();if(i[l]!=null)continue;l.startsWith(lv)?o.splice(r++,0,a):o.push(a)}if(o=BO(o,s),!$O(o,n.getColTree())){Xe(39);return}e.list=o}function OQ(e,t,n,s,o){const i={};for(const c of t)i[c.colId]=c;const r={};for(const c of e)i[c.colId]&&(r[c.colId]=!0);const a=e.filter(c=>r[c.colId]),l=t.filter(c=>r[c.colId]),u=[];l.forEach((c,d)=>{const h=a==null?void 0:a[d];if(h&&h.colId!==c.colId){const f=s.getCol(h.colId);f&&u.push(f)}}),u.length&&o.dispatchEvent({type:"columnMoved",columns:u,column:u.length===1?u[0]:null,finished:!0,source:n})}var zO=(e,t,n,s)=>{const o=e[n.getId()],i=e[s.getId()],r=o!=null,a=i!=null;if(r&&a)return o-i;if(r)return-1;if(a)return 1;const l=t.indexOf(n),u=t.indexOf(s),c=l>=0,d=u>=0;return c&&d?l-u:c?-1:1},MQ=class extends We{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(qc(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),qc(e.source)))}createColsFromColDefs(e){var S,b,w;const{beans:t}=this,{valueCache:n,colAutosize:s,rowGroupColsSvc:o,pivotColsSvc:i,valueColsSvc:r,visibleCols:a,eventSvc:l,groupHierarchyColSvc:u}=t,c=this.colDefs?UO(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=bQ(t,this.colDefs,!0,h,e);uv(t,(w=this.colDefCols)==null?void 0:w.tree,f.columnTree);const p=f.columnTree,g=f.treeDepth,v=NO(p),C={};for(const _ of v)C[_.getId()]=_;this.colDefCols={tree:p,treeDepth:g,list:v,map:C},this.createColumnsForService([u],this.colDefCols,e),o==null||o.extractCols(e,d),i==null||i.extractCols(e,d),r==null||r.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"&&(s==null||s.applyAutosizeStrategy())}refreshCols(e,t){var v;if(!this.colDefCols)return;const n=(v=this.cols)==null?void 0:v.tree;this.saveColOrder();const{autoColSvc:s,selectionColSvc:o,rowNumbersSvc:i,quickFilter:r,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:u,visibleCols:c,colViewport:d,eventSvc:h}=this.beans,f=this.selectCols(a,this.colDefCols);this.createColumnsForService([s,o,i],f,t);const p=eQ(this.gos,this.showingPivotResult);(!e||p)&&this.restoreColOrder(f),this.positionLockedCols(f),l==null||l.refresh(),r==null||r.refreshCols(),this.setColSpanActive(),u==null||u.setAutoHeightActive(f),c.clear(),d.clear(),!Ya(n,this.cols.tree)&&h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,n){for(const s of e)s&&(s.createColumns(t,o=>{this.lastOrder=o(this.lastOrder),this.lastPivotOrder=o(this.lastPivotOrder)},n),s.addColumns(t))}selectCols(e,t){const n=(e==null?void 0:e.getPivotResultCols())??null;this.showingPivotResult=n!=null;const{map:s,list:o,tree:i,treeDepth:r}=n??t;return this.cols={list:o.slice(),map:{...s},tree:i.slice(),treeDepth:r},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,s=this.isPivotMode()&&!this.showingPivotResult,o=t==null?void 0:t.isSelectionColumnEnabled(),i=n.get("rowNumbers"),r=e==null?void 0:e.columns;return this.cols.list.filter(l=>{const u=HS(l);if(s){const c=r==null?void 0:r.includes(l);return u||c||o&&sa(l)||i&&oa(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(s=>({colId:typeof s=="string"?s:s.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 s=d=>{const h=d.getOriginalParent();return h?h.getChildren().length>1?!0:s(h):!1};if(!n.some(d=>s(d))){const d=new Set(n);for(const h of e.list)d.has(h)||n.push(h);e.list=n;return}const o=new Map;for(let d=0;d<n.length;d++){const h=n[d];o.set(h,d)}const i=e.list.filter(d=>!o.has(d));if(i.length===0){e.list=n;return}const r=(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 cu){const C=o.get(v);if(C==null)continue;(p==null||p<C)&&(p=C,g=v);continue}v.forEachLeafColumn(C=>{const S=o.get(C);S!=null&&(p==null||p<S)&&(p=S,g=C)})}return g??r(d,f)},a=[],l=new Map;for(const d of i){const h=r(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=BO(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:s}=this.beans;n.refresh(t),s.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=qc(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e;uv(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 i,r,a,l,u;const{pivotResultCols:t,autoColSvc:n,selectionColSvc:s,groupHierarchyColSvc:o}=this.beans;xf((i=this.colDefCols)==null?void 0:i.list,e),xf((r=n==null?void 0:n.columns)==null?void 0:r.list,e),xf((a=s==null?void 0:s.columns)==null?void 0:a.list,e),xf((l=o==null?void 0:o.columns)==null?void 0:l.list,e),xf((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:s}=t;if(typeof e=="string"&&n[e])return n[e];for(let a=0;a<s.length;a++)if(Ff(s[a],e))return s[a];const{autoColSvc:o,selectionColSvc:i,groupHierarchyColSvc:r}=this.beans;return(o==null?void 0:o.getColumn(e))??(i==null?void 0:i.getColumn(e))??(r==null?void 0:r.getColumn(e))??null}},jO=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 Pf(e,t,n){return n&&e.addDestroyFunc(()=>t.destroyBean(n)),n??e}var ct=null;function KO(e){return typeof(e==null?void 0:e.getGui)=="function"}var qO=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){var s;if(!e)return;if(e.indexOf(" ")>=0){const o=(e||"").split(" ");if(o.length>1){for(const i of o)this.toggleCss(i,t);return}}this.cssClassStates[e]!==t&&e.length&&((s=this.getGui())==null||s.classList.toggle(e,t),this.cssClassStates[e]=t)}},NQ=0,Af=class extends fr{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=NQ++,this.cssManager=new qO(()=>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 s of this.css??[])this.beans.environment.addGlobalCSS(s,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(nO):null}applyElementsToComponent(e,t,n,s=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===ct)this[t]=s??e;else{const i=n==null?void 0:n[t];if(!this.suppressDataRefValidation&&!i)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){const n=[];for(const s of e.childNodes??[])n.push(s);for(const s of n){if(!(s instanceof HTMLElement))continue;const o=this.createComponentFromElement(s,i=>{const r=i.getGui();if(r)for(const a of s.attributes??[])r.setAttribute(a.name,a.value)},t);if(o){if(o.addItems&&s.children.length){this.createChildComponentsFromTags(s,t);const i=Array.prototype.slice.call(s.children);o.addItems(i)}this.swapComponentForNode(o,e,s)}else s.childNodes&&this.createChildComponentsFromTags(s,t)}}createComponentFromElement(e,t,n){const s=e.nodeName,o=this.getDataRefAttribute(e),i=s.indexOf("AG-")===0,r=i?this.componentSelectors.get(s):null;let a=null;if(r){const l=n&&o?n[o]:void 0;a=new r.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(i)throw new Error(`selector: ${s}`);return this.applyElementsToComponent(e,o,n,a),a}swapComponentForNode(e,t,n){const s=e.getGui();t.replaceChild(s,n),t.insertBefore(document.createComment(n.nodeName),s),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 s;typeof e=="string"||e==null?s=SS(e):s=bf(e),this.setTemplateFromElement(s,t,n)}setTemplateFromElement(e,t,n,s=!1){if(this.eGui=e,this.suppressDataRefValidation=s,t)for(let o=0;o<t.length;o++){const i=t[o];this.componentSelectors.set(i.selector,i)}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),RS(e)?{element:e,parent:n}:{element:e.getGui(),parent:n})}prependChild(e,t){const{element:n,parent:s}=this.getContainerAndElement(e,t)||{};!n||!s||s.insertAdjacentElement("afterbegin",n)}appendChild(e,t){const{element:n,parent:s}=this.getContainerAndElement(e,t)||{};!n||!s||s.appendChild(n)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:n}=t;mJ(this.eGui,e,{skipAriaHidden:n})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:n}=t;Bn(this.eGui,e,{skipAriaHidden:n});const s={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(s)}}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)}},yn=class extends Af{};function YO(e){return typeof e=="object"&&!!e.component}function LQ(e,t){return new jn(n=>{n(window.setInterval(e,t))})}var jn=class Ip{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 Ip(n=>{let s=t.length;const o=new Array(s);t.forEach((i,r)=>{i.then(a=>{o[r]=a,s--,s===0&&n(o)})})}):Ip.resolve()}static resolve(t=null){return new Ip(n=>n(t))}then(t){return new Ip(n=>{this.status===1?n(t(this.resolution)):this.waiters.push(s=>n(t(s)))})}onDone(t){this.status=1,this.resolution=t;for(const n of this.waiters)n(t)}onReject(t){}};function VQ(e){return e?e.prototype&&"getGui"in e.prototype:!1}function ZO(e,t,n,s){const{name:o}=n;let i,r,a,l,u,c;if(t){const d=t,h=d[o+"Selector"],f=h?h(s):null,p=g=>{typeof g=="string"?i=g:g!=null&&g!==!0&&(e.isFrameworkComponent(g)?a=g:r=g)};f?(p(f.component),l=f.params,u=f.popup,c=f.popupPosition):p(d[o])}return{compName:i,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:u,popupPositionFromSelector:c}}var BQ=class extends We{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,s=!1){return this.getCompDetails(this.gridOptions,e,t,n,s)}getCompDetails(e,t,n,s,o=!1){var b;const{name:i,cellRenderer:r}=t;let{compName:a,jsComp:l,fwComp:u,paramsFromSelector:c,popupFromSelector:d,popupPositionFromSelector:h}=ZO(this.beans.frameworkOverrides,e,t,s),f,p;const g=w=>{const _=this.registry.getUserComponent(i,w);_&&(l=_.componentFromFramework?void 0:_.component,u=_.componentFromFramework?_.component:void 0,f=_.params,p=_.processParams)};if(a!=null&&g(a),l==null&&u==null&&n!=null&&g(n),l&&r&&!VQ(l)&&(l=(b=this.agCompUtils)==null?void 0:b.adaptFunction(t,l)),!l&&!u){const{validation:w}=this.beans;o&&(a!==n||!n)?a?w!=null&&w.isProvidedUserComp(a)||Sn(50,{compName:a}):n?w||Sn(260,{...this.gos.getModuleErrorParams(),propName:i,compName:n}):Sn(216,{name:i}):n&&!w&&Sn(146,{comp:n});return}const v=this.mergeParams(e,t,s,c,f,p),C=l==null,S=l??u;return{componentFromFramework:C,componentClass:S,params:v,type:t,popupFromSelector:d,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(S,C,v,t)}}newAgStackInstance(e,t,n,s){var a;const o=!t;let i;o?i=new e:i=this.frameworkCompWrapper.wrap(e,s.mandatoryMethods,s.optionalMethods,s),this.createBean(i);const r=(a=i.init)==null?void 0:a.call(i,n);return r==null?jn.resolve(i):r.then(()=>i)}mergeParams(e,t,n,s=null,o,i){const r={...n,...o},a=e,l=a==null?void 0:a[t.name+"Params"];if(typeof l=="function"){const u=l(n);eo(r,u)}else typeof l=="object"&&eo(r,l);return eo(r,s),i?i(r):r}},$Q={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},HQ={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},GQ={name:"headerComponent",optionalMethods:["refresh"]},UQ={name:"innerHeaderComponent"},WQ={name:"innerHeaderGroupComponent"},zQ={name:"headerGroupComponent"},jQ={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},KQ={name:"loadingCellRenderer",cellRenderer:!0},qQ={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},YQ={name:"loadingOverlayComponent",optionalMethods:["refresh"]},ZQ={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},XQ={name:"tooltipComponent"},US={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},JQ={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},QQ={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},eee={name:"loadingCellRenderer",cellRenderer:!0},tee={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},nee={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function see(e,t){return e.getCompDetailsFromGridOptions(HQ,"agDragAndDropImage",t,!0)}function oee(e,t,n){return e.getCompDetails(t,GQ,"agColumnHeader",n)}function iee(e,t,n){return e.getCompDetails(t,UQ,void 0,n)}function ree(e,t){const n=t.columnGroup.getColGroupDef();return e.getCompDetails(n,zQ,"agColumnGroupHeader",t)}function aee(e,t,n){return e.getCompDetails(t,WQ,void 0,n)}function lee(e,t){return e.getCompDetailsFromGridOptions(QQ,void 0,t,!0)}function uee(e,t){return e.getCompDetailsFromGridOptions(eee,"agLoadingCellRenderer",t,!0)}function cee(e,t){return e.getCompDetailsFromGridOptions(tee,"agGroupRowRenderer",t,!0)}function dee(e,t){return e.getCompDetailsFromGridOptions(nee,"agDetailCellRenderer",t,!0)}function XO(e,t,n){return e.getCompDetails(t,jQ,void 0,n)}function JO(e,t,n){return e.getCompDetails(t,KQ,"agSkeletonCellRenderer",n,!0)}function QO(e,t,n){return e.getCompDetails(t,qQ,"agCellEditor",n,!0)}function hee(e,t,n,s){const o=t.filter;return YO(o)&&(t={filter:o.component,filterParams:t.filterParams}),e.getCompDetails(t,US,s,n,!0)}function fee(e,t,n){return e.getCompDetails(t,$Q,"agDateInput",n,!0)}function pee(e,t){return e.getCompDetailsFromGridOptions(YQ,"agLoadingOverlay",t,!0)}function gee(e,t){return e.getCompDetailsFromGridOptions(ZQ,"agNoRowsOverlay",t,!0)}function mee(e,t){return e.getCompDetails(t.colDef,XQ,"agTooltipComponent",t,!0)}function vee(e,t,n,s){return e.getCompDetails(t,JQ,s,n)}function eM(e,t){return ZO(e,t,US)}function WS(e,t,n){return e.mergeParams(t,US,n)}function kf(e){const t=e;return(t==null?void 0:t.getFrameworkComponentInstance)!=null?t.getFrameworkComponentInstance():e}function yee(e){return typeof e=="object"&&!!e.getComp}var Oe={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"},zS=class extends Af{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()}},jS,KS,qS,YS,ZS,XS,JS;function Za(){return jS===void 0&&(jS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),jS}function tM(){return KS===void 0&&(KS=/(firefox)/i.test(navigator.userAgent)),KS}function nM(){return qS===void 0&&(qS=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),qS}function du(){return YS===void 0&&(YS=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),YS}function QS(e){if(!e)return null;const t=e.tabIndex,n=e.getAttribute("tabIndex");return t===-1&&(n===null||n===""&&!tM())?null:t.toString()}function wee(){if(JS!==void 0)return JS;if(!document.body)return-1;let e=1e6;const t=tM()?6e6:1e9,n=document.createElement("div");for(document.body.appendChild(n);;){const s=e*2;if(n.style.height=s+"px",s>t||n.clientHeight!==s)break;e=s}return n.remove(),JS=e,e}function Cee(){return XS==null&&sM(),XS}function sM(){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&&(XS=n,ZS=n===0)}function oM(){return ZS==null&&sM(),ZS}var eE="T",bee=new RegExp(`[${eE} ]`),See=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${eE}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function mr(e,t){return e.toString().padStart(t,"0")}function Vo(e,t=!0,n=eE){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>mr(o,2)).join("-");return t&&(s+=n+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>mr(o,2)).join(":")),s}function hv(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),mr(e.getDate(),2),mr(e.getHours(),2),`:${mr(e.getMinutes(),2)}`,`:${mr(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,mr(e.getDate(),2)].map(String):null}var tE=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"},iM=["January","February","March","April","May","June","July","August","September","October","November","December"],nE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function sE(e,t){if(t==null)return Vo(e,!1);const n=mr(e.getFullYear(),4),s={YYYY:()=>n.slice(n.length-4,n.length),YY:()=>n.slice(n.length-2,n.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>iM[e.getMonth()],MMM:()=>iM[e.getMonth()].slice(0,3),MM:()=>mr(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${tE(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${tE(e.getDate())}`,DD:()=>mr(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>nE[e.getDay()],ddd:()=>nE[e.getDay()].slice(0,3),dd:()=>nE[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${tE(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(s).join("|"),"g");return t.replace(o,i=>i in s?s[i]():i)}function fv(e,t=!1){return!!po(e,t)}function Eee(e){return fv(e,!0)}function po(e,t=!1,n){if(!e||!n&&!See.test(e))return null;const[s,o]=e.split(bee);if(!s)return null;const i=s.split("-").map(f=>Number.parseInt(f,10));if(i.filter(f=>!isNaN(f)).length!==3)return null;const[r,a,l]=i,u=new Date(r,a-1,l);if(u.getFullYear()!==r||u.getMonth()!==a-1||u.getDate()!==l||!o&&t)return null;if(!o||o==="00:00:00")return u;const[c,d,h]=o.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 oE(e){const{inputValue:t,allSuggestions:n,hideIrrelevant:s,filterByPercentageOfBestMatch:o}=e;let i=(n??[]).map((l,u)=>({value:l,relevance:_ee(t,l),idx:u}));if(i.sort((l,u)=>l.relevance-u.relevance),s&&(i=i.filter(l=>l.relevance<Math.max(l.value.length,t.length))),i.length>0&&o&&o>0){const u=i[0].relevance*o;i=i.filter(c=>u-c.relevance<0)}const r=[],a=[];for(const l of i)r.push(l.value),a.push(l.idx);return{values:r,indices:a}}function _ee(e,t){e.length<t.length&&([e,t]=[t,e]);let n=[],s=[];const o=e.length,i=t.length;for(let a=0;a<=i;a++)n[a]=a;let r=0;for(let a=1;a<=o;a++){s[0]=a;for(let l=1;l<=i;l++){const u=e[a-1],c=t[l-1];if(u.toLocaleLowerCase()===c.toLocaleLowerCase())++r,u===c&&++r,a>1&&l>1&&e[a-2].toLocaleLowerCase()===t[l-2].toLocaleLowerCase()&&(++r,e[a-2]===t[l-2]&&++r),a<o/2-10&&++r,s[l]=n[l-1];else{const d=s[l-1],h=n[l],f=n[l-1];s[l]=1+Math.min(d,h,f)}}[n,s]=[s,n]}return n[i]/(r+1)}function rM(e){var n;return e.altKey||e.ctrlKey||e.metaKey?!1:((n=e.key)==null?void 0:n.length)===1}var iE=!1,pv=0;function Ree(e){pv>0||(e.addEventListener("keydown",gv),e.addEventListener("mousedown",gv))}function Dee(e){pv>0||(e.removeEventListener("keydown",gv),e.removeEventListener("mousedown",gv))}function gv(e){const t=iE,n=e.type==="keydown";n&&(e.ctrlKey||e.metaKey||e.altKey)||t!==n&&(iE=n)}function Tee(e){const t=Rs(e);return Ree(t),pv++,()=>{pv--,Dee(t)}}function Iee(){return iE}function Zc(e,t,n=!1){const s=gJ;let o=Yk;t&&(o+=", "+t),n&&(o+=', [tabindex="-1"]');const i=Array.prototype.slice.apply(e.querySelectorAll(s)).filter(l=>dr(l)),r=Array.prototype.slice.apply(e.querySelectorAll(o));return r.length?((l,u)=>l.filter(c=>u.indexOf(c)===-1))(i,r):i}function hu(e,t=!1,n=!1,s=!1){const o=Zc(e,s?".ag-tab-guard":null,n),i=t?Rn(o):o[0];return i?(i.focus({preventScroll:!0}),!0):!1}function fu(e,t,n,s){const o=Zc(t,n?':not([tabindex="-1"])':null),i=Hn(e);let r;n?r=o.findIndex(l=>l.contains(i)):r=o.indexOf(i);const a=r+(s?-1:1);return a<0||a>=o.length?null:o[a]}function aM(e,t=5){let n=0;for(;e&&QS(e)===null&&++n<=t;)e=e.parentElement;return QS(e)===null?null:e}var xee=".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)}",Fee=class extends Af{constructor(e,t,n){super(t,n),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(xee)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:n,labelAlignment:s,disabled:o}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),n!=null&&this.setLabelWidth(n),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;Ps(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(Bn(t,!1),Ua(t,"presentation")):(Bn(t,!0),Ua(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:(Xm(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return vf(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},lM=class extends Fee{constructor(e,t,n,s){super(e,t,n),this.className=s}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==""||QX(e)!==null?gf(e,""):gf(e,t??"")}setAriaLabel(e){return $c(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 hr(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 Pee(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 pu=class extends lM{constructor(e,t,n="text",s="input"){super(e,(e==null?void 0:e.template)??Pee(s),[],t),this.inputType=n,this.displayFieldTag=s,this.eLabel=ct,this.eWrapper=ct,this.eInput=ct}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:n,className:s}=this;e.classList.add(`${s}-label`),t.classList.add(`${s}-input-wrapper`),n.classList.add(`${s}-input`),this.addCss("ag-input-field"),n.id=n.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:i}=this.config;o!=null&&this.setInputName(o),i!=null&&this.setInputWidth(i),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,No(this.eInput,"type",e))}getInputElement(){return this.eInput}setInputWidth(e){return Xm(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 No(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return $c(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return vf(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)No(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";No(this.eInput,"autocomplete",t)}return this}},rE=class extends pu{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 s=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.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)}},aE={selector:"AG-CHECKBOX",component:rE},Aee=class extends rE{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)}},gu=class extends pu{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=dt(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=n=>{rM(n)&&n.key&&!e.test(n.key)&&n.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:n=>{var o;const s=(o=n.clipboardData)==null?void 0:o.getData("text");s!=null&&s.split("").some(i=>!e.test(i))&&n.preventDefault()}})}},mv={selector:"AG-INPUT-TEXT-FIELD",component:gu},kee=class extends pu{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}},Oee={selector:"AG-INPUT-TEXT-AREA",component:kee},lE=class extends gu{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const i=Number.parseFloat(e.value),r=isNaN(i)?"":this.normalizeValue(i.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:n,max:s,step:o}=this.config;typeof t=="number"&&this.setPrecision(t),typeof n=="number"&&this.setMin(n),typeof s=="number"&&this.setMax(s),typeof o=="number"&&this.setStep(o)}onWheel(e){Hn(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 o=Number.parseFloat(e).toFixed(n);return Number.parseFloat(o).toString()}const s=String(e).split(".");if(s.length>1){if(s[1].length<=n)return e;if(n>0)return`${s[0]}.${s[1].slice(0,n)}`}return s[0]}setMin(e){return this.min===e?this:(this.min=e,No(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,No(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,No(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(dt(n)){let s=this.isScientificNotation(n);if(s&&this.eInput.validity.valid)return e(n);if(!s){n=this.adjustPrecision(n);const o=this.normalizeValue(n);s=n!=o}if(s)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")}},Mee={selector:"AG-INPUT-NUMBER-FIELD",component:lE},Nee=class extends gu{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Za();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Hn(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?Vo(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,No(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?Vo(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,No(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,No(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 po(this.getValue())??void 0}setDate(e,t){this.setValue(Vo(e??null,this.includeTime),t)}},uM={selector:"AG-INPUT-DATE-FIELD",component:Nee},Lee=".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)}}",Vee="ag-active-item",Bee=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",ref:"eText",children:t}]}),$ee=class extends Af{constructor(e,t,n){super(Bee(e,t)),this.label=t,this.value=n,this.eText=ct}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(Vee,e),Kk(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const n=this.getGui();iJ(n,e),oJ(n,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>ES(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)}))}},Hee=class extends Af{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(Lee)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case Oe.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const n=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(n)}break;case Oe.DOWN:case Oe.UP:e.preventDefault(),this.navigate(t);break;case Oe.PAGE_DOWN:case Oe.PAGE_UP:case Oe.PAGE_HOME:case Oe.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,s=n??t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();Ps(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(s=>s.value===e);if(n!==-1){const s=this.options[n];this.value=s.value,this.displayValue=s.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(!dr(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const n=this.getGui(),{scrollTop:s,clientHeight:o}=n,{offsetTop:i,offsetHeight:r}=t;(i+r>s+o||i<s)&&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 $ee(this.cssIdentifier,t,e);n.setParentComponent(this);const s=this.createManagedBean(n);this.listItems.push(s),this.getGui().appendChild(s.getGui())}navigate(e){const t=e===Oe.DOWN;let n;const{listItems:s,highlightedItem:o}=this;if(!o)n=t?s[0]:Rn(s);else{let r=s.indexOf(o)+(t?1:-1);r=Math.min(Math.max(r,0),s.length-1),n=s[r]}this.highlightItem(n)}navigateToPage(e){const{listItems:t,highlightedItem:n}=this;if(!n||t.length===0)return;const s=t.indexOf(n),o=this.options.length-1,i=t[0].getHeight(),r=Math.floor(this.getGui().clientHeight/i);let a=-1;e===Oe.PAGE_HOME?a=0:e===Oe.PAGE_END?a=o:e===Oe.PAGE_DOWN?a=Math.min(s+r,o):e===Oe.PAGE_UP&&(a=Math.max(s-r,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){Ua(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((n,s)=>{n.setIndex(s+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},Gee=".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}}",Uee={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"}}]}]},Wee=class extends lM{constructor(e){if(super(e,(e==null?void 0:e.template)||Uee,(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=ct,this.eWrapper=ct,this.eDisplayField=ct,this.eIcon=ct,this.registerCSS(Gee),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:s,minPickerWidth:o,maxPickerWidth:i}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,n!=null&&this.setPickerMaxHeight(n),o!=null&&this.setPickerMinWidth(o),i!=null&&this.setPickerMaxWidth(i)}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:s}=this.config;if(n){const o=this.beans.iconSvc.createIconNoSpan(n);o&&this.eIcon.appendChild(o)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),CS(e,!1),this.ariaRole&&Ua(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 Oe.UP:case Oe.DOWN:case Oe.ENTER:case Oe.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case Oe.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:s,modalPicker:o=!0},maxPickerHeight:i,minPickerWidth:r,maxPickerWidth:a,variableWidth:l,beans:u,eWrapper:c}=this,d={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{const g=$k(u);this.beforeHidePicker(),g&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(n,s),anchorToElement:c};e.style.position="absolute";const h=u.popupSvc,f=h.addPopup(d);l?(r&&(e.style.minWidth=r),e.style.width=_S(Km(c)),a&&(e.style.maxWidth=a)):Xm(e,a??Km(c));const p=i??`${bS(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:s},eWrapper:o,pickerComponent:i}=this,r=s.get("enableRtl")?"right":"left";n.positionPopupByComponent({type:t,eventSource:o,ePopup:i.getGui(),position:"under",alignSide:r,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();CS(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 Xm(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()}},zee=".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)}",uE=class extends Wee{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(zee)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:Zm(()=>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 Hee("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),n=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",n),pJ(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:s=>{s==null||s.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===Oe.TAB&&this.hidePicker(),t){case Oe.ENTER:case Oe.UP:case Oe.DOWN:case Oe.PAGE_UP:case Oe.PAGE_DOWN:case Oe.PAGE_HOME:case Oe.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(n=this.listComponent)==null||n.handleKeyDown(e):super.onKeyDown(e);break;case Oe.ESCAPE:super.onKeyDown(e);break;case Oe.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:s,config:{placeholder:o},eDisplayField:i,tooltipFeature:r}=this;if(this.value===e||!s)return this;if(n||s.setValue(e,!0),s.getValue()===this.getValue())return this;let l=s.getDisplayValue();return l==null&&o&&(l=o),i.textContent=l,r==null||r.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},jee={selector:"AG-SELECT",component:uE},Kee=':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}}',cE=typeof window!="object"||!((LB=(NB=window==null?void 0:window.document)==null?void 0:NB.fonts)!=null&&LB.forEach),Xc=(e,t,n,s,o,i)=>{if(cE)return;s&&(e=`@layer ${CSS.escape(s)} { ${e} }`);let r=Jc.map.get(t);if(r||(r=[],Jc.map.set(t,r)),r.some(c=>c.css===e))return;const a=document.createElement("style");i&&a.setAttribute("nonce",i),a.dataset.agGlobalCss=n,a.textContent=e;const l={css:e,el:a,priority:o};let u;for(const c of r){if(c.priority>o)break;u=c}if(u){u.el.insertAdjacentElement("afterend",a);const c=r.indexOf(u);r.splice(c+1,0,l)}else t.insertBefore(a,t.querySelector(":not(title, meta)")),r.push(l)},cM=(e,t,n,s)=>{Xc(Kee,e,"shared",t,0,n),s==null||s.forEach((o,i)=>o.forEach(r=>Xc(r,e,i,t,0,n)))},qee=e=>{Jc.grids.add(e)},Yee=e=>{if(Jc.grids.delete(e),Jc.grids.size===0){Jc.map=new WeakMap;for(const t of document.head.querySelectorAll("style[data-ag-global-css]"))t.remove()}},dM,Jc=(dM=typeof window=="object"?window:{}).agStyleInjectionState??(dM.agStyleInjectionState={map:new WeakMap,grids:new Set}),vr=e=>new hM(e),Xa="$default",Zee=0,hM=class{constructor({feature:e,params:t,modeParams:n={},css:s,cssImports:o}){this.feature=e,this.css=s,this.cssImports=o,this.modeParams={[Xa]:{...n[Xa]??{},...t??{}},...n}}use(e,t,n){let s=this._inject;if(s==null){let{css:o}=this;if(o){const i=`ag-theme-${this.feature??"part"}-${++Zee}`;typeof o=="function"&&(o=o()),o=`:where(.${i}) {
149
149
  ${o}
@@ -203,7 +203,7 @@ See ${wO(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var bue={1:"Charting A
203
203
  `)}checkProperties(e,t,n,s,o){const i=["__ob__","__v_skip","__metadata__"],r=Gue(Object.getOwnPropertyNames(e),[...i,...t,...n],n),a=Object.keys(r);for(const l of a){const u=r[l];let c=`invalid ${s} property '${l}' did you mean any of these: ${u.slice(0,8).join(", ")}.`;n.includes("context")&&(c+=`
204
204
  If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),_f(c)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);_f(`to see all the valid ${s} properties please check: ${l}`)}}};function Gue(e,t,n){const s={},o=e.filter(i=>!t.some(r=>r===i));if(o.length>0)for(const i of o)s[i]=oE({inputValue:i,allSuggestions:n}).values;return s}var Uue=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Wue={moduleName:"Validation",version:ut,beans:[Hue]};function yL(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var zue=class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,yL(s)};if(this.doingTreeDataFiltering()){const s=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],u=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(i.childrenAfterGroup[a],u):n(l,u)}n(i,r)},o=i=>s(i,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},jue=class extends OE{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const i=Pf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Ft(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=li("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new td(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();$c(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Hn(t)===this.eGui)return;const o=fu(t,this.eGui,null,e.shiftKey);if(o){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;mu(e);case Oe.ENTER:t&&hu(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&iu(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,i=!!(o&&o.key===Oe.TAB);if(o&&i){const r=o.shiftKey;hu(this.eGui,r)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new kE(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!Lo(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(s.get("enableFilterHandlers")){const c=i;let d="filter";c!=null&&c.afterFloatingFilter?d="ui":c!=null&&c.afterDataChange?d="dataChanged":(i==null?void 0:i.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),u=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,u)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,i=this.comp.getFloatingFilterComp();!i||!o?this.updateCompDetails(e,o,n):i.then(r=>{!r||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var i;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ds(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Kue(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function que(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Yue={moduleName:"SharedMenu",version:ut,beans:[rse],apiFunctions:{showColumnMenu:Kue,hidePopupMenu:que}},Zue=class extends Tte{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-i.top,0),u=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${u}px`,r=!0);const d=i.right-i.left-u;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-i.left-2}function p(){return o.left-i.left-u}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return la(e)}},Uv={moduleName:"Popup",version:ut,beans:[Zue]},Xue=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function Jue(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function Que(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function ece(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function tce(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function nce(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function sce(e,t,n){const{gos:s,colModel:o,colFilter:i}=e;n&&!s.get("enableFilterHandlers")&&(Xe(288),n=!1);const r=o.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function oce(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function ice(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function rce(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function ace(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function lce(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Xe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(s==null||s.updateModel(a,r))}else s==null||s.updateAllModels(r)}var uce={filterHandler:()=>({doesFilterPass:()=>!0})},cce=class extends We{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...xM},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:i}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((u,c)=>{const d=e[c];r.push(this.setModelOnFilterWrapper(u,d)),l.delete(c)}),l.forEach(u=>{const c=s.getColDefCol(u)||s.getCol(u);if(!c){Xe(62,{colId:u});return}if(!c.isFilterAllowed()){Xe(63,{colId:u});return}const d=this.getOrCreateFilterWrapper(c,!0);if(!d){Xe(64,{colId:u});return}r.push(this.setModelOnFilterWrapper(d,e[u],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});jn.all(r).then(()=>{const l=this.getModel(!0),u=[];this.allColumnFilters.forEach((c,d)=>{const h=a?a[d]:null,f=l?l[d]:null;ff(h,f)||u.push(c.column)}),u.length>0?i==null||i.onFilterChanged({columns:u,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var i;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);dt(l)&&(t[a]=l)}),!e)for(const r of Object.keys(s)){const a=s[r];dt(a)&&!n.has(r)&&((i=o.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:Ds(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const i=s.state;i!=null&&(n=!0,t[o]=i)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ds(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(Xe(66),null):s.getModel():Ds(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=u=>u?u.isFilterActive?u.isFilterActive():(Xe(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!VS(n),o=u=>{if(!u.isPrimary())return!0;const d=!t.isPivotActive();return!u.isValueActive()||!d?!1:t.isPivotMode()?!0:s},i=[],r=[],a=(u,c,d)=>{c&&(o(u)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(u=>{const c=u.column,d=c.getColId();if(u.isHandler)l.push(jn.resolve().then(()=>{a(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:u.handler,handlerParams:u.handlerParams})}));else{const h=Qa(u);h&&l.push(h.then(f=>{a(c,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.all(l).then(()=>{this.activeAggregateFilters=i,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)n.push(jn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=Qa(o);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),jn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?o:s,a=this.model;for(let l=0;l<i.length;l++){const u=i[l],{colId:c,isHandler:d}=u;if(c!==t)if(d){const{handler:h,handlerParams:f}=u;if(!h.doesFilterPass({node:e,data:r,model:Ds(a,c),handlerParams:f}))return!1}else{const h=u.comp;if(typeof h.doesFilterPass!="function"){Sn(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,u;const{column:i,isHandler:r}=o;s!==i.getColId()&&(r&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(u=Qa(o,r))==null||u.then(c=>{typeof(c==null?void 0:c.onAnyFilterChanged)=="function"&&c.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var i,r;const s=n.isHandler;s&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const o=Qa(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),jn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,i)=>{const r=i?s.getCol(i):e;return r?n.getValue(r,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ds(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=dt(Ds(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?Qa(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=Qa(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return uQ(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Xte(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,i){const r=()=>{const u=this.createFilterCompParams(e,o,i),c=s(u,o);return hee(this.beans.userCompFactory,t,c,n)},a=r();return a?{compDetails:a,createFilterUi:u=>(u?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails:u,createFilterUi:c}=l;return this.isGlobalButtons&&((h=(d=u.params)==null?void 0:d.buttons)!=null&&h.length||Xe(281,{colId:e.getColId()})),{compDetails:u,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:c}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return Ft(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),i=this.createBaseFilterParams(e,s);if(i.filterChangedCallback=o,i.filterModifiedCallback=s?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=Ds(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(u,c)=>{this.updateStoredModel(a,u),this.refreshHandlerAndUi(e,u,"ui",!1,c).then(()=>{o({...c,source:"columnFilter"})})},r.onStateChange=u=>{this.updateState(e,u),this.updateOrRefreshFilterUi(e)},r.onAction=(u,c,d)=>{this.updateModel(e,u,c),this.dispatchLocalEvent({type:"filterAction",column:e,action:u,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=u=>this.filterUiChanged(e,u),r.source=n}return i}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...o,source:"init",model:Ds(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,u=>{l.filter=u??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(YO(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),u=l?a(t):void 0,c=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof u=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[u];p!=null?d=p:Bte.has(u)&&(d=c(u),h=u)}else d=u;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=eM(o,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=c(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(ss(s)&&Xe(277,{colId:e.getColId()}),uce):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=WS(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(Ft(this.gos,{column:e,colDef:s})),i=this.createHandlerParams(e,n);return{handler:o,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return Ft(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:i=>{var r;return((r=this.beans.filterManager)==null?void 0:r.doesRowPassOtherFilters(s,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(s,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{o({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const o=s&&e.every(i=>s.isGroupFilter(i));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(kf(p))})},r=e.getColDef(),a=o!=null&&o.isSelectable(r)?o.getFilterDef(e,r):r,l=nne(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",u=this.gos.get("enableFilterHandlers"),c=WS(n,a,this.createFilterCompParams(e,u,"init",!0)),d=Ft(this.gos,{column:e,filterParams:c,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(u){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ds(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return vee(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(u=>{this.destroyBean(u),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var i;o&&this.isAlive()&&((i=this.beans.filterManager)==null||i.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:i}=e,r=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(i){if(i.created)return i.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return jn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,C,S,b,w,_;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,i=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,u=l!=null&&l.isSelectable(i)?l.getFilterDef(o,i):i,c=r?this.createHandlerFunc(o,u,this.getDefaultFilter(o)):void 0,d=!!c,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(o,u,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??WS(s.userCompFactory,u,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(c==null?void 0:c.handlerNameOrCallback)??(c==null?void 0:c.filterHandler),T=Ds(this.model,e);if(n.handlerGenerator!=R){const I=n.handler,{handler:x,handlerParams:P}=this.createHandlerFromFunc(o,c.filterHandler,g);n.handler=x,n.handlerParams=P,n.handlerGenerator=R,delete this.model[e],(v=x.init)==null||v.call(x,{...P,source:"init",model:null}),this.destroyBean(I),T!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[o],source:t}))}else{const I=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=I,(b=(S=n.handler).refresh)==null||b.call(S,{...I,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((w=n.filterUi)==null?void 0:w.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(_=Qa(n,h))==null||_.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const i=this.cachedFilter(e);if(!i)return s&&this.getOrCreateFilterWrapper(e,!0),jn.resolve();if(!i.isHandler)return jn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return $te(()=>{if(r){const{created:u,filterParams:c}=r;if(u)return r.promise.then(d=>d?{filter:d,filterParams:c}:void 0);r.refreshed=!0}return jn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(kf(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,i=e.getColId(),r=s.get(i);return r?r.model??null:Ds(o,i)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(i=>{s=i});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:Ds(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):jn.resolve()}setColDefPropsForDataType(e,t,n){var c;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:u}=e;o==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((c=a.multiFilter)==null?void 0:c.getParamsForDataType(l,u,t,n))??{}:{filterParams:i,filterValueGetter:r}=qte(o,l,u,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new jn(s=>{if(e.isHandler){const i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){s();return}this.refreshHandlerAndUi(i,t,"api").then(()=>s());return}const o=Qa(e);if(o){o.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){Xe(65),s();return}(i.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){dt(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var r;const s=e.getColId(),o=this.cachedFilter(e),i=()=>o==null?void 0:o.filterUi;AM(t,i,()=>Ds(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,u;return(u=(l=i())==null?void 0:l.filterParams)==null?void 0:u.onModelChange(a,n)},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var r;const i=this.beans.colModel.getColDefCol(o);i&&AM(e,()=>s.filterUi,()=>Ds(this.model,o),()=>this.state.get(o),a=>this.updateState(i,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}),n.length&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();PM(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ds(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const i=e.get(o);if(i.valid===!1)return!1;(i.model??null)!==Ds(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==Ds(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function dce(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function hce(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var fce=class extends We{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){VS(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):jn.resolve()).then(()=>{var i;const o={source:t,type:"filterChanged",columns:s};n&&eo(o,n),this.eventSvc.dispatchEvent(o),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!VS(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Xe(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},pce=class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var i;(i=this.popupSvc)==null||i.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,Lo(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,i="left";const r=Lo(this.gos);!r&&this.gos.get("enableRtl")&&(o=1,i="right");const a=r?void 0:4*o,l=r?void 0:4;this.showPopup(e,u=>{var c;(c=this.popupSvc)==null||c.positionPopupByComponent({type:n,eventSource:t,ePopup:u,nudgeX:a,nudgeY:l,alignSide:i,keepWithinBounds:!0,position:"under",column:e})},n,t,r,s)}showPopup(e,t,n,s,o,i){var g;const r=e?this.createBean(new jte(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){Sn(57);return}const a=is({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const u=()=>r==null?void 0:r.afterGuiDetached(),c=cQ(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{nN(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&dr(s)){const S=aM(s);S==null||S.focus({preventScroll:!0})}u(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:c,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:n,hidePopup:l})}),nN(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||fu(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),hu(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},gce=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:i}=this.beans,r=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,s):i.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:i,valueSvc:r}=this.beans,a=Ft(this.gos,{data:t,node:s,column:n,colDef:o,getValue:r.getValueCallback.bind(r,s)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},mce={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},vce=class extends yn{constructor(){super(mce,[mv]),this.eFloatingFilterText=ct}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},d0=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(i=>t[i]!=null)?!0:(Xe(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Xe(73)}else Xe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function jf(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function Wv(e){return e==null||typeof e=="string"&&e.trim().length===0}function yce(e){return e==="AND"||e==="OR"?e:"AND"}function wce(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function Cce(e,t){let n=e.length;return n>t&&(e.splice(t),Xe(78),n=t),n}function Kf(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var h0=class extends tne{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new d0;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=yce(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&Ya(r.conditions,a.conditions,(l,u)=>this.areSimpleModelsEqual(l,u))}return i}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),jn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],Xe(77));const i=Cce(o,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,u)=>{this.eTypes[u].setValue(l.type,!0),this.setConditionIntoUi(l,u)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),jn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Xe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Xe(80),n=1),n>t&&(Xe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new uE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=is({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new Aee);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const i=this.isConditionDisabled(o,e);s.setDisabled(i||this.filterListOptions.length<=1),o===1&&(vf(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((s,o)=>{Bn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,i,r)=>{this.setElementDisplayed(s,o<r),this.setElementDisabled(s,this.isConditionDisabled(i,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:i,eJoinOrs:r}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const s=jf(e,t,n);for(const o of s)Oi(o)}removeComponents(e,t,n){const s=jf(e,t,n);for(const o of s)Oi(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof pu&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),u=a<t;(l||u)&&(this.removeConditionsAndOperators(a,1),s=!0,u&&n--)}let i=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),i=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),i=!0),i&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof pu))return;const i=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof pu&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){KO(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){KO(e)&&vf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof pu&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=Kf(t,this.optionsFactory),o=this.getInputs(e);for(let i=0;i<o.length;i++){const r=o[i];r!=null&&n(r,i,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return Kf(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,i)=>{i===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},wL=class{constructor(e,t,n,s,o,i){this.alive=!0,this.context=e,this.eParent=o;const r=fee(t,n,s);r&&r.newAgStackInstance().then(a=>{var c,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(c=a==null?void 0:a.afterGuiAttached)==null||c.call(a);const{tempValue:l,disabled:u}=this;l&&a.setDate(l),u!=null&&((d=a.setDisabled)==null||d.call(a,u)),i==null||i(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Bn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},f0=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function CL(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&po(n,void 0,!0)||null,s&&po(s,void 0,!0)||null].slice(0,Kf(o,t))}var bL=1e3,SL=1/0,bce=class extends h0{constructor(){super("dateFilter",CL,f0),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=bL,this.maxValidYear=SL,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,u)=>{const c=e[l];if(c!=null)if(isNaN(c))Xe(82,{param:l});else return c==null?u:Number(c);return u},n=t("minValidYear",bL),s=t("maxValidYear",SL);this.minValidYear=n,this.maxValidYear=s,n>s&&Xe(83);const{minValidDate:o,maxValidDate:i}=e,r=o instanceof Date?o:po(o);this.minValidDate=r;const a=i instanceof Date?i:po(i);this.maxValidDate=a,r&&a&&r>a&&Xe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,i=new wL(n,t,o.colDef,Ft(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=is({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,s){const o=is({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),jf(this.eConditionPanelsFrom,e,t),jf(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=jf(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,i)=>{o!==e||!t||s>=i||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Vo(s[0],!0,o)),s.length>1&&(n.dateTo=Vo(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},EL=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new d0;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const r=t;s.push(...r.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return s[o](r=>this.individualConditionPasses(e,r,i))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let i=VM(t)?t.conditions:[t];const r=(n==null?void 0:n.map(c=>typeof c=="string"?c:c.displayKey))??this.defaultOptions;if(!(!i||i.every(c=>r.find(d=>d===c.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const u=this.filterType;if((i&&!i.every(c=>c.filterType===u)||t.filterType!==u)&&(i=i.map(c=>({...c,filterType:u})),l=!0),typeof s=="number"&&i&&i.length>s&&(i=i.slice(0,s),l=!0),l){const c=i.length>1?{...t,filterType:u,conditions:i}:{...i[0],filterType:u};this.params={...e,model:c},e.onModelChange(c)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),i=s.getCustomOption(t.type),r=wce(i,o,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},_L=class extends EL{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:i}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(i)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),i=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=o(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return Wv(t);case"notBlank":return!Wv(t);default:return Xe(76,{filterModelType:s}),!0}}},RL={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Sce={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},p0=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?el(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(u=>this.getModelAsString(u,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${el(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?el(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const i=e,r=this.optionsFactory.getCustomOption(i.type),{displayKey:a,displayName:l,numberOfInputs:u}=r||{};return a&&l&&u===0?n(a,l):this.conditionToString(i,s,i.type==="inRange"||u===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,i){let r;const a=this.getTypeKey(e);return a&&(r=el(this,a)),o&&i&&(r=this.getLocaleTextFunc()(o,i)),r!=null?t?`${r} ${el(this,"filterSummaryInRangeValues",[n(),s()])}`:`${r} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},DL=class extends p0{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,i=t.column,r=s==null?void 0:s.getDateFormatterFunction(i),a=r?r(n??void 0):n;return o.formatValue(i,null,a)}),this.filterTypeKeys=RL}conditionToString(e,t,n,s,o){const{type:i}=e,r=po(e.dateFrom),a=po(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,u=t?this.formatValue.bind(this):h=>sE(h,l),c=()=>r!==null?u(r):"null",d=()=>a!==null?u(a):"null";if(t){const h=this.conditionForToolPanel(i,n,c,d,s,o);if(h!=null)return h}return n?`${c()}-${d()}`:r!=null?u(r):`${i}`}};function Ece(e,t){const n=t;return n<e?-1:n>e?1:0}var _ce=class extends _L{constructor(){super(CL,f0),this.filterType="date",this.FilterModelFormatterClass=DL}comparator(){return this.params.filterParams.comparator??Ece}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},TL=class extends yn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new d0;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Rce={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},Dce=class extends TL{constructor(){super(Rce,[mv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=DL,this.filterType="date",this.defaultOptions=f0}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?po(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Bn(this.eDateWrapper,e),Bn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Vo(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=yE(e,this.defaultDebounceMs);return Ft(this.gos,{onDateChanged:As(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new wL(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Tce={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Ice=class extends yn{constructor(){super(Tce,[mv]),this.eDateInput=ct,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&Za();const{minValidYear:s,maxValidYear:o,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:u}=e.filterParams||{},c=this.beans.dataTypeSvc,d=l??((h=c==null?void 0:c.getDateIncludesTimeFlag)==null?void 0:h.call(c,u.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&s&&Xe(85),r&&o&&Xe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:po(g));f&&p&&f.getTime()>p.getTime()&&Xe(87)}i?i instanceof Date?t.min=sE(i):t.min=i:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=sE(r):t.max=r:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return po(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Vo(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},g0=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function m0(e){const{allowedCharPattern:t}=e??{};return t??null}function v0(e){return e==null||isNaN(e)?null:e}function IL(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[v0(n),v0(s)].slice(0,Kf(o,t))}var xce=class extends h0{constructor(){super("numberFilter",IL,g0),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=m0(this.params),t=is({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new gu({allowedCharPattern:s}):new lE);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(v0(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=Qr(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},xL=class extends p0{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=RL}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const u=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),s,o);if(u!=null)return u}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},Fce=class extends _L{constructor(){super(IL,g0),this.filterType="number",this.FilterModelFormatterClass=xL}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},FL=class extends We{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new gu((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function y0(e){const t=e==null?void 0:e.trim();return t===""?e:t}function PL(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,Kf(o,t))}var Pce={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},AL=class extends TL{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Pce)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=bv(e.filterParams),!o){const i=yE(e.filterParams,s),r=As(this,this.syncUpWithParentFilter.bind(this),i);n.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();Ps(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:i}=this;let r=s.getValue();if(o.filterParams.trimInput&&(r=y0(r),s.setValue(r,!0)),n){const a=o,l=a.model,u=this.convertValue(r),c=u==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:u};a.onModelChange(c,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Ace=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new lE),this.eTextInput=this.createManagedBean(new gu),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},kce=class extends AL{constructor(){super(...arguments),this.FilterModelFormatterClass=xL,this.filterType="number",this.defaultOptions=g0}updateParams(e){m0(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=m0(e.filterParams),this.allowedCharPattern?this.createManagedBean(new FL({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Ace)}convertValue(e){return e?Number(e):null}},w0=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Oce=class extends h0{constructor(){super("textFilter",PL,w0),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(Qr(n.getValue()))}),t}createEValue(){const e=is({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new gu);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},kL=class extends p0{constructor(){super(...arguments),this.filterTypeKeys=Sce}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e;if(t){const l=c=>()=>el(this,"filterSummaryTextQuote",[c]),u=this.conditionForToolPanel(a,n,l(i),l(r),s,o);if(u!=null)return u}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},Mce=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},Nce=e=>e,Lce=e=>e==null?null:e.toString().toLowerCase(),Vce=class extends EL{constructor(){super(PL,w0),this.filterType="text",this.FilterModelFormatterClass=kL}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Mce,this.formatter=t.textFormatter??(t.caseSensitive?Nce:Lce)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:u,filterParams:{textFormatter:c}}=this.params;if(n.type==="blank")return Wv(t);if(n.type==="notBlank")return!Wv(t);const d={api:r,colDef:a,column:l,context:u,node:s.node,data:s.data,filterOption:n.type,value:i,textFormatter:c};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:i}=n;return o&&(s.filter=y0(o)??null),i&&(s.filterTo=y0(i)??null),s};return VM(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Bce=class extends AL{constructor(){super(...arguments),this.FilterModelFormatterClass=kL,this.filterType="text",this.defaultOptions=w0}createFloatingFilterInputService(){return this.createManagedBean(new FL)}};function $ce(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function Hce(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Gce(e){var t;(t=e.quickFilter)==null||t.resetCache()}var Uce=class extends We{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(u=>u.isVisible()||u.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return dt(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Xe(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return dt(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=Ft(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return dt(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);dt(s)&&t.push(s)}return t.join(`
205
205
  `)}},Wce={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[zue]},C0={moduleName:"FilterCore",version:ut,beans:[fce],apiFunctions:{isAnyFilterPresent:dce,onFilterChanged:hce},css:[Xue],dependsOn:[Wce]},OL={moduleName:"FilterValue",version:ut,beans:[gce]},zv={moduleName:"ColumnFilter",version:ut,beans:[cce,pce],dynamicBeans:{headerFilterCellCtrl:jue},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:Jue,getColumnFilterInstance:Que,destroyFilter:ece,setFilterModel:tce,getFilterModel:nce,getColumnFilterModel:sce,setColumnFilterModel:oce,showColumnFilter:ice,hideColumnFilter:rce,getColumnFilterHandler:ace,doFilterAction:lce},dependsOn:[C0,Uv,OL,Yue]},zce={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:vce},dependsOn:[zv]},jce={moduleName:"TextFilter",version:ut,dependsOn:[zv],userComponents:{agTextColumnFilter:{classImp:Oce,params:{useForm:!0}},agTextColumnFloatingFilter:Bce},dynamicBeans:{agTextColumnFilterHandler:Vce}},Kce={moduleName:"NumberFilter",version:ut,dependsOn:[zv],userComponents:{agNumberColumnFilter:{classImp:xce,params:{useForm:!0}},agNumberColumnFloatingFilter:kce},dynamicBeans:{agNumberColumnFilterHandler:Fce}},qce={moduleName:"DateFilter",version:ut,dependsOn:[zv],userComponents:{agDateColumnFilter:{classImp:bce,params:{useForm:!0}},agDateInput:Ice,agDateColumnFloatingFilter:Dce},dynamicBeans:{agDateColumnFilterHandler:_ce}},Yce={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[Uce],dependsOn:[C0,OL]},Zce={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:$ce,getQuickFilter:Hce,resetQuickFilter:Gce},dependsOn:[Yce]},Xce={moduleName:"ExternalFilter",version:ut,dependsOn:[C0]},Jce=".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}}",b0=(e,t,n)=>{var a,l,u;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(u=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:u.errorMessages,r=o||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},Qce=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=c0(o),{column:r,eGui:a}=t,l=r.getColDef();!s&&i&&!l.headerComponent&&(s=Zm(()=>a.querySelector(".ag-header-cell-text")));const u="header",d=this.beans.colNames.getDisplayNameForColumn(r,"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,Ft(o,{location:u,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=c0(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!s&&i&&!(l!=null&&l.headerGroupComponent)&&(s=Zm(()=>a.querySelector(".ag-header-group-text")));const u="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"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,Ft(o,{location:u,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:r};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:i}=s,{column:r,rowNode:a}=e;let l="cell";const u=()=>{const f=!!!(i!=null&&i.isEditing(e))&&b0(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&dt(g))return Gf(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},c=c0(o);n||(c&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&b0(s,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=Zm(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(i!=null&&i.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:u,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(o,i);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const i={getGui:()=>o,getTooltipValue:()=>b0(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}},r=this.createTooltipFeature(i,n);if(r)return e.createBean(r,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=dt(t.tooltipField)||dt(t.tooltipValueGetter)||dt(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},ede=class extends _te{createTooltipComp(e,t){const n=mee(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}},ML={moduleName:"Tooltip",version:ut,beans:[Qce],dynamicBeans:{tooltipFeature:bM,highlightTooltipFeature:Rte,tooltipStateManager:ede},userComponents:{agTooltipComponent:Ite},dependsOn:[Uv],css:[Jce]},ud=class{constructor(e){this.cellValueChanges=e}},S0=class extends ud{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},tde=10,NL=class{constructor(e){this.actionStack=[],this.maxStackSize=e||tde,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}},nde=class extends We{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&&yN(this.activeCellEdit,t),s=this.activeRowEdit!==null&&Roe(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:u}=e,c={rowPinned:i,rowIndex:r,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 NL(n),this.redoStack=new NL(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.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:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[s],o),i instanceof S0?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:i,columnId:r}=s,a={rowIndex:o,rowPinned:i},l=ua(this.beans,a);l.displayed&&l.setDataValue(r,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const i=s.startRow,r=s.endRow;o===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},i=ua(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:i,rangeSvc:r}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const u={rowIndex:t,column:a,rowPinned:s};i.setFocusedCell({...u,forceBrowserFocus:!0}),r==null||r.setRangeToCell(u)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new ud(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 ud(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new ud(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new S0(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&&ta(n)?e=new S0(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new ud(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 ud(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},sde=".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}",ode={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},ide=class extends Av{constructor(){super(ode,[aE]),this.eEditor=ct}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:o=>this.setAriaLabel(o.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=jm(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${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}},jv=class extends Av{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ct}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:s,eventKey:o,suppressPreventDefault:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;s?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?r="":o&&o.length===1?i?a=!1:r=o:(r=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:u}=l;(u===Oe.PAGE_UP||u===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Za()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}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()}},rde={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},ade=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return rde}getAgComponents(){return[uM]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:i}=n;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const u=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${u}`,[u]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const u=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${u}`,[u]))}}}return r.length||(r=null),i?i({value:t,cellEditorParams:n,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!dt(n)&&!dt(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Vo(e,this.includeTime??!1)}},lde=class extends jv{constructor(){super(new ade(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},ude={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},cde=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return ude}getAgComponents(){return[uM]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:i,getValidationErrors:r}=t;let a=[];if(s){const l=new Date(s),u=this.getLocaleTextFunc();if(o){const c=new Date(o);if(l<c){const d=c.toLocaleDateString();a.push(u("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const c=new Date(i);if(l>c){const d=c.toLocaleDateString();a.push(u("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!dt(n)&&!dt(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Vo(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):po(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Vo(e??null,this.includeTime??!1)??void 0}},dde=class extends jv{constructor(){super(new cde(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},hde={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},fde=class extends Av{constructor(){super(hde,[Oee]),this.eEditor=ct}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(i||60).setRows(r||10);let a;n?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Oe.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===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!dt(s)&&!dt(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let i=[];return typeof o=="string"&&t!=null&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,internalErrors:i,cellEditorParams:e}):i}},pde={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},gde=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return pde}getAgComponents(){return[Mee]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:i}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:i,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!dt(n)&&!dt(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){Za()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},mde=class extends jv{constructor(){super(new gde(()=>this.getLocaleTextFunc()))}},vde={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},yde=class extends Av{constructor(){super(vde,[jee]),this.eEditor=ct,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:i,eventKey:r}=e;if(Vn(o)){Xe(58);return}this.startedByEnter=r!=null?r===Oe.ENTER:!1;let a=!1;o.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||i===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),s.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,s=this.getValue();let o=[];if(t&&!t.includes(s)){const i=this.getLocaleTextFunc();o.push(i("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},wde={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Cde=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return wde}getAgComponents(){return[mv]}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,s=this.getValue(),o=this.getLocaleTextFunc();let i=[];return t!=null&&typeof s=="string"&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!dt(n)&&!dt(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(){Za()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=dt(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},LL=class extends jv{constructor(){super(new Cde(()=>this.getLocaleTextFunc()))}};function bde(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Sde(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function VL(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function BL(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Ede(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function _de(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Rde(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Dde(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Tde(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,i)=>{const{rowIndex:r,rowPinned:a}=i;o.forEach((l,u)=>{const{editorValue:c,pendingValue:d,sourceValue:h,state:f}=l,p=ca(l);let g=c??d;g===ci&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:u,colId:u.getColId(),colKey:u.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Ide(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else Cu(e,{persist:!0});rd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function xde(e,t){var s;const n=Gn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Fde(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(s);if(!l){Xe(12,{colKey:s});return}const c=ua(e,{rowIndex:o,rowPinned:i||null});if(!c){Xe(290,{rowIndex:o,rowPinned:i});return}if(!l.isCellEditable(c))return;i==null&&BL(e,o),VL(e,s),r==null||r.startEditing({rowNode:c,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Pde(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Ade(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function kde(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Ode={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Mde=class extends zS{constructor(e){super(Ode),this.params=e}postConstruct(){uu(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{DE(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Nde(e,{column:t},n,s,o="ui"){var u;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((u=e.rangeSvc)==null?void 0:u.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=Lde(e.gos,r),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:o==="api"?s??!1:!1}function Lde(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function E0(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,o)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Vde(e,t,n="ui"){const s=E0(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(i=>E0(e,{rowNode:t.rowNode,column:i},n))}var Kv=(e,t=!1)=>{if(e!==void 0)return ca(e)||t&&e.state==="editing"};function $L(e,t,n=!1){var s;return Kv((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var HL=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const i=e[s];if(i.data&&(Kv(t==null?void 0:t.getEdit({rowNode:i,column:n}))||Kv(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||HL(i.childrenAfterGroup,t,n))return!0}};function GL(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:HL(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function UL(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return Kv((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var Bde=class extends We{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 o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const i=$L(n,e)||GL(n,e)||UL(n,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}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)}},$de=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const i=(r=this.editModelSvc)==null?void 0:r.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const u={rowNode:s,column:l};return $L(n,u,!0)||GL(n,u)||UL(n,u)});this.applyStyle(i,a);return}this.applyStyle(i)}applyStyle(e=!1,t=!1){var o,i;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",s&&t),r.toggleCss("ag-row-batch-edit",s&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},Hde=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("top",i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("bottom",i=>s.has(i)&&o.add(i));for(const i of s)o.has(i)||n.removeEdits({rowNode:i});return o},Gde=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:o,column:r}))},Ude=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Gde(e,Hde(e,s),t)},Wde=new Set(["undo","redo","paste","bulk","rangeSvc"]),zde=new Set(["ui","api"]),WL={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},jde=new Set(Object.keys(WL)),Kde=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),qv={cancel:!0,source:"api"},qde={cancel:!1,source:"api"},cd={checkSiblings:!0},qf={force:!0,suppressFlash:!0},Yde=class extends We{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:s})=>{this.stopEditing(void 0,qv),this.createStrategy(s)});const t=Ude(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,qv):this.isEditing()&&(this.isBatchEditing()?rd(e,this.model.getEditPositions()):this.stopEditing(void 0,qde)),!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,qv)):(this.stopEditing(void 0,qv),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=zL(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=Nde(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return cle(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??cd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:i=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Gn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(jde.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const u=this.committing?WL[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,cd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Gn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,u)||this.committing&&!this.batch)||(r??!1),g=s&&!!this.shouldCancelEditing(e,n,u)||(i??!1);if(p||g){Cu(a,{persist:!0,isCancelling:g||s,isStopping:p});const b=l.getEditMap(),w=this.processEdits(b,s,o);(v=this.strategy)==null||v.stop(s,n);for(const _ of w)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const R=Gn(a,_),T=ca(_);R==null||R.refreshCell({force:!0,suppressFlash:!T})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,w=b===Oe.ENTER,_=b===Oe.ESCAPE,R=b===Oe.TAB;(w||R||_)&&(w||R?Cu(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():rd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Cu(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),n0(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:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Oe.ENTER||!a)return;const l=r?Oe.UP:Oe.DOWN;(u=this.beans.navigation)==null||u.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const r of s){const a=e.get(r);for(const l of a.keys()){const u=a.get(l),c={rowNode:r,column:l},d=ca(u);!t&&d&&!o&&(this.setNodeDataValue(r,l,u.pendingValue,void 0,n)||i.push(c))}}return i}setNodeDataValue(e,t,n,s,o="edit"){const{beans:i}=this,r=Gn(i,{rowNode:e,column:t}),a=zde.has(o)?"edit":o;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),s&&(r==null||r.refreshCell(qf)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=qf;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...Zde(e),...qf}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:i,rowModel:r}=s;ss(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.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,s={}){var d,h,f;const{beans:o,gos:i}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const u=e.sibling;u&&a.add(u);let c=e.parent;for(;c;)(d=c.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!c.parent&&c.sibling&&i.get("grandTotalRow")?a.add(c.sibling):a.add(c),c=c.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(h=Gn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Gn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const i=zL(s)==="fullRow"?Vde(o,e,t):E0(o,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,i,r;if(this.hasValidationErrors(e)){const a=Gn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(r=(i=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,i,r;const n=Gn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(rd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),id(this.beans,e,{silent:!0}),bu(this.beans),n==null||n.refreshCell(qf),t&&(n==null||n.focusCell(),(r=(i=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var s;bu(this.beans);const t=Gn(this.beans,e);t&&(t.refreshCell(qf),(s=t.rowCtrl.rowEditStyleFeature)==null||s.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,s="ui"){var a;let o;const i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof ad&&i&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,r)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!r&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const r=this.model.getEdit({rowNode:o,column:t});r&&(s=r)}const i=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return i===ci||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){ole(this,this.beans,e)}createPopupEditorWrapper(e){return new Mde(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!Kde.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Wde.has(n))return Bv(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return Bv(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return Bv(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){ale(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,cd))return;const{rowNode:s,column:o}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(s,cd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,cd);if(r!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Ft(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:s,rangeSvc:o,valueSvc:i}=this;Cu(s,{persist:!0});const r=this.model.getEditMap(!0),a=(c=(u=r.get(e))==null?void 0:u.get(t))==null?void 0:c.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ua(s,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let C=i.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&r.set(f,p)}),this.setEditMap(r),this.batch){this.cleanupEditors(),n0(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Gn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Bde(e,t)}createRowStyleFeature(e,t){return new $de(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:u,rowPinned:c,newValue:d,state:h}of e){const f=r?s.getCol(r):l?s.getCol(l):a;if(!f)continue;const p=ua(n,{rowIndex:u,rowPinned:c});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ca({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=ci),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(i,t)}onCellFocused(e){var i;const t=Gn(this.beans,e);if(!t||!this.isEditing(t,cd))return;const n=this.model.getEdit(t);if(!n||!ca(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Gn(this.beans,e)}};function Zde(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 zL(e,t){return t??e.get("editType")??"singleCell"}var jL=class extends We{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:s,beans:o}=this,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Gn(o,n));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:u,rowIndex:c,rowPinned:d}=e,h={column:u,rowNode:ua(o,{rowIndex:c,rowPinned:d})},f=r.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:i}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,i;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of n){s.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(r);continue}s.pass.push(r)}if(e)for(const r of n)$v(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(s);if(r.destroy.length>0)for(const a of r.destroy)$v(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Gn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){Cu(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);rd(this.beans,s),n0(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,i;return(i=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:i.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;rle(this.beans,i,o,r,t,s)}dispatchCellEvent(e,t,n,s){const o=Gn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=e0(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Oe.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,i)=>{o.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),i=o.pendingValue===ci?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Gn(this.beans,o);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},Xde=class extends jL{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!e0(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i:this.rowNode?s!==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:s,event:o,ignoreEventKey:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],u=[];for(const c of a)c.isCellEditable(r)&&u.push(c);if(u.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const c of u){const d={rowNode:r,column:c};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:i})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(ca(a)){s.push(r);break}}}),bu(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of s)this.dispatchRowEvent({rowNode:i},"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 s=Gn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||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,s="ui",o=!1){var h,f,p,g;const i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),u=r.isCellEditable(),c=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return u&&!o?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||id(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(u&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!c&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var i;if(n!=="editing")return;const o=Gn(this.beans,{rowNode:t,column:s});o&&!((i=o.comp)!=null&&i.getCellEditor())&&id(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},Jde=class extends jL{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:i}=e||{};return(!this.rowNode||!this.column)&&o&&i?null:this.rowNode!==o||this.column!==i}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=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:s,ignoreEventKey:o})}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:s,column:o,rowPinned:i}=e,r=ua(this.beans,{rowIndex:s,rowPinned:i}),a=t0(o),l=t.getCol(a),u=e.previousParams;if(u){const c=t0(u.column);if((u==null?void 0:u.rowIndex)===s&&c===a&&(u==null?void 0:u.rowPinned)===i)return}n!=null&&n.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,C,S,b;const i=this.beans.focusSvc.getFocusedCell();i&&(e=sd(this.beans,i)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(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(r,{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&&r.rowIndex===u.rowIndex&&r.rowPinned===u.rowPinned;c&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((C=a.comp)!=null&&C.getCellEditor())){const w=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});id(this.beans,a,{event:n,cellStartedEdit:!0,silent:w}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&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}},ol={moduleName:"EditCore",version:ut,beans:[sle,Yde],apiFunctions:{getEditingCells:Tde,getEditRowValues:Dde,getCellEditorInstances:ile,startEditingCell:Fde,stopEditing:Ide,isEditing:xde,validateEdit:Pde},dynamicBeans:{singleCell:Jde,fullRow:Xde},dependsOn:[Uv,ML],css:[sde]},Qde={moduleName:"UndoRedoEdit",version:ut,beans:[nde],apiFunctions:{undoCellEditing:_de,redoCellEditing:Rde,getCurrentUndoSize:Ade,getCurrentRedoSize:kde},dependsOn:[ol]},ehe={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:LL,agTextCellEditor:LL},dependsOn:[ol]},the={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:mde}},dependsOn:[ol]},nhe={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:lde,agDateStringCellEditor:dde},dependsOn:[ol]},she={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:ide},dependsOn:[ol]},ohe={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:yde},dependsOn:[ol]},ihe={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:fde},dependsOn:[ol]},rhe={moduleName:"CustomEditor",version:ut,dependsOn:[ol]},ahe=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,qc(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),yQ(e))}createColumns(e,t){var h,f;const n=()=>{var p;uv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,r=this.generateSelectionCols();if(vQ(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,u=(l==null?void 0:l.findDepth(e.tree))??0,c=(l==null?void 0:l.balanceTreeForAutoCols(r,u))??[];this.columns={list:r,tree:c,treeDepth:u,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!sa(v));return[...r,...g]})}updateColumns(e){var n;const t=qc(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Ni(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Ff(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var r,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!au(e))return!1;const s=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!Kc(n),i=sv(n);return o||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"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,...r,colId:OO,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new cu(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?Kc(t):void 0,o=e&&typeof e!="string"?Kc(e):void 0,i=s!==o,r=t&&typeof t!="string"?sv(t):void 0,a=e&&typeof e!="string"?sv(e):void 0,l=r!==a,u=ov(e),c=ov(t);(i||l||u!==c)&&this.beans.colModel.refreshAll(n)}destroy(){var e;uv(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 s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const i=()=>{let c;switch(o.pinned){case"left":case!0:c=e;break;case"right":c=n;break;default:c=t}c&&Mi(c,o)};(((u=this.beans.rowNumbersSvc)==null?void 0:u.getColumn(MO))?2:1)===s&&i()}};function lhe(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!Bf(a)?(Xe(59),!1):a.id===void 0?(Xe(60),!1):!0))return;const{nodes:s,source:o,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:s,source:o??"api",newValue:i})}function uhe(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function che(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function dhe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function hhe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function fhe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function phe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function ghe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function mhe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var vhe=class extends Fse{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=iv(e),this.groupSelectsDescendants=If(e),this.groupSelectsFiltered=rv(e)==="filteredDescendants",this.masterSelectsDetail=xO(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=If(e),n=iv(e),s=rv(e)==="filteredDescendants";this.masterSelectsDetail=xO(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,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 s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?qL(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:i,keepDescendants:r=!1}){var u;if(s.length===0)return 0;const{gos:a}=this;if(!au(a)&&e)return Xe(132),0;if(s.length>1&&!this.isMultiSelect())return Xe(130),0;let l=0;for(let c=0;c<s.length;c++){const d=s[c],h=dd(d);if(h.rowPinned&&!Bf(h)){Xe(59);continue}if(h.id===void 0){Xe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((u=h.childrenAfterGroup)!=null&&u.length)&&(l+=this.selectChildren(h,e,i))}return n||(s.length===1&&i==="api"&&this.selectionCtx.setRoot(dd(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(dd(s[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const i=dd(o);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):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,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!ss(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new Hf(!0,o),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==o){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!whe(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&s.set(i.parent.id,i.parent)}}),s.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,void 0,n)}),o}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 Ja(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(!ss(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ss(this.gos);let s=!1;const o=i=>{const r=this.selectRowNode(dd(i),!1,void 0,e);s||(s=r)};if(t==="currentPage"||t==="filtered"){if(!n){Sn(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);s||(s=i)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return KL(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let i=s;i<=o;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!au(t)){Xe(132);return}if(oQ(t)&&!Tf(t)){Xe(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let i=!1;if(this.getNodesToSelect(o).forEach(r=>{const a=this.selectRowNode(dd(r),!0,void 0,s);i||(i=a)}),n.selectAll=!0,ss(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(s);i||(i=r)}i&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){Sn(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(i=>{s.has(i.id)&&o.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return ss(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!au(t))return;const s="selectableChanged",o=e!==void 0,i=ss(t)&&this.groupSelectsDescendants,r=[],a=u=>{var d;if(o&&!u.group)return;if(i&&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()&&r.push(u)};if(i){if(e===void 0){const u=n.rootNode;e=u?new Hf(!1,u):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:s}),!o&&i&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}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 i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const s=yhe(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){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(!Tf(t)){Xe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const i of s){const r=n.getRowNode(i);r&&o.push(r)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function dd(e){return Bf(e)?e.pinnedSibling:e.footer?e.sibling:e}function yhe(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),KL(t,n)}function KL(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function whe(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function qL(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(qL))??!1;return t||n}var Che={moduleName:"SharedRowSelection",version:ut,beans:[ahe],apiFunctions:{setNodesSelected:lhe,selectAll:uhe,deselectAll:che,selectAllFiltered:dhe,deselectAllFiltered:hhe,selectAllOnCurrentPage:fhe,deselectAllOnCurrentPage:phe,getSelectedNodes:ghe,getSelectedRows:mhe}},bhe={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[vhe],dependsOn:[Che]};function She(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function Ehe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function YL(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function ZL(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Xe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function _he(e,t,n){var o,i;const s=Rue(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){Sn(238);return}s.setRowCount(t,n);return}Sn(28);return}(i=Gv(e))==null||i.setRowCount(t,n)}function Rhe(e){var t;return Wc(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function Dhe(e){return e.rowModel.isLastRowIndexKnown()}var The={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:She,collapseAll:Ehe}},Ihe={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:YL,resetRowHeights:ZL}},xhe={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:_he,getCacheBlockState:Rhe,isLastRowIndexKnown:Dhe}},Fhe=class extends We{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(s=>{var i;if(!s){Sn(18),t||Sn(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(i=o.current)==null?void 0:i.api:(o.api||Sn(19),o.api)}).filter(s=>!!s&&!s.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(s=>{n.push(t(s))}):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":Xe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:i,colModel:r}=s;if(t&&(n=r.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(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Ni(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Ni(s,{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()];o==null||o.setColumnWidths(Object.values(d),!1,c.finished,"alignedGridChanged");break}}const u=i.getGridBodyCtrl().isVerticalScrollShowing();for(const c of this.getAlignedGridApis())c.setGridOption("alwaysShowVerticalScroll",u)}},Phe={moduleName:"AlignedGrids",version:ut,beans:[Fhe],dependsOn:[ON]},Ahe=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},XL(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=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 o=XL(this.rootNode),i=new Array(e.length);o._leafs=i;let r=0;const a=s==null?void 0:s.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=r,i[r++]=v,l&&!l.has(g)){l.add(g),v.treeParent=c;const C=a(g);C&&u(v,C)}}};u(o,e),i.length=r}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=jc(s),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,u=[],c=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const w=S.sourceRowIndex;d=w<=h,h=w}S.data!==b&&(S.updateData(b),r.has(S)||a.add(S),!S.selectable&&S.isSelected()&&u.push(S))},g=(S,b,w)=>{for(let _=0,R=b.length;_<R;++_){const T=b[_];if(!T)continue;let I=this.getRowNode(o({data:T,level:w}));if(I?(p(I,T),f||(f=!!c&&I.treeParent!==S)):(I=this.createRowNode(T,w),r.add(I)),!c||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const x=c(T);x&&g(I,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,u)||d||r.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?Lhe(S,l,i):Nhe(S,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(u))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,i=s.length;o<i;o++){const r=s[o];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Xe(268),{remove:[],update:[],add:[]};const n=[],s=jc(this.gos),o=this.executeRemove(s,e,t,n),i=this.executeUpdate(s,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},i){const r=this.rootNode._leafs,a=r==null?void 0:r.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()&&i.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[u++]=g}return f.length=u,u&&Mhe(r,c,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const u=t[l],c=this.lookupNode(e,u);c&&(c.updateData(u),!c.selectable&&c.isSelected()&&o.push(c),r[a++]=c,n.has(c)||s.add(c))}return r.length=a,r}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=o+r;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const u=new Array(r),c=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);c.add(h),h.sourceRowIndex=l,s[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 s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.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 Ja(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&Xe(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return Ohe(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(Sn(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 s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=khe(e,t)),t}},khe=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},XL=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=s,i.childrenAfterFilter=o,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Ohe=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return Sn(5,{data:t}),null},Mhe=(e,t,n,s,o)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Nhe=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===s?i||(i=o):(a>=0?i=!0:o=!0,r.sourceRowIndex=s,e[s]=r),++s}return i},Lhe=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let i=0;for(let r=0;r<o;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of s)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},JL=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const i=t[s],r=s===0,a=s===o;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==s&&(i.childIndex=s,i.dispatchRowEvent("childIndexChanged"))}},Vhe=class extends We{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,s){const{gos:o,colModel:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:u}=this.beans,c=o.get("groupMaintainOrder"),d=i.getCols().some(S=>S.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var R,T;const b=f&&S.leafGroup;let w=c&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let _=null;if(w){let I=!1;if(h){const x=S.level+1;x<h.length&&(I=h[x].getSort()===null)}I||(_=Hhe(S))}else!e.length||b||(t&&n?_=Bhe(a,S,n,s,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((R=S.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==_[0]),S.childrenAfterSort=_,JL(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.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(gr(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Bhe=(e,t,n,s,o)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,o);const a=new Set,l=[],{updates:u,adds:c}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];u.has(p)||c.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),$he(e,o,l,d)},$he=(e,t,n,s)=>{let o=0,i=0;const r=n.length,a=s.length,l=new Array(r+a);let u=0;for(;o<r&&i<a;){const c=n[o],d=s[i];e.compareRowNodes(t,c,d)<0?(l[u++]=c.rowNode,++o):(l[u++]=d.rowNode,++i)}for(;o<r;)l[u++]=n[o++].rowNode;for(;i<a;)l[u++]=s[i++].rowNode;return l},Hhe=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const i=new Array(o),r=new Set;for(let l=0;l<o;++l)r.add(n[l]);let a=0;for(let l=0;l<s;++l){const u=t[l];r.delete(u)&&(i[a++]=u)}if(r.size===0&&a===s)return t;for(const l of r)i[a++]=l;return i.length=a,i},Ghe=class extends We{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=As(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new Ja(e);this.rootNode=t,this.nodeManager=this.createBean(new Ahe(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,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(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var i;const o=(i=s.changeSet)==null?void 0:i.properties;o&&this.onPropChange(o)}),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,s){let o,i=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),u=Math.min(a,s);for(let c=l;c<=u;c++){const d=this.getRow(c);if(d.rowHeightEstimated){const h=Ka(this.beans,d);d.setRowHeight(h.height),o=!0,i=!0}}o&&this.setRowTopAndRowIndex()}while(o);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const i=new Set(e),r=o==null?void 0:o.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,Xe(1));const l={step:"nothing",changedProps:i};a&&(!r&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new Ov,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,s=t.length;let o=s;for(let i=0,r=e.length;i<r&&o;++i)o=Math.min(o,n.get(e[i])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const i=ks(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],u=l.id;if(u!=null&&(e==null||e.add(u)),l.rowHeight==null){const c=Ka(t,l,i,s);l.setRowHeight(c.height,c.estimated)}l.setRowTop(o),l.setRowIndex(r),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{s(r),s(r.detailNode),s(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let c=0,d=a.length;c<d;++c)o(a[c])},i=this.rootNode;i&&o(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,i;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let u=i[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(s,e,i,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let i=o.parent;for(;i&&i!==t;)o=i,i=o.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return r>=0?r: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:zc(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:zc(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:zc(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new Hf(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var u,c;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(o&&r&&s.dispatchEvent({type:"rowDataUpdated"}),!o||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(u=n.masterDetailSvc)==null||u.refreshModel(e),r&&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,s.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,s=!1;const o=[],i=If(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(n&&(r===t||r===e)&&(s=!0,i&&r.group)){QL(o,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(s=!0)}(!r.group||!i)&&o.push(r)}),o}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 s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let r=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),u=t[l];if(this.isRowInPixel(u,e)||(u.rowTop<e?s=l+1:u.rowTop>e&&(o=l-1),r===s&&a===o))return l;r=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++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:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,s=this.rootNode,o=0){let i=o;if(!s)return i;const r=s===this.rootNode;if(r||e(s,i++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,s,e,t,r,"top"))??i;for(const u of a)i=this.depthFirstSearchRowNodes(e,t,n,u,i);return(l==null?void 0:l.addTotalRows(i,s,e,t,r,"bottom"))??i}}return i}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(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),JL(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.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,yL(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(gE)===0?(o=this.beans.groupStage)==null?void 0:o.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:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],i=[],r=new Ov;for(const{rowDataTransaction:l,callback:u}of s??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(l,r);o.push(c),u&&i.push(u.bind(null,c))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,u=i.length;l<u;l++)i[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new Ov,s=t.updateRowData(e,n);return this.commitTransactions(n),s}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 s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}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 s=t.sibling;s==null||s.setRowHeight(s.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()}},QL=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const i=n[s];i.data&&e.push(i),i.group&&QL(e,i)}};function Uhe(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Whe(e,t){const n=sl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function zhe(e){var t;return((t=sl(e))==null?void 0:t.isEmpty())??!0}function jhe(e,t){var n;(n=sl(e))==null||n.forEachLeafNode(t)}function Khe(e,t){var n;(n=sl(e))==null||n.forEachNodeAfterFilter(t)}function qhe(e,t){var n;(n=sl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function Yhe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=sl(e))==null?void 0:n.updateRowData(t)})}function Zhe(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=sl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function Xhe(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=sl(e))==null?void 0:t.flushAsyncTransactions()})}function Jhe(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var eV={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[Ghe,Vhe],dependsOn:[uL]},Qhe={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:Uhe,refreshClientSideRowModel:Whe,isRowDataEmpty:zhe,forEachLeafNode:jhe,forEachNodeAfterFilter:Khe,forEachNodeAfterFilterAndSort:qhe,applyTransaction:Yhe,applyTransactionAsync:Zhe,flushAsyncTransactions:Xhe,getBestCostNodeSelection:Jhe,resetRowHeights:ZL,onRowHeightChanged:YL},dependsOn:[The,Ihe]},efe=class extends We{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:s,skipRowGroups:o,exportRowNumbers:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,u=!!s.footer,c=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&nQ(this.gos,s);if(!l&&!u&&(t.skipRowGroups||c||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!u||o(Ft(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Ft(this.gos,{node:s}));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 s=new jO,{colGroupSvc:o}=this.beans,i=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,i)=>{s.onColumn(o,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var u;const s=this.rowModel,o=ss(this.gos),i=Wc(this.gos),r=!o&&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=>s.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const c=((u=this.beans.selectionSvc)==null?void 0:u.getSelectedNodes())??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?s.forEachNode(a):o||i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):o(i.parent,r.parent):i.level>r.level?o(i.parent,r):o(i,r.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),u=h=>sa(h)?!1:!oa(h)||s;if(o!=null&&o.length)return i.getColsForKeys(o).filter(u);const c=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>u(h)&&(n&&!c?!HS(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const i=o;if(i.getChildren)for(const r of i.getChildren()??[])s.push(r)}e.length>0&&os(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const i of t){const r=i;let a;n?a=n(Ft(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const u=(r.isExpandable()?r.getLeafColumns():[]).reduce((c,d,h,f)=>{let p=Rn(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},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,u)}}},tfe={moduleName:"SharedExport",version:ut,beans:[efe]},tV=`\r
206
- `,nfe=class extends Pue{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,tV),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==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,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}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 s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.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():(Xe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=tV),this.isFirstLine=!1}},sfe=class extends Fue{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()){Xe(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;Aue(this.getFileName(o),s)}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:s,valueSvc:o,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u,suppressQuotes:c,columnSeparator:d}=e;return new nfe({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function ofe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function ife(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var rfe={moduleName:"CsvExport",version:ut,beans:[sfe],apiFunctions:{getDataAsCsv:ofe,exportDataAsCsv:ife},dependsOn:[tfe]},afe=class extends We{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:s,rowNodes:o}=this;for(let i=0;i<e;i++){const r=n+i,a=new Ja(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Xe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,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((o,i)=>{const r=e.rowData?e.rowData[i]:void 0;!o.id&&o.alreadyRendered&&r&&(t[i]=new Ja(n),t[i].setRowIndex(o.rowIndex),t[i].setRowTop(o.rowTop),t[i].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},lfe=2,ufe=class extends We{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 s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new afe(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()&&(ja(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,i=lfe-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,u=s?a>=o:!1;if(l||u){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}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:s}=this.params,i=(e.id+1)*n+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,dt(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,s)=>n.id-s.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 s=-1,o=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&s+1!==l.id){r=!0;continue}s=l.id,l.forEachNode(u=>{const c=u===e||u===t;(o||c)&&n.push(u),c&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},cfe=class extends We{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 Ja(e);this.rootNode=t,t.level=-1,this.rowHeight=lu(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=lu(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!ff(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;jc(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:s,eventSvc:o,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:lu(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new ufe(this.cacheParams)),o.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 dfe(e){var t;(t=Gv(e))==null||t.refreshCache()}function hfe(e){var t;(t=Gv(e))==null||t.purgeCache()}function ffe(e){var t;return(t=Gv(e))==null?void 0:t.getRowCount()}var pfe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=sQ(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=As(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Mi(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){ja(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:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){ja(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},gfe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[cfe,pfe]},mfe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:dfe,purgeInfiniteCache:hfe,getInfiniteRowCount:ffe},dependsOn:[gfe,xhe]},vfe="↑",yfe="↓",wfe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Cfe=class extends yn{constructor(){super(wfe),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=dt(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=vfe+o:r.textContent=yfe+o,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}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"),Ps(this.eDelta)}refresh(e,t=!1){var u;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:Ps(o),(u=r.filterManager)!=null&&u.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return i&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},bfe=".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}",Sfe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Efe=class extends yn{constructor(){super(Sfe),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(bfe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=is({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:Ps(s),!0}},_fe=class extends We{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"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const i=Date.now(),r=i+n,a=i+n+s,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.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&&r+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=r)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,i=`${o}-animation`;for(const[r,a]of s){if(!r.isAlive()||!r.comp){s.delete(r);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}}=r;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(i,!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(o,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(r);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=Eoe(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 Rfe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var Dfe={moduleName:"HighlightChanges",version:ut,beans:[_fe],userComponents:{agAnimateShowChangeCellRenderer:Cfe,agAnimateSlideCellRenderer:Efe},apiFunctions:{flashCells:Rfe}};function Tfe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Ife(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function nV(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=xfe(e)),e.version=ut,e}function xfe(e){return e.cellSelection=Ffe(e,"rangeSelection"),e}function Ffe(e,t){if(e&&typeof e=="object")return e[t]}var Pfe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=As(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=As(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=As(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=ss(e);const s=nV(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:u})=>{u==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=nV(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.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,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);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:s,rowGroupExpansion:o,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(c,d)=>!(n!=null&&n.has(c))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(i,o,t),l("rowSelection",r)&&this.setRowSelectionState(r,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))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.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:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Tue(dv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const k=!(s!=null&&s.has(D))&&!!(F||t==="api");return h||(h=k),k},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:D,sort:F},k)=>{const O=g(D);O.sort=F,O.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",i);S&&(i==null||i.groupColIds.forEach((D,F)=>{const k=g(D);k.rowGroup=!0,k.rowGroupIndex=F})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",r);b&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((D,F)=>{const k=g(D);k.pivot=!0,k.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(_||!n)&&(v.pinned=null);const R=f("columnVisibility",u);if(R)for(const D of(u==null?void 0:u.hiddenColIds)??[])g(D).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",c);if(T)for(const{colId:D,flex:F,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const O=g(D);O.flex=F??null,O.width=k}(T||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,x=!!(I!=null&&I.length)&&!(s!=null&&s.has("columnOrder")),P=x?I.map(D=>g(D)):Object.values(p);(P.length||h)&&(this.columnStates=P,Ni(this.beans,{state:P,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:i,colGroupSvc:r}=o;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Ni(o,{state:a,applyOrder:e},t)}s&&(r==null||r.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Iue(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=s.getColumnGroupState().map(({groupId:l})=>{const u=o.has(l);return u&&o.delete(l),{groupId:l,open:u}});for(const l of o)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),s.setColumnGroupState(r,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(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:i,endRow:r,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:s,visibleCols:o}=this.beans;if(!ta(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of r.colIds){const c=s.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const u=o.allCols,c=new Set(a);l=u.find(d=>c.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}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:s,rowRenderer:o,animationFrameSvc:i,ctrlsSvc:r}=this.beans;s.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),i==null||i.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:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:i}=e??{page:0,pageSize:s.get("paginationPageSize")},r=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.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 s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const i=t[o];ff(i,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),ff(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")}},Afe={moduleName:"GridState",version:ut,beans:[Pfe],apiFunctions:{getState:Tfe,setState:Ife}};function kfe(e){return e.rowModel.isLastRowIndexKnown()}function Ofe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Mfe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Nfe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Lfe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Vfe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Bfe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function $fe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Hfe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Gfe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Ufe=class extends We{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 s=Math.max(lu(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?As(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Yf="paginationPageSizeSelector",Wfe={tag:"span",cls:"ag-paging-page-size"},zfe=class extends yn{constructor(){super(Wfe),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(Yf,()=>{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(){Ps(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(Yf)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),i=this.gos.get(Yf)!==!0;Xe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||Xe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Yf}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(Ya(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new uE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Yf);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},jfe={selector:"AG-PAGE-SIZE-SELECTOR",component:zfe},Kfe=".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}",qfe=class extends fN{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Kfe)}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(),[jfe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",li(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",li(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",li(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",li(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:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):Une(this.beans,i),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:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Gne(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}):xue(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 s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){sJ(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(),s=e?n:null,o=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*o+1,a=r+i-1,e&&a>s&&(a=s));const l=r+i-1,u=!e&&n<l,c=this.formatNumber(r);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?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(c,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${r} ${s} ${l} ${o}`;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"))}},Yfe={selector:"AG-PAGINATION",component:qfe},Zfe=class extends We{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 Yfe}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,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.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 dt(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:dt(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:dt(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:dt(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,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,i=n*o;let r=n*(o+1)-1;if(r>s&&(r=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+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,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}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:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},Xfe={moduleName:"Pagination",version:ut,beans:[Zfe,Ufe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:kfe,paginationGetPageSize:Ofe,paginationGetCurrentPage:Mfe,paginationGetTotalPages:Nfe,paginationGetRowCount:Lfe,paginationGoToNextPage:Vfe,paginationGoToPreviousPage:Bfe,paginationGoToFirstPage:$fe,paginationGoToLastPage:Hfe,paginationGoToPage:Gfe},dependsOn:[Uv]};function Jfe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function sV(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&sV(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function Qfe(e,t){return e.rowModel.getRowNode(t)}function epe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function tpe(e){return e.rowRenderer.getRenderedNodes()}function npe(e,t,n){e.rowModel.forEachNode(t,n)}function spe(e){return e.rowRenderer.firstRenderedRow}function ope(e){return e.rowRenderer.lastRenderedRow}function ipe(e,t){return e.rowModel.getRow(t)}function rpe(e){return e.rowModel.getRowCount()}var ape={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:Jfe,setRowNodeExpanded:sV,getRowNode:Qfe,addRenderedRowListener:epe,getRenderedNodes:tpe,forEachNode:npe,getFirstDisplayedRowIndex:spe,getLastDisplayedRowIndex:ope,getDisplayedRowAtIndex:ipe,getDisplayedRowCount:rpe}},lpe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:bde,getHorizontalPixelRange:Sde,ensureColumnVisible:VL,ensureIndexVisible:BL,ensureNodeVisible:Ede}};function upe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function cpe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function dpe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function hpe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function fpe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function ppe(e){return{rowHeight:lu(e),headerHeight:Nf(e)}}function gpe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(kf(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=r0(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!a0(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&s.push(kf(u))}}return[...s,...n]}var mpe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:upe,refreshCells:cpe,refreshHeader:dpe,isAnimationFrameQueueEmpty:hpe,flushAllAnimationFrames:fpe,getSizesForCurrentTheme:ppe,getCellRendererInstances:gpe}};function vpe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function oV({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function ype(e,t){var n;t&&typeof t=="object"?oV(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var wpe=class extends We{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 s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&ss(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var u;const o=c=>Yc(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=iV(this.beans),r=c=>n.leftCols.some(d=>Ff(d,c)),a=c=>n.rightCols.some(d=>Ff(d,c)),l=e.colKeys.filter(c=>!sa(c)&&!oa(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(i,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}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:i,stopAtGroup:r,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 C=-1;const S=Object.fromEntries(u.map(({colId:_,...R})=>[_,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=i??b;for(;C!==0;){C=0;const _=[];for(const R of s){if(!R||mQ(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const I=p.getPreferredWidthForColumn(T,b);if(I>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const P=Cpe(T,I,x);T.setActualWidth(P,c),v.add(T),C++}_.push(T)}_.length&&g.refresh(c)}w||this.autoSizeColumnGroupsByColumns(s,c,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,i=new Set,r=s.getColsForKeys(e);for(const l of r){let u=l.getParent();for(;u&&u!=n;)u.isPadding()||i.add(u),u=u.getParent()}let a;for(const l of i){for(const u of o.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"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new yu(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=iV(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):Xe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=na(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),_=C.getActualWidth();return(b==null||_>=b)&&(w==null||_<=w)}))return;const l=[],u=[];for(const v of i){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Ff(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{Mi(l,v),u.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-na(u);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/na(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],_=o==null?void 0:o[w.getId()],R=(_==null?void 0:_.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(_==null?void 0:_.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),P=typeof R=="number"&&R>I?R:I,D=typeof T=="number"&&T<x?T:x;let F=Math.round(w.getActualWidth()*C);F<P?(F=P,h(w),d=!1):F>D?(F=D,h(w),d=!1):b===0&&(F=S),w.setActualWidth(F,t,!0),S-=F}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Yc(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 s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:i,defaultMaxWidth:r}=n,a=o==null?void 0:o.map(({colId:l,minWidth:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.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 Cpe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function iV({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return yf(n.eGridBody)-o}var bpe={moduleName:"ColumnAutoSize",version:ut,beans:[wpe],apiFunctions:{sizeColumnsToFit:vpe,autoSizeColumns:oV,autoSizeAllColumns:ype},dependsOn:[FN]},Spe=".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 Epe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function _pe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Rpe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function Dpe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function Tpe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var Ipe={moduleName:"PinnedRow",version:ut,beans:[Rse],css:[Spe],apiFunctions:{getPinnedTopRowCount:Epe,getPinnedBottomRowCount:_pe,getPinnedTopRow:Rpe,getPinnedBottomRow:Dpe,forEachPinnedRow:Tpe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},xpe=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 s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},Fpe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:i,pagination:r}}=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 C=(w,_)=>{p=w,g=null,v=_},S=w=>{const _=!w.isExpandable()&&!w.group&&!w.detail&&(c?!c({rowNode:w}):!0);if(w.rowIndex==null||!_){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,i.getValue(t,w));return}const R=i.getValue(t,w);if(f){const T=Ft(n,{valueA:v,nodeA:p,valueB:R,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,R);return}}else if(d?!d(v,R):v!==R){C(w,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new xpe(t,p),u.set(p,g)}g.addSpannedNode(w),u.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!r||r.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=u;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":s==null||s.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}}},Ppe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=As(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=As(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 Fpe(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,s=e.column,o=e.rowIndex,i=this.spanningColumns.get(s);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(o);break;default:r=n.getRow(o)}if(r)return i.getCellSpan(r)}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,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},Ape=class extends ad{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,s,o,i,r){this.eWrapper=n,super.setComp(e,t,n,s,o,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||zm(e,t.rowIndex)}setAriaRowSpan(){lJ(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(Pv(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}},kpe=class extends Hv{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new Ape(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Ope=class extends We{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),s=n.size,o=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(u,c)=>{if(i.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){i.set(c.firstNode,d),n.delete(c.firstNode);return}r=!0;const h=new kpe(c.firstNode,this.beans,!1,!1,!1);i.set(c.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===s;if(!(!r&&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 s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.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")}},Mpe={moduleName:"CellSpan",version:ut,beans:[Ppe,Ope]},Npe=class extends We{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,s=n.cellClassRules,o=this.getCellClassParams(e,n);o0(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const i of o)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},Lpe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){o0(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new Npe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},Vpe={moduleName:"CellStyle",version:ut,beans:[Lpe]},Bpe={moduleName:"RowStyle",version:ut,beans:[Rle]};function $pe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var Hpe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:i,columns:r}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),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}},Gpe="ag-column-hover",Upe=class extends We{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 s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(Gpe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new Hpe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},Wpe={moduleName:"ColumnHover",version:ut,beans:[Upe],apiFunctions:{isColumnHovered:$pe}},zpe=class extends We{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 i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,s=!Vv.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{Vv.has(r)&&t(r,a)},s=(r,a)=>{Vv.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:r,asyncListener:a}=s.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,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:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function jpe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function Kpe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function qpe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function Ype(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var Zpe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:jpe,addGlobalListener:qpe,removeEventListener:Kpe,removeGlobalListener:Ype},beans:[zpe]},Xpe={moduleName:"Locale",version:ut,beans:[Due]},Jpe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=As(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:s}=this.beans,o=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=Ka(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),i=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",r),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",r),(u=t.forEachDisplayedNode)==null||u.call(t,r),i&&((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 s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=o.getLeftColsForRow(t);break;case"right":i=o.getRightColsForRow(t);break;case null:i=s.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:i}=e,r=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}=ru(s),g=d+h+f+p,C=t.offsetHeight+g;if(c<5){const b=Rs(r),w=!(b!=null&&b.contains(t)),_=C==0;if(w||_){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(o,C,i)},l=()=>a(0);l();const u=Wa(r,t,l);return n.addDestroyFunc(()=>{u(),this.setRowAutoHeight(o,void 0,i)}),!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(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},Qpe={moduleName:"RowAutoHeight",version:ut,beans:[Jpe]},ege={moduleName:"AllCommunity",version:ut,dependsOn:[eV,rfe,mfe,Wue,ehe,the,nhe,she,ohe,ihe,rhe,Qde,jce,Kce,qce,zce,Zce,Xce,Afe,Phe,Xfe,ON,ape,lpe,mpe,bpe,Boe,Ipe,bhe,aue,Vpe,Wpe,Bpe,Zpe,cue,Dfe,ML,Xpe,Qpe,Voe,Qhe,Mpe]};const tge=rt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,s=Y(()=>{const h=Yn();return h==null?void 0:h.appContext.config.globalProperties.apiServices}),o=t,i=V(!1),r=V(null),a=h=>{i.value=!1,o("updated",h)},l=Y(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId}));Zi("bulkUpdate",!0);const u=(h,f)=>{console.trace("Status update button setLoading called with value:",h,"hide:",f),i.value=h,o(h?"update-start":"update-completed"),setTimeout(()=>{var p,g;f?(p=r.value)==null||p.hide():(g=r.value)==null||g.open()},300)},c=V(null),d=(h,f)=>{var p;h&&((p=c.value)==null||p.focus())};return(h,f)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:r,isUpdating:i.value,disabled:n.disabled||i.value,onOnVisibleChange:d},{trigger:ge(({hide:p,disabled:g})=>[fe(mt,{variant:n.variant,loading:i.value,disabled:g,onEscape:p},{default:ge(()=>[fe(lt,{src:"Square",class:"icon"}),f[3]||(f[3]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({hide:p,isVisible:g})=>[Ke(fe(Bk,Xt({disabled:i.value,ref_key:"statusRef",ref:c},l.value,{onUpdated:a,onCancel:p,onStartUpdate:f[0]||(f[0]=v=>u(!0,!0)),onFinishUpdate:f[1]||(f[1]=v=>u(!1,!0)),onError:f[2]||(f[2]=()=>{u(!1,!1)}),callback:()=>u(!1,!0)}),null,16,["disabled","onCancel","callback"]),[[To,g]])]),default:ge(()=>[f[4]||(f[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),rV=_t(rt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const s=Ur,o=e,i=Y(()=>(o==null?void 0:o.workspaceId)||""),r=Y(()=>(o==null?void 0:o.entityId)||""),a=()=>{var O,B,Z;return(Z=(O=o.params)==null?void 0:O.api)==null?void 0:Z.getCellRendererInstances({columns:["options"],rowNodes:(B=o.params)!=null&&B.node?[o.params.node]:[]})[0]},l=()=>{var B,Z,J,ee;const O=a();(Z=(B=O==null?void 0:O.componsenExposed)==null?void 0:B.blur)==null||Z.call(B),(ee=(J=O==null?void 0:O.container)==null?void 0:J.parentElement)==null||ee.classList.remove("ag-cell-focus")},u=()=>{var Z,J,ee;(J=(Z=o.params)==null?void 0:Z.api)==null||J.stopEditing(),l();const O=`scene-name-${o.id}`,B=document.getElementById(O);(ee=B==null?void 0:B.__sceneNameEditor)==null||ee.startEdit()},{apiServices:c}=ts(!0,o),d=Y(()=>{var O;return{ws_code:i.value,entity_id:r.value,scene_id:o.id,axiosService:c,optionBlock:o.optionBlock,permissions:(O=o.data)==null?void 0:O.permissions}}),h=O=>{var Z,J,ee,X,ve,ne;let B=(J=(Z=o.params)==null?void 0:Z.api)==null?void 0:J.getRowNode(String(o.id));if(B){const L={...B.data,isDeleted:O==="deleted",isArchived:O==="archived"?!0:B.data.isArchived,isLocked:O==="locked"?!0:B.data.isLocked,disabled:!1};O=="deleted"&&(L.isLocked=!1,L.disabled=!0),O=="unarchived"&&(L.isArchived=!1),(X=(ee=o.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[B]}),B.setData(L),(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.redrawRows({rowNodes:[B]})}},f=tf(),{openSceneHub:p}=f,g=()=>{Ct(()=>{var Z,J,ee,X,ve,ne;const O=((J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex)||0,B=((X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId())||"";(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.setFocusedCell(O,B)})};Y(()=>{var B,Z;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return O==null?void 0:O.data});const{options:v}=pY(d,h,u,p,g),C=n,S=()=>{var O,B,Z,J,ee,X;console.trace("Focusing current cell for row:",o.id),(X=(O=o.params)==null?void 0:O.api)==null||X.setFocusedCell(((Z=(B=o.params)==null?void 0:B.node)==null?void 0:Z.rowIndex)||0,((ee=(J=o.params)==null?void 0:J.column)==null?void 0:ee.getColId())||"")},b=Y(()=>{var O;return(O=o.params)==null?void 0:O.api}),w=(O,B)=>{var Z,J,ee,X,ve,ne,L,H;if(C("actionExecuted",O),O.id=="copy-link"){(ve=b.value)==null||ve.startEditingCell({rowIndex:(J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex,colKey:(X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId()});return}else{if(O.id!=="copy-link"&&((ne=b.value)==null||ne.stopEditing()),O.id==="rename")(L=b.value)==null||L.stopEditing(),(H=b.value)==null||H.clearFocusedCell(),l();else if(O.id==="copy-link"){const te=document.getElementById(B);setTimeout(()=>{var he,me,re;(re=(me=(he=te==null?void 0:te.__vueParentComponent)==null?void 0:he.exposed)==null?void 0:me.focus)==null||re.call(me)},300)}else if(["delete-rendition","delete-thumbnail"].includes(O.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var te,he;(he=(te=o.params)==null?void 0:te.api)==null||he.clearFocusedCell()},300)}},_=()=>{var O,B;(B=(O=o.params)==null?void 0:O.api)==null||B.stopEditing()},R=O=>{var B,Z,J,ee;return O==="archive"?!((Z=(B=o.params)==null?void 0:B.data)!=null&&Z.isArchived):O==="unarchive"?(ee=(J=o.params)==null?void 0:J.data)==null?void 0:ee.isArchived:!0},T=Y(()=>v.value.map(O=>({...O,options:O.options.filter(B=>!B.hide&&R(B.id))})).filter(O=>O.options.length>0)),I=V({}),x=V(null),P=Y(()=>{var B,Z;if(o.focusableIndex)return o.focusableIndex;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return`${((O==null?void 0:O.rowIndex)??0)+10}`}),D=(O,B)=>`${P.value}.${O*10+B}`,F=(O,B)=>{if(B&&"focus"in B){I.value[O]=B;return}delete I.value[O]},k=O=>{O.preventDefault(),O.stopPropagation(),O.stopImmediatePropagation()};return nn(()=>{var O;(O=x.value)==null||O.focus()}),t({focus(){var Z;const O=`${P.value}.0`,B=I.value[O];B&&B.focus?B.focus():(Z=x.value)==null||Z.focus()}}),(O,B)=>Ke((j(),ue("div",{onKeydown:k,class:Q([O.$style["more-option-section"],{[O.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:x,tabindex:"0",role:"menu"},[(j(!0),ue(xt,null,xn(T.value,(Z,J)=>(j(),ue("div",{key:Z.id,style:dn({"--g-number":Math.min(Z.options.length,4),"--g-size":Z.type==="column"?"36px":"auto"}),class:Q([O.$style["option-block"],O.$style[Z.type]])},[(j(!0),ue(xt,null,xn(Z.options,(ee,X)=>(j(),ue("div",{key:ee.id,class:Q(O.$style["option-item"])},[fe(sge,{layer:o.layer,"scene-id":String(o.id),option:ee,type:Z.type,onActionExecuted:ve=>w(ve,`more-action-${ve.id}-${o.id}`),focusableIndex:D(J,X),ref_for:!0,ref:ve=>F(D(J,X),ve),onHandleHide:_,id:`more-action-${ee.id}-${o.id}`,label:ee.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[U(s),P.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"}}]]),nge={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},sge=_t(rt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Ur,o=Jt,i=e,r=V(!1),a=V(!1),l=(I,x)=>{if(!x){p();return}const P=x.target;P.closest(".tippy-content")||P.closest(".tippy-box")||P.closest("[data-tippy-root]")||P.closest(".option-item")||p()},u=V(null),{triggerRef:c,popupRef:d,show:h,isVisible:f,hide:p}=Fs({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 I=>{var x,P;if(!a.value){a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,r.value=!1}}},C=async I=>{var x,P;if(I.preventDefault(),I.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},S=I=>{g("actionExecuted",I),p()},b=I=>{I.key==="Escape"&&p()},w=I=>({row:"small",column:"medium",block:"small"})[I]||"medium",_=I=>{const x=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...x],column:["menu-item",...x],block:["secondary",...x]}[I]||[]},R=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{Ct(()=>{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:()=>{C(new MouseEvent("click"))}});const T=I=>{var x;I.stopPropagation(),I.preventDefault(),r.value=!1,(x=c.value)==null||x.focus()};return(I,x)=>{var P;return Ke((j(),ue("div",{ref_key:"wrapperRef",ref:u,class:Q(I.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(C,["stop","prevent"])},[Ke((j(),qe(mt,{ref_key:"triggerRef",ref:c,class:Q(I.$style["option-item"]),disabled:e.option.disabled||a.value,actived:U(f)||r.value,size:w(e.type),variant:_(e.type),onClick:Pt(C,["stop","prevent"]),onKeydown:b,onEscape:R,label:e.option.label},{prefix:ge(()=>[e.option.icon?(j(),ue("div",nge,[fe(lt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Je("",!0)]),suffix:ge(()=>[e.option.subMenu?(j(),qe(lt,{key:0,src:"Play",source:"remote"})):Je("",!0),e.option.isDanger&&r.value?(j(),ue("div",{key:1,class:Q(I.$style["confirm-action"])},[Ke((j(),qe(mt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.0`],[U(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((j(),qe(mt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:x[0]||(x[0]=D=>r.value=!1)},{default:ge(()=>[fe(lt,{src:"Check",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.1`],[U(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Je("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[U(s),i.focusableIndex]]),e.option.subMenu?(j(),ue("div",{key:0,ref_key:"popupRef",ref:d,class:Q(I.$style["submenu-container"])},[fe(rV,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((P=e.option)==null?void 0:P.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Je("",!0)],2)),[[U(o),{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"}}]]),oge={style:{"max-width":"225px","line-height":"14px"}},ige={style:{"max-width":"100px","line-height":"14px"}},rge=_t(rt({__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"],setup(e,{emit:t}){const n=Jt,s=Ur,o=e,i=t,r=Wm(),{handelSelectAll:a}=r,{selectionStatus:l}=Qs(r),u=Y(()=>l.value===Vt.CHECKED),c=Y(()=>o.selectRowData.map(me=>me.id)),d=Y(()=>o.selectRowData.length>0);Zi("bulkUpdate",d),Zi("isSelectAll",u);const h=({itemIds:me,data:re})=>{const oe=o.gridApi;me.forEach(z=>{if(!oe){console.error("Grid API is undefined");return}const pe=oe.getRowNode(z);if(pe){const ie={...pe.data,status:re};pe.setData(ie)}})},f=Y(()=>o.selectRowData),p=({itemIds:me,data:re})=>{const oe=o.gridApi;if(!oe){console.error("Grid API is undefined");return}me.forEach(z=>{const pe=oe.getRowNode(z);if(pe){const ie=pe.data.dateRange||[null,null];"startDate"in re&&re.startDate!==void 0&&(ie[0]=re.startDate?new Date(re.startDate):null),"dueDate"in re&&re.dueDate!==void 0&&(ie[1]=re.dueDate?new Date(re.dueDate):null);const be={...pe.data,dateRange:ie};pe.setData(be)}}),i("updated")},g=Y(()=>o.selectRowData.map(me=>me.id)),v=me=>{const re=o.gridApi,{id:oe,value:z}=me;if(!re){console.error("Grid API is undefined");return}g.value.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,[`metric_${oe}`]:z};ie.setData(be)}}),i("updated")},C=["primary"],S=[{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}],b=()=>{i("unselect")},w=Qb(),{userPermissions:_}=Qs(w),R=Y(()=>_.value.includes(eS)),T=Y(()=>{if(!R.value){console.error("User does not have permission to open review.");return}if(l.value==Vt.CHECKED)return co({type:"review_take",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,take_id:o.entityId}}).url;const me=o.selectRowData.map(oe=>oe.id).join(",");return co({type:"review_multiple_scenes",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:me}}).url}),I=me=>{console.log("Updating assignees with params:",me);const{assignees:re,type:oe}=me,z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(ie=>{const be=z.getRowNode(ie.id);if(!be)return null;const G=be.data.assignees||[];let q=[];switch(oe){case"add":{const ce=new Set(G.map(Fe=>Fe.id)),ke=re.filter(Fe=>!ce.has(Fe.id));q=[...G,...ke];break}case"overwrite":{q=re;break}case"remove":{const ce=new Set(re.map(ke=>ke.id));q=G.filter(ke=>!ce.has(ke.id));break}case"removeAll":{q=[];break}}return{...be.data,assignees:q}}).filter(ie=>ie!==null).forEach(ie=>{const be=z.getRowNode(ie.id);be&&be.setData(ie)})},{apiServices:x}=ts(!1,o),P=async()=>{var z;const me=o.selectRowData.map(pe=>pe.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk delete.");return}const oe=await((z=x.value)==null?void 0:z.bulkDeleteItems(O.value));(oe==null?void 0:oe.message)=="Done"&&(me.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,isDeleted:!0,disabled:!0};ie.setData(be)}}),re.deselectAll())},D=V(null),F=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const oe=await((z=x.value)==null?void 0:z.bulkUnarchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to unarchive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!1),(ie=D.value)==null||ie.hide()},k=_n("filterParams",void 0),O=Y(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&u.value?[]:o.selectRowData.map(me=>me.id),entityId:o.entityId,filterParams:k!=null&&k.value?k.value:void 0})),B=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const oe=await((z=x.value)==null?void 0:z.bulkArchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to archive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!0),(ie=D.value)==null||ie.hide()},Z=(me,re,oe)=>{const z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}const pe=me.map(ie=>{const be=z.getRowNode(ie);if(be){const G={...be.data,[re]:oe};be.setData(G)}return be}).filter(ie=>ie!=null);console.log("Updated row nodes:",{idsToUpdate:me,rowNodes:pe}),z.redrawRows({rowNodes:pe})},J=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk thumbnail deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteThumbnail(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete thumbnails."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,thumbnail:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},ee=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk rendition deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteRendition(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete renditions."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,rendition:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},X=V(!1),ve=V(null),ne=async me=>{var re,oe;try{switch(H.value=!0,X.value=!0,me.id){case"unarchive":await F();break;case"delete":await P();break;case"archive":await B();break;case"delete-thumbnail":await J();break;case"delete-rendition":await ee();break;default:console.error("Unknown action:",me.id),X.value=!1;break}}catch(z){console.error("Error performing action:",z),(re=D.value)==null||re.open()}finally{(oe=ve.value)==null||oe.focus(),Ct(()=>{H.value=!1,X.value=!1})}},L=(me,re)=>{var oe;!me&&re&&((oe=ve.value)==null||oe.focus())},H=V(!0),te=me=>{Ct(()=>{H.value=me})};tt(()=>o.selectRowData,me=>{H.value=!1},{deep:!0,immediate:!0});const he=Y(()=>({workspaceId:o.workspaceId,entityId:o.entityId,variant:C,disabled:H.value,ids:c.value}));return(me,re)=>Ke((j(),ue("div",{class:Q(me.$style["bulk-update-action"])},[_e("div",{class:Q(me.$style["left-actions"])},[_e("div",{class:Q(me.$style["selection-track"])},[fe(mt,{class:Q(me.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),U(l)==U(Vt).INDETERMINATE?(j(),ue("span",{key:0,class:Q(me.$style["selected-count"])},wt(e.selectRowData.length)+" selected ",3)):Je("",!0),U(l)==U(Vt).CHECKED?(j(),ue("span",{key:1,class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[12]||(re[12]=nt(' All in  " ',-1)),Ke((j(),ue("span",oge,[nt(wt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[13]||(re[13]=nt(' " ',-1))],2)):Je("",!0),!e.loading&&U(l)==U(Vt).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(j(),qe(mt,{key:2,variant:"secondary",onHandleClick:U(a)},{default:ge(()=>[_e("span",{class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[14]||(re[14]=nt(' Select all in  " ',-1)),Ke((j(),ue("span",ige,[nt(wt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[15]||(re[15]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Je("",!0),_e("span",{class:Q(me.$style.divider)},null,2)],2),fe(tge,Xt(he.value,{onUpdated:h,onUpdateStart:re[0]||(re[0]=oe=>H.value=!0),onUpdateCompleted:re[1]||(re[1]=oe=>te(!1)),onUpdateFailed:re[2]||(re[2]=oe=>te(!1))}),null,16),fe(VY,Xt({onUpdate:I,onUpdateStart:re[3]||(re[3]=oe=>H.value=!0),onUpdateCompleted:re[4]||(re[4]=oe=>te(!1)),onUpdateFailed:re[5]||(re[5]=oe=>te(!1))},he.value),null,16),fe(XY,Xt({"row-selected":f.value},he.value,{onUpdated:p,onUpdateStart:re[6]||(re[6]=oe=>H.value=!0),onUpdateCompleted:re[7]||(re[7]=oe=>te(!1)),onUpdateFailed:re[8]||(re[8]=oe=>te(!1))}),null,16,["row-selected"]),fe(WX,{disabled:H.value,onUpdate:v,onUpdateStart:re[9]||(re[9]=oe=>H.value=!0),onUpdateCompleted:re[10]||(re[10]=oe=>te(!1)),onUpdateFailed:re[11]||(re[11]=oe=>te(!1)),selectedIds:c.value,"workspace-id":e.workspaceId,variant:C,"entity-id":e.entityId},null,8,["disabled","selectedIds","workspace-id","entity-id"]),_e("span",{class:Q(me.$style.divider)},null,2),Ke((j(),ue("div",null,[R.value?(j(),qe(mt,{key:0,class:Q(me.$style["action-button"]),variant:[...C,"icon"],href:T.value,disabled:o.selectRowData.length>40},{default:ge(()=>[fe(lt,{src:"PenRuler",class:Q(me.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Je("",!0)])),[[U(n),o.selectRowData.length<=40?"Open in Review":"Select fewer than 40 items to open in Review"]]),_e("span",{class:Q(me.$style.divider)},null,2),fe(sf,{ref_key:"wrapperRef",ref:D,isUpdating:H.value,disabled:H.value,onOnVisibleChange:L},{trigger:ge(({hide:oe,toggle:z,isVisible:pe,disabled:ie})=>[Ke((j(),qe(mt,{onEscape:oe,actived:pe,ref_key:"moreActionRef",ref:ve,class:Q(me.$style["action-button"]),variant:["secondary","icon"],loading:X.value,disabled:ie||H.value,onClick:Pt(z,["stop"])},{default:ge(()=>[fe(lt,{src:"EllipsisVertical",class:Q(me.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[U(s),"99999"],[U(n),{content:"More actions"}]])]),popup:ge(({isVisible:oe,hide:z})=>[(j(),ue(xt,null,xn(S,(pe,ie)=>fe(eu,Xt({clickable:!0,key:pe.id},{ref_for:!0},pe,{show:oe,style:{borderLeft:0},"focus-index":"99999."+ie,onClick:()=>{ne(pe)},onEscape:z}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[To,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1c92i_1","left-actions":"_left-actions_1c92i_19","right-actions":"_right-actions_1c92i_20","selection-track":"_selection-track_1c92i_25","btn-close":"_btn-close_1c92i_31","close-icon":"_close-icon_1c92i_37","selected-count":"_selected-count_1c92i_41",divider:"_divider_1c92i_47","more-button":"_more-button_1c92i_52",dropdown:"_dropdown_1c92i_56","dropdown-content":"_dropdown-content_1c92i_59",delete:"_delete_1c92i_82","icon-btn":"_icon-btn_1c92i_89","selected-list":"_selected-list_1c92i_93"}}]]),il=_t(rt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Io,n=Jt,s=e,o=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:i}=ws(o),r=Y(()=>{var u,c,d;return!!((u=s.params)!=null&&u.api||(c=s.params)!=null&&c.node||(d=s.params)!=null&&d.context)}),a=Y(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const u=s.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=fe(Ih,{id:u.id,name:u.display_name,profile_image:u.profile_image,size:20,initial:u.initial,color:u.color});Yw(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}}}return{content:void 0}}),l=Y(()=>s.value===void 0);return(u,c)=>Ke((j(),qe(Cs,iR(Lw(U(i))),{default:ge(()=>[_e("span",{class:Q(u.$style["item-table-label-renderer"])},wt(s.value||"-"),3)]),_:1},16)),[[U(t),{isLoading:l.value||!r.value}],[U(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),age=["placeholder","maxlength"],lge={key:0,class:"wrapper-suffix"},uge=_t(rt({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 s=Io,o=Jt,i=e,r=n,a=V(i.value),l=V(null),u=V(null),c=V(i.value||""),d=V(!1),h=V(!1),f=Y(()=>{var F;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((F=i.value)==null?void 0:F.length)===0,inputRef:l,wrapperRef:u,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p,isHover:g}=ws(f),v=F=>{const k=document.createElement("div");return k.textContent=F,k.innerHTML},C=()=>c.value!==a.value,S=()=>{h.value=!0,d.value=!1,c.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},b=()=>{if(!d.value||!l.value)return;const F=v(l.value.value);if(!C()){d.value=!1;return}a.value=F,r("update:value",F),r("enter",F),d.value=!1},w=()=>{h.value||(i.saveOnBlur?b():S(),r("blur",c.value))},_=F=>{var k;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.stopPropagation();return}F.ctrlKey&&(F.key=="a"||F.key=="A")?(F.stopPropagation(),(k=l.value)==null||k.select()):F.key==="Enter"?(F.preventDefault(),F.stopPropagation(),b()):F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),S())},R=()=>{a.value=i.value,c.value=i.value,d.value=!0,Ct(()=>{var F,k;(F=l.value)==null||F.click(),(k=l.value)==null||k.focus()})},T=()=>{var F;d.value?S():(F=l.value)==null||F.blur(),r("blur",c.value)},I={focus:()=>{R()}};nn(()=>{var k;const F=(k=u.value)==null?void 0:k.$el;F&&(F.__sceneNameEditor=I)}),vs(()=>{const F=u.value;F&&delete F.__sceneNameEditor});const x=V(null),P=V(null);t({focus:R,blur:()=>{var F;return(F=l.value)==null?void 0:F.blur()},save:b,cancel:S,focusEditButton:()=>{Ct(()=>{var F;(F=x.value)==null||F.focus()})},focusCancelButton:()=>{Ct(()=>{var F;(F=P.value)==null||F.focus()})},startEdit:R});const D=Y(()=>i.value===void 0);return sS(u,()=>{d.value&&w()}),(F,k)=>Ke((j(),qe(U(Cs),Xt(U(p),{ref_key:"wrapperRef",ref:u,bordered:i.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),nh({default:ge(()=>[d.value?Je("",!0):Tt(F.$slots,"default",{key:0,isEditting:d.value,isHover:U(g)},()=>[Ke((j(),ue("span",{class:Q(F.$style["label-renderer"])},[nt(wt(c.value),1)],2)),[[U(o),{content:c.value||void 0}]])]),Ke(_e("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=O=>c.value=O),class:Q(F.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:_,onBlur:w},null,42,age),[[To,d.value],[ST,c.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ge(({hovered:O,focused:B})=>[O?(j(),ue("div",lge,[O&&!B?Ke((j(),qe(mt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(R,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:x,onKeydown:[zn(Pt(R,["prevent","stop"]),["enter"]),zn(Pt(T,["prevent","stop"]),["escape"])]},{default:ge(()=>[fe(U(lt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[U(o),"Edit"]]):Je("",!0)])):Je("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[U(s),{isLoading:D.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),cge=["tabindex"],aV=_t(rt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=Jt,o=Io,i=e,r=n,a=V(i.value),l=V(i.value),u=V(null),c=V(null),d=_n("bulkUpdate",!1),{apiServices:h}=ts(!d,i),f=Y(()=>{var X;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((X=a==null?void 0:a.value)==null?void 0:X.length)===0,inputRef:u,wrapperRef:c,clickable:!0}}),{isFocus:p}=ws(f),g=Y(()=>{const X=En.getInstance().getItem("ws.code"),ve=En.getInstance().getItem("BASE_URL"),ne=X||i.workspaceId;return co({type:"scene_hub",config:{baseDomain:ve,ws_code:ne,scene_id:String(i.id)}}).url}),v=Y(()=>{var X,ve,ne;return((ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.state)==0||((ne=i.data)==null?void 0:ne.isDeleted)==!0}),C=Y(()=>i.readOnly||R.value),S=Y(()=>{var X,ve,ne,L,H;return((X=i.data)==null?void 0:X.isDeleted)==!0||((ne=(ve=i.data)==null?void 0:ve.isProcessing)==null?void 0:ne.state)==0||((H=(L=i.data)==null?void 0:L.isProcessing)==null?void 0:H.state)==1}),b=Y(()=>{var X,ve;return(ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.message}),w=Y(()=>{var X;return((X=i.data)==null?void 0:X.isArchived)==1}),_=Y(()=>{var X;return((X=i.data)==null?void 0:X.isLocked)==1}),R=Y(()=>i.value===void 0),T=async X=>{var ve,ne,L,H,te,he,me,re,oe,z;a.value=X,p.value=!1;try{const pe=await((ne=(ve=h.value)==null?void 0:ve.updateSceneName)==null?void 0:ne.call(ve,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),ie=MF.get(TF)||"UTC";if(pe){const be=PF(pe,ie),G={...i.data,...be};(L=i.params)==null||L.api.clearFocusedCell();const q=((te=(H=i.params)==null?void 0:H.column)==null?void 0:te.getColId())||"",ce=((me=(he=i.params)==null?void 0:he.node)==null?void 0:me.rowIndex)||0;(re=i.params)==null||re.api.setFocusedCell(ce,q),(z=(oe=i.params)==null?void 0:oe.node)==null||z.setData(G),l.value=a.value,r("enter")}else a.value=l.value}catch(pe){console.error("Failed to update scene name:",pe),a.value=l.value}},I={focus:()=>{p.value=!0,Ct(()=>{var X;return(X=c.value)==null?void 0:X.focus()})},startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}},x=()=>c.value?"$el"in c.value?c.value.$el:c.value:null;tt(()=>i.value,X=>{a.value=X,l.value=X}),nn(()=>{const X=x();X&&(X.__sceneNameEditor=I)}),vs(()=>{const X=c.value,ve=X&&"$el"in X?X.$el:X;ve&&delete ve.__sceneNameEditor});const P=tf(),{openSceneHub:D}=P,F=X=>{try{if(X.ctrlKey||X.metaKey){window.open(g.value,"_blank");return}D(String(i.id))}catch{window.open(g.value,"_blank")}finally{J()}},k=()=>{setTimeout(()=>{ee.value=!0,O.value=0,Ct(()=>{var X;(X=B.value)==null||X.focus()})},300)},O=V(-1),B=V(null);t({focus:k,trigerFocus:k,startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}});const Z=X=>{if(X.key==="Enter"){X.preventDefault(),F(X);return}if(X.key==="Escape"){X.preventDefault(),J();return}X.key==="Tab"&&(X.preventDefault(),X.stopPropagation(),X.stopImmediatePropagation(),Ct(()=>{var ve;(ve=c.value)==null||ve.focusEditButton()}))},J=()=>{var ne,L,H,te,he,me;ee.value=!1,O.value=-1,(ne=i.params)==null||ne.api.clearFocusedCell();const X=((H=(L=i.params)==null?void 0:L.column)==null?void 0:H.getColId())||"",ve=((he=(te=i.params)==null?void 0:te.node)==null?void 0:he.rowIndex)||0;(me=i.params)==null||me.api.setFocusedCell(ve,X)},ee=V(!1);return(X,ve)=>Ke((j(),qe(uge,{"save-on-blur":!0,ref_key:"wrapperRef",ref:c,disabled:i.disabled,"read-only":C.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":ve[0]||(ve[0]=ne=>a.value=ne),id:`scene-name-${i.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ee.value,onBlur:J},{default:ge(({isHover:ne,isEditting:L})=>[Ke(_e("div",{class:Q(X.$style["scene-name-display"])},[Ke((j(),ue("a",{tabindex:O.value,ref_key:"nameRef",ref:B,onClick:Pt(F,["prevent"]),onKeydown:Z,target:"_blank",class:Q(X.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(wt(a.value),1)],42,cge)),[[U(s),{content:a.value,delay:[1e3,0]}]]),C.value||!ne&&!L&&!C.value?(j(),ue(xt,{key:0},[_.value?Ke((j(),ue("div",{key:0,class:Q([X.$style["icon-processing"],X.$style.isLocked])},[fe(lt,{src:"Lock"})],2)),[[U(s),{content:"Locked",delay:[1e3,0]}]]):Je("",!0),w.value?Ke((j(),ue("div",{key:1,class:Q([X.$style["icon-processing"],X.$style.archived])},[fe(lt,{src:"BoxArchive"})],2)),[[U(s),{content:"Archived",delay:[1e3,0]}]]):Je("",!0),S.value?Ke((j(),ue("div",{key:2,class:Q([X.$style["icon-processing"],X.$style.processing,v.value&&X.$style["icon-red"]])},[fe(lt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[U(s),b.value]]):Je("",!0)],64)):Je("",!0)],2),[[To,!U(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[U(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_1ws9s_1","scene-name-display":"_scene-name-display_1ws9s_11","icon-processing":"_icon-processing_1ws9s_18",archived:"_archived_1ws9s_28",locked:"_locked_1ws9s_31",processing:"_processing_1ws9s_34","icon-red":"_icon-red_1ws9s_38","scene-name-text":"_scene-name-text_1ws9s_43"}}]]),_0=_t(rt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const s=Ur,o=V([]),i=e,r=V(null),a=Y(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Y(()=>{let C=[];return typeof i.variant=="string"?C.push(i.variant):Array.isArray(i.variant)&&(C=[...i.variant]),[...C,"icon"]}),u=n,{hide:c,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=Fs({toggleOnClick:!0,offset:[0,0]});function v(C){u("select",C),c()}return th(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:c,hideDropdown:()=>{c()},popupRef:p}),tt(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(j(),ue("div",{class:Q(C.$style["button-dropdown-wrapper"]),style:dn({"--button-size":a.value})},[_e("div",{class:Q(C.$style["button-group"])},[Tt(C.$slots,"prefix"),_e("div",{ref_key:"triggerRef",ref:f,class:Q(U(d)?C.$style.open:"")},[Tt(C.$slots,"triggerDropdown",{open:U(d)},()=>[i.readOnly?Je("",!0):Ke((j(),qe(mt,{key:0,onEscape:U(c),ref_key:"mainButton",ref:r,actived:U(d),class:Q(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:ge(()=>[Tt(C.$slots,"iconDropdown",{},()=>[fe(lt,{class:Q(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[U(s),e.tabIndex]])])],2)],2),_e("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:Q(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(j(!0),ue(xt,null,xn(e.options,(b,w)=>Ke((j(),qe(eu,Xt({ref_for:!0,ref:_=>o.value[w]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Pt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ge(()=>[nt(wt(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[U(s),`${e.tabIndex}.${w}`]])),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"}}]]),Zf=_t(rt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},r=Y(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(j(),ue("div",{class:Q(a.$style["close-wrapper"])},[e.disableRemove?Je("",!0):(j(),ue("div",{key:0,class:Q(a.$style["close-button"])},[Ke((j(),qe(mt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:ge(()=>[fe(lt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[U(n),r.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),dge=_t(rt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Jt,n=Io,s=e,{isEditing:o}=Ac(s),i=V(s.value),r=V(null),a=V(null),{apiServices:l}=ts(!0,s),u=V(!0),c=()=>{u.value=s.value===void 0};eh(()=>{c()}),nn(()=>{c()}),tt(()=>s.value,I=>{c()});const d=Y(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:r,wrapperRef:a,clickable:!(s.readOnly||u.value),active:o})),{argsMain:h,isHover:f}=ws(d),p=Y(()=>{var I;return((I=i.value)==null?void 0:I.slice(0,s.maxVisible))||[]}),g=Y(()=>{var I;return Math.max(0,(((I=i.value)==null?void 0:I.length)||0)-s.maxVisible)}),v=Y(()=>{var I;return g.value<=0?"":((I=i.value)==null?void 0:I.slice(s.maxVisible).map(x=>x.name).join(", "))||""}),C=Y(()=>p.value.map(I=>({id:I.id,name:I.name,initial:I.initial,avatarId:I.id,profile_image:I.profile_image,color:I.color,size:24,user:I}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));tt(()=>s.value,I=>{i.value=I},{immediate:!0,deep:!0});const b=async I=>{var P,D,F;await T(I)&&(i.value=(P=i.value)==null?void 0:P.filter(k=>k.id!==I),(F=s.params)==null||F.node.setData({...(D=s.params)==null?void 0:D.node.data,assignees:i.value}))},w=I=>{var P;const x=En.getInstance().getItem("ws.code");return((P=l.value)==null?void 0:P.getUserInformation(x,I))||Promise.resolve(null)},{id:_}=Up(s),R=I=>{var P,D;const x=(D=(P=s.params)==null?void 0:P.api)==null?void 0:D.getRowNode(String(_.value));x==null||x.setDataValue("assignees",$I(I.assignees))},{removeAssignee:T}=mm({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(I,x)=>Ke((j(),qe(Cs,Xt(U(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ge(()=>{var P;return[_e("div",{class:Q(I.$style.assigneeGroupRenderer)},[((P=i.value)==null?void 0:P.length)===0?(j(),qe(lt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:dn(S.value)},null,8,["style"])):Je("",!0),(j(!0),ue(xt,null,xn(C.value,D=>(j(),qe(Zf,{key:D.id,"disable-remove":s.readOnly||s.disabled,onClear:F=>b(D.id),style:{marginLeft:"0"}},{default:ge(()=>[fe(Oc,{user:D.user,"show-profile":!0,apiUpdateFunction:w,class:Q(I.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((j(),ue("div",{key:1,class:Q(I.$style["extra-avatars"])},[nt(" +"+wt(g.value),1)],2)),[[U(t),v.value]]):Je("",!0)],2)]}),_:1},16)),[[U(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"}}]]),hge=_t(rt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var R,T;const t=Jt,n=Io,s=Eb(),o=e,i=V(null),r=V(null),{isEditing:a}=Ac(o),l=I=>{if(I){if(typeof I=="string")return I;if(I instanceof Date)return I.toISOString()}},u=Y(()=>o.value===void 0),c=Y(()=>{var I;return(I=o.data)==null?void 0:I.isStarted}),d=Y(()=>{var I;return(I=o.data)==null?void 0:I.isCompleted}),h=Y(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=Y(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=ws(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:w,fullEndDate:_}=O7({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:c.value,isEnded:d.value,timezone:o.timezone||s});return(I,x)=>Ke((j(),qe(Cs,Xt(U(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:ge(()=>[u.value?Je("",!0):(j(),ue("div",{key:0,class:Q(I.$style.dateRangeRenderer)},[h.value?Je("",!0):(j(),qe(lt,{key:0,src:"Calendar",class:Q(I.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(j(),ue(xt,{key:1},[Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(S).map(P=>I.$style[P])])},[nt(wt(U(v)),1)],2)),[[U(t),U(w)]]),x[0]||(x[0]=_e("span",null,"→",-1)),Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(b).map(P=>I.$style[P])])},[nt(wt(U(C)),1)],2)),[[U(t),U(_)]])],64)):Je("",!0)],2))]),_:1},16)),[[U(n),{isLoading:u.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),fge=rt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:Eb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=V(null);nn(()=>{Ct(()=>{s.value&&s.value.focus()})});const o=e,i=n,r=()=>{var C;(C=o.params)==null||C.api.stopEditing(),i("closed")},a=C=>`${bt.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},u=async()=>{await v({startDate:null})},c=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=_n("bulkUpdate",!1),{apiServices:g}=ts(!p,o),v=async C=>{var S,b,w,_,R;try{const T=(S=s.value)==null?void 0:S.getValues(),I=await((w=(b=g.value)==null?void 0:b.changeDate)==null?void 0:w.call(b,{workspaceId:o.workspaceId,itemIds:[o.id],startDate:C.startDate,dueDate:C.dueDate}));I!=null&&I.message&&((R=o.params)==null||R.node.setData({...(_=o.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:()=>{Ct(()=>{var C;(C=s.value)==null||C.focus()})}}),(C,S)=>(j(),qe(Am,Xt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:c,onClearStart:u,onClosed:r,ref_key:"calendarRef",ref:s}),null,16))}}),pge=_t(rt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=V(null),s=V(0);let o=null;nn(()=>{n.value&&(o=new ResizeObserver(r=>{for(const a of r)s.value=a.contentRect.height}),o.observe(n.value))}),Il(()=>{o&&n.value&&o.unobserve(n.value)});const i=Y(()=>{const r=s.value;return r>120?r-42-36:0});return(r,a)=>(j(),ue("div",{class:Q(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[_e("div",{class:Q(r.$style["item-header"])},[_e("div",{class:Q(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[_e("h1",{class:Q(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),_e("div",{class:Q(r.$style["item-header__spacer"])},null,2),_e("div",{class:Q(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:i.value}),_e("div",{class:Q(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$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"}}]]),lV=(e,t)=>{const n=V(Number(e.value.value)),s=Y(()=>e.value.metricConfig),o=Y(()=>{var g,v;const l=s.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}}),i=17,r=Y(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:o,metricConfig:s,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var u;return(((u=s.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}},gge=["aria-label"],uV=_t(rt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Io,s=Jt,o=e,i=Gp(!1),r=V(null),a=V(null),{isEditing:l}=Ac(o),u=Y(()=>{var B,Z;return{value:o.value,metricConfig:((Z=(B=o.params)==null?void 0:B.colDef)==null?void 0:Z.context)||o.config,error:o.error,hovered:i.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=lV(u,i),f=Y(()=>{var Z,J;let B=!1;if(["number","formula"].includes(d.value.metric_type.code)){const ee=Number(o.value),X=Number((Z=d.value)==null?void 0:Z.format_value);Number.isFinite(X)&&X>=0&&(B=(((J=ee.toString().split(".")[1])==null?void 0:J.length)||0)>X)}return B}),p=Y(()=>{var B;return!!((B=d.value)!=null&&B.morpheme_value)||c.value.isEmpty||f.value}),g=Y(()=>{var J,ee,X;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 B=x.value,Z=(J=d.value)==null?void 0:J.morpheme_type;return Z==="prefix"?`${((ee=d.value)==null?void 0:ee.morpheme_value)||""} ${B}`.trim():Z==="suffix"?`${B} ${((X=d.value)==null?void 0:X.morpheme_value)||""}`.trim():B}),v=Y(()=>{const{format_type:B,format_value:Z}=d.value;if(B==="dropdown"&&typeof Z=="string"&&Z.startsWith("["))try{return JSON.parse(Z)}catch{return[]}return[]}),C=Y(()=>({disabled:o.disabled,error:c.value.isError,inputRef:r,wrapperRef:a,clickable:!I.value,readOnly:o.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:S,isHover:b}=ws(C),w=(B,Z,J="en-US")=>new Intl.NumberFormat(J,{minimumFractionDigits:Z,maximumFractionDigits:Z}).format(B),_=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?R(B,J):R(X,J)}return typeof B=="number"?R(B,J):String(B)}),R=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].substring(0,ee).padEnd(ee,"0"):"0".repeat(ee);return ee>0?`${ve}.${ne}`:ve}return w(B,ee)}catch(X){return console.error("Error formatting metric value:",X,{num:B,decimals:ee}),String(B)}},T=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].length:0,L=Math.max(ee,ne),H=X[1]?X[1].padEnd(L,"0"):"0".repeat(L);return L>0?`${ve}.${H}`:ve}return new Intl.NumberFormat("en-US",{minimumFractionDigits:ee,maximumFractionDigits:20}).format(B)}catch(X){return console.error("Error formatting exact metric value:",X,{num:B,decimals:ee}),String(B)}},I=Y(()=>{var B;return((B=d.value)==null?void 0:B.metric_type.code)==="formula"}),x=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?T(B,J):T(X,J)}return typeof B=="number"?T(B,J):String(B)}),{tooltip:P}=NF(""),D=async B=>{B.stopPropagation(),B.preventDefault(),B.stopImmediatePropagation();try{await navigator.clipboard.writeText(x.value),P.value="Copied",setTimeout(()=>{P.value="Copy"},3e3)}catch(Z){console.error("Failed to copy text:",Z),P.value="Copy failed",setTimeout(()=>{P.value="Copy"},3e3)}};tt(()=>o.value,(B,Z)=>{const J=Number(B);Number.isFinite(J)&&J!==h.value?h.value=J:B==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{i.value=!0},O=()=>{i.value=!1};return(B,Z)=>Ke((j(),qe(Cs,Xt(U(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:O,ref_key:"wrapperRef",ref:a,actived:U(l),bordered:!0}),{suffix:ge(()=>[o.disabled?Je("",!0):(j(),ue("div",{key:0,class:Q([B.$style.suffix,"wrapper-suffix"])},[i.value&&!U(c).isEmpty&&!U(c).isError?Ke((j(),qe(mt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"])},{default:ge(()=>[fe(lt,{src:"Copy",source:"remote",size:12})]),_:1})),[[U(s),{content:U(P),hideOnClick:!1,contentClass:"extra-padding"}]]):Je("",!0)],2))]),default:ge(()=>[_e("div",{class:Q(B.$style["metric-wrapper"]),"aria-label":U(d).format_value||void 0},[_e("div",{class:Q([B.$style["metric-content"],o.disabled?B.$style.disabled:""])},[!U(c).isError&&U(c).isEmpty?(j(),ue(xt,{key:0},[U(c).pendingCalculation?Ke((j(),ue("span",{key:0,class:Q(B.$style["metric-empty"])},[...Z[0]||(Z[0]=[nt(" - ",-1)])],2)),[[U(s),"Can’t calculate yet. Complete required fields."]]):U(c).isEmpty?(j(),ue("span",{key:1,class:Q(B.$style["metric-empty"])}," - ",2)):Je("",!0)],64)):Je("",!0),U(c).isError?Ke((j(),ue("div",{key:1,class:Q(B.$style["metric-error"])},[...Z[1]||(Z[1]=[nt(" Error ",-1)])],2)),[[U(s),"Something went wrong. Review formula, inputs and retry."]]):Je("",!0),!U(c).isEmpty&&!U(c).isError?Ke((j(),ue("span",{key:2,class:Q([B.$style["metric-value"],U(b)?B.$style.hovered:"",{[B.$style.disabled]:o.disabled}])},[nt(wt(_.value),1)],2)),[[U(s),{content:g.value,bypassOverflowCheck:p.value}]]):Je("",!0)],2)],10,gge)]),_:1},16,["actived"])),[[U(n),{isLoading:U(c).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),mge={key:0,style:{color:"#6b6b6b"}},vge=_t(rt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Jt,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"}},o={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"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var F,k;if(a.headerType)return a.headerType;if(((k=(F=a.params)==null?void 0:F.column)==null?void 0:k.getColId()).includes("metric"))return"default";const D=a.headerType??a.params.column.getColId();return l[D]||"default"}),c=V(),d=()=>{var D,F,k;const P=(F=(D=a.params)==null?void 0:D.column)==null?void 0:F.getColDef();if((k=P.colId)!=null&&k.includes("metric")){if(P.context.is_primary==1)return"primary";if(P.context.is_point_metric==1)return"secondary"}};th(()=>{c.value=d()}),nn(()=>{c.value=d()});const h=Y(()=>{var P,D;return((D=(P=a.params)==null?void 0:P.column.getColDef().context)==null?void 0:D.morpheme_value)||void 0}),f=Y(()=>{var P;return(P=a.params)==null?void 0:P.displayName}),p=Y(()=>{let P=[];switch(u.value){case"dateRange":P=Object.values(s).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"date":P=Object.values(o).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"number":P=Object.values(i).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;default:P=Object.values(r).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break}return v.value!=="none"&&P.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),P}),g=Y(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=V(a.modelValue??"none"),C=P=>{_("update:modelValue",P),_("sort-changed",P)},S=P=>{v.value=P},b=Di(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let P;v.value==="none"?P="asc":v.value==="asc"?P="desc":P="none",v.value=P}else{const P=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],F=(P.indexOf(v.value)+1)%P.length;v.value=P[F]}},rr),w=Y(()=>{if(v.value==="none")return"No sorting applied";const P=p.value.find(D=>D.value===v.value);return(P==null?void 0:P.label)||""}),_=t,R=Y(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});tt(()=>a.modelValue,P=>{P!=v.value&&(v.value=P)}),tt(v,P=>{P!==a.modelValue&&C(P)});const T=V(v.value);tt(()=>v.value,P=>{T.value=P});const I=P=>{var O,B;if(a.readOnly||a.disabled)return;let D=0;P.key==="ArrowDown"?D=1:P.key==="ArrowUp"&&(D=-1);const F=p.value.findIndex(Z=>Z.value===T.value),k=p.value.length;if(P.key==="Enter"||P.key===" ")P.preventDefault(),v.value=T.value,(O=x.value)==null||O.hide();else if(D!==0){P.preventDefault();let Z=(F+D+k)%k;T.value=p.value[Z].value}else P.key==="Escape"&&((B=x.value)==null||B.hide())},x=V(null);return nn(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.addEventListener("keydown",I)}),Il(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.removeEventListener("keydown",I)}),(P,D)=>(j(),qe(_0,{ref_key:"dropdownRef",ref:x,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:U(b),onSelect:D[0]||(D[0]=F=>S(F))},{prefix:ge(()=>[fe(mt,{variant:["text"],onClick:U(b),size:"small"},{default:ge(()=>[Ke((j(),ue("b",null,[nt(wt(f.value),1)])),[[U(n),{content:f.value}]]),h.value?(j(),ue("small",mge," ("+wt(h.value)+") ",1)):Je("",!0),c.value=="primary"?Ke((j(),ue("div",{key:1,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Woohoo metric"]]):Je("",!0),c.value=="secondary"?Ke((j(),ue("div",{key:2,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Point Metric"]]):Je("",!0)]),_:1},8,["onClick"])]),iconDropdown:ge(()=>[Ke(fe(lt,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[U(n),w.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"}}]]),yge=["disabled","readonly","checked","indeterminate"],cV=_t(rt({__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=Jt,s=Ur,o=e,i=t,r=Y(()=>{if(typeof o.size=="string"){if(["small","medium","large"].includes(o.size))switch(o.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(o.size.endsWith("px"))return o.size}return typeof o.size=="number"?`${o.size}px`:"20px"}),a=Y(()=>o.allowIndeterminate?[Vt.UNCHECK,Vt.INDETERMINATE,Vt.CHECKED]:[Vt.UNCHECK,Vt.CHECKED]),l=Y(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(c.value){case Vt.UNCHECK:return o.tooltipText.unchecked;case Vt.INDETERMINATE:return o.tooltipText.indeterminate;case Vt.CHECKED:return o.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=V(typeof o.modelValue=="boolean"?o.modelValue?Vt.CHECKED:Vt.UNCHECK:o.modelValue),d=Y(()=>({checked:c.value===Vt.CHECKED,indeterminate:c.value===Vt.INDETERMINATE,none:c.value===Vt.UNCHECK})),h=Y(()=>o.disabled||o.readOnly);return tt(()=>c.value,f=>{i("update:modelValue",f===Vt.CHECKED)}),(f,p)=>Ke((j(),ue("input",{disabled:o.disabled,key:c.value,readonly:o.readOnly,type:"checkbox",class:Q([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:u,"aria-label":"Select All Items",style:dn({"--input-size":r.value})},null,46,yge)),[[U(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[U(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),wge=_t(rt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Jt,s=Wm(),{setSelectionStatus:o}=s,{rowCount:i,selectionStatus:r}=Qs(s),a=V(new Set);tt(r,w=>{o(w)},{immediate:!0});const l=Y(()=>r.value!==Vt.UNCHECK),u=Y(()=>({checked:r.value===Vt.CHECKED,indeterminate:r.value===Vt.INDETERMINATE,UNCHECK:r.value===Vt.UNCHECK})),c=Y(()=>({[Vt.UNCHECK]:"Click to select all",[Vt.INDETERMINATE]:"Click to clear selection",[Vt.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Y(()=>{const w=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&w.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),w}),h=w=>({selected:w.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:w,state:_})=>{if(w)if(_===Vt.UNCHECK)w.deselectAll(),a.value.clear(),r.value=_;else if(_===Vt.CHECKED){const R=new Set;w.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,w.forEachNode(T=>T.setSelected(!0)),r.value=_}else w.forEachNode(R=>R.setSelected(!0)),r.value=_},p=()=>{var R;const w=(R=t.params)==null?void 0:R.api;if(!w){console.error("[HeaderCheckbox] There is no API available");return}const _={[Vt.UNCHECK]:Vt.INDETERMINATE,[Vt.INDETERMINATE]:Vt.UNCHECK,[Vt.CHECKED]:Vt.UNCHECK};f({api:w,state:_[r.value]})},g=w=>{var T;const _=(T=t.params)==null?void 0:T.api;if(!_){console.error("no api");return}const R={INDETERMINATE:Vt.INDETERMINATE,GLOBAL:Vt.CHECKED,UNCHECK:Vt.UNCHECK};f({api:_,state:R[w]})},v=Di(w=>{const{selected:_,total:R}=h(w);if(R==0){r.value=Vt.UNCHECK;return}_===R?r.value=Vt.CHECKED:_===0?r.value=Vt.UNCHECK:r.value=Vt.INDETERMINATE},300);let C=[];const S=w=>{v(w)};nn(()=>{var I;const w=(I=t.params)==null?void 0:I.api;if(!w)return;const _=x=>v(x.api),R=()=>S(w),T=()=>S(w);w.addEventListener("selectionChanged",_),w.addEventListener("rowDataUpdated",R),w.addEventListener("modelUpdated",R),C=[()=>w.removeEventListener("selectionChanged",_),()=>w.removeEventListener("rowDataUpdated",R),()=>w.removeEventListener("modelUpdated",T)]}),vs(()=>{C.forEach(w=>w())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(w,_)=>(j(),qe(_0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ge(()=>[Ke((j(),qe(cV,{"tab-index":"8",id:b,disabled:t.disabled,key:U(r),readonly:t.readOnly,type:"checkbox",checked:u.value.checked,indeterminate:u.value.indeterminate,modelValue:U(r),"onUpdate:modelValue":_[0]||(_[0]=R=>gn(r)?r.value=R:null),onChange:p,"aria-label":U(r)===U(Vt).CHECKED?"All items selected":"Select visible items",class:Q(w.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[U(n),{content:c.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),Cge={key:1},bge=_t(rt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Io,n=Jt,s=e,{isEditing:o}=Ac(s),i=V(null),r=V(null),a=Y(()=>s.value),l=Y(()=>a.value===void 0),u=Y(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),c=Y(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:Cj((g=a.value)==null?void 0:g.label),inputRef:i,wrapperRef:r,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ws(c),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=Y(()=>new Nn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((j(),qe(U(Cs),Xt(U(d),{ref_key:"wrapperRef",ref:r,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!U(o)&&!U(h)?"#f3f5f8":void 0}}),{default:ge(()=>[l.value?Je("",!0):(j(),ue("div",{key:0,class:Q(g.$style["status-renderer"])},[a.value?Ke((j(),ue("div",{key:0,class:Q(g.$style["status-renderer__status-name"])},[nt(wt(u.value),1)],2)),[[U(n),{content:u.value,delay:[1e3,0]}]]):l.value?Je("",!0):(j(),ue("div",Cge,"No status"))],2))]),_:1},16,["style"])),[[U(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_108pu_1","status-renderer__color-code":"_status-renderer__color-code_108pu_10","status-renderer__status-name":"_status-renderer__status-name_108pu_20"}}]]),dV=_t(rt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const s=e,{popupRef:o,show:i,hide:r,isVisible:a}=$7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(c){return document.body}}),l=c=>{s.closeOnEscape&&c.key==="Escape"&&a.value&&r()};nn(()=>{document.addEventListener("keydown",l)}),vs(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const u=n;return tt(()=>a.value,c=>{u(c?"shown":"hidden")}),(c,d)=>{const h=_o("tooltip");return j(),ue("div",{ref_key:"popupRef",ref:o,class:Q(c.$style.popupContainer)},[_e("div",{class:Q(c.$style.popupWrapper)},[_e("div",{class:Q(c.$style.header)},[_e("span",{class:Q(c.$style["header-title"])},wt(e.popupName),3),Ke((j(),qe(mt,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:U(r),"aria-label":"Close popup"},{default:ge(()=>[fe(lt,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),_e("div",{class:Q(c.$style.body)},[Tt(c.$slots,"default")],2),_e("div",{class:Q(c.$style.footer)},[Tt(c.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),Sge={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class Ege extends Error{}class rl extends Ege{constructor(){super("Zone is an abstract class")}}class hV{get type(){throw new rl}get name(){throw new rl}get ianaName(){return this.name}get isUniversal(){throw new rl}offsetName(t,n){throw new rl}formatOffset(t,n){throw new rl}offset(t){throw new rl}equals(t){throw new rl}get isValid(){throw new rl}}const R0=new Map;function _ge(e){let t=R0.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"}),R0.set(e,t)),t}const Rge={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Dge(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function Tge(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=Rge[i];i==="era"?s[a]=r:Zv(a)||(s[a]=parseInt(r,10))}return s}const D0=new Map;class Yv extends hV{static create(t){let n=D0.get(t);return n===void 0&&D0.set(t,n=new Yv(t)),n}static resetCache(){D0.clear(),R0.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=Yv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Fge(t,n,s,this.name)}formatOffset(t,n){return Jv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=_ge(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?Tge(s,n):Dge(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=xge({year:o,month:i,day:r,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 T0=null;class hd extends hV{static get utcInstance(){return T0===null&&(T0=new hd(0)),T0}static instance(t){return t===0?hd.utcInstance:new hd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new hd(pV(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Jv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Zv(e){return typeof e>"u"}function Xv(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function fV(e){if(!(Zv(e)||e===null||e===""))return parseInt(e,10)}function Ige(e){if(!(Zv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function xge(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 Fge(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function pV(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Jv(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Xv(n,2)}:${Xv(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${Xv(n,2)}${Xv(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const gV=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fd(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function pd(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function mV(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=fV(t[n+o]);return[s,null,n+o]}}const vV=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Pge=`(?:${vV.source}?(?:\\[(${gV.source})\\])?)?`,yV=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,wV=RegExp(`${yV.source}${Pge}`),I0=RegExp(`(?:[Tt]${wV.source})?`),Age=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,kge=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Oge=/(\d{4})-?(\d{3})/,Mge=mV("weekYear","weekNumber","weekDay"),Nge=mV("year","ordinal"),Lge=/(\d{4})-(\d\d)-(\d\d)/,CV=RegExp(`${yV.source} ?(?:${vV.source}|(${gV.source}))?`),Vge=RegExp(`(?: ${CV.source})?`);function gd(e,t,n){const s=e[t];return Zv(s)?n:fV(s)}function Bge(e,t){return[{year:gd(e,t),month:gd(e,t+1,1),day:gd(e,t+2,1)},null,t+3]}function md(e,t){return[{hours:gd(e,t,0),minutes:gd(e,t+1,0),seconds:gd(e,t+2,0),milliseconds:Ige(e[t+3])},null,t+4]}function Xf(e,t){const n=!e[t]&&!e[t+1],s=pV(e[t+1],e[t+2]),o=n?null:hd.instance(s);return[{},o,t+3]}function Jf(e,t){const n=e[t]?Yv.create(e[t]):null;return[{},n,t+1]}fd(Age,I0),fd(kge,I0),fd(Oge,I0),fd(wV),pd(Bge,md,Xf,Jf),pd(Mge,md,Xf,Jf),pd(Nge,md,Xf,Jf),pd(md,Xf,Jf),pd(md),fd(Lge,Vge),fd(CV),pd(md,Xf,Jf);function vd(e){"@babel/helpers - typeof";return vd=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},vd(e)}var bs;(function(e){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}"})(bs||(bs={})),bs.review,bs.review_take,bs.review_scene,bs.review_rendition,bs.review_frame,bs.review_rendition_comment,bs.review_comment,bs.scene_hub,bs.hub_rendition,bs.hub_comment,bs.people_insight,bs.people_detail,bs.project,bs.woohoo,bs.update,bs.core,bs.project_focusMode;var x0=null;function $ge(e){x0=e}function Qv(){if(!x0)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return x0}function bV(){try{var e=Qv();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function Hge(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&vd(s)==="object")Object.keys(s).forEach(function(r){var a="{".concat(r,"}"),l=s[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(s.min||s.max)&&(l="".concat(s.min||s.value," and ").concat(s.max||s.value)),o=o.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),o=o.replace(/{value}/g,i)}return o}function Gge(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var i=o[s],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function SV(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function EV(e,t){if(!e||vd(e)!=="object")return null;try{var n=Qv();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),i=0,r=o;i<r.length;i++){var a=r[i],l=s[a];if(l&&l.rule){var u=l.rule,c=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[u]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[u]}if(v&&typeof v=="string")return Hge(v,a,c,d)}catch(w){console.error("Error in validation rules",w)}}}}catch(w){return console.error("Error in getValidationErrorMessage:",w),null}return null}function Uge(e){if(!e)return bV();var t=e.code,n=e.error,s=e.details,o=e.message;if(SV(s)&&s){var i=EV(s,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=Qv();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&vd(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l,u,c,d="errorMessages.".concat(a,".").concat(n.key),h=Qv(),f=((l=h.messages)===null||l===void 0?void 0:l.value)||h.messages,p=((u=h.locale)===null||u===void 0?void 0:u.value)||h.locale,g=(c=f[p])===null||c===void 0||(c=c.errorMessages)===null||c===void 0||(c=c[a])===null||c===void 0?void 0:c[n.key];if(g&&typeof g=="string"){var v=g;return s!=null&&s.context&&(v=Gge(v,s.context),console.log("[Error Utils Debug]",v)),t!==""?"[".concat(t,"] ").concat(v):v}}catch(S){console.error("[Error Utils Debug]",S)}}if(n&&vd(n)!=="object"&&SV(s)){var C=EV(s);if(C)return t!==""?"[".concat(t,"] ").concat(C):C}return o||bV()}var Wge={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}.",before_or_equal:"{field} must be a date before or equal {value}.",after_or_equal:"{field} must be a date after or equal {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}.",in:"Update failed. Only these values are allowed: {value}.",between:"Update failed. Enter a value between {value}."},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const Qf=Ql("toast",()=>{const e=l=>{var u;if((l==null?void 0:l.apiCode)==="offline")o({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const c=Uge((u=l==null?void 0:l.res)==null?void 0:u.data);o({id:l==null?void 0:l.apiCode,type:"error",message:c})}},t=V([]),n=(l,u)=>{const c=Sge[l];if(c){const d=c[u];if(d){o({id:l,type:u,message:d});return}}else o({id:l,type:u,message:l})},s=new Map,o=(l,u=5e3)=>{const c={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(c),u>0){const d=Date.now(),h=setTimeout(()=>{i(c.id),s.delete(c.id)},u);s.set(c.id,{timeoutId:h,remainingTime:u,startTime:d})}};function i(l){t.value=t.value.filter(c=>c.id!==l);const u=s.get(l);u&&(clearTimeout(u.timeoutId),s.delete(l))}function r(l){const u=s.get(l);if(u){clearTimeout(u.timeoutId);const c=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-c)}}function a(l){const u=s.get(l);if(u&&u.remainingTime>0){const c=setTimeout(()=>{i(l),s.delete(l)},u.remainingTime);u.timeoutId=c,u.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),zge=["onMouseenter","onMouseleave"],jge=["innerHTML"],Kge=["innerHTML"],qge=["data-tooltip"],Yge={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},Zge=_t(rt({__name:"Snackbar",setup(e){const t=Jt,n=EU,s=Qf(),{removeNotification:o}=s,{notifications:i}=Qs(s),r=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},u=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},c=V(new Set),d=f=>{var p;c.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;c.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(j(),qe(rU,{name:"list",tag:"div",class:Q(["notification-center",f.$style["notification-wrapper"]])},{default:ge(()=>[(j(!0),ue(xt,null,xn(U(i),g=>{var v;return Ke((j(),ue("div",{key:g.id,class:Q([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[_e("p",{class:Q(f.$style.snackbar__message)},[_e("span",{class:Q(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(j(),qe(lt,{key:0,src:"CircleCheck",source:"remote"})):Je("",!0),!g.icon&&g.type=="interactive"?(j(),qe(lt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(j(),qe(lt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(j(),ue("i",{key:3,class:Q(f.$style["icon-draw"]),innerHTML:g.icon},null,10,jge)):g.icon&&!r(g.icon)?(j(),qe(lt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)],2),_e("span",{class:Q(f.$style["error-message"])},[_e("span",{class:Q(f.$style.message),innerHTML:g.message},null,10,Kge)],2)],2),g.actions?(j(),ue("div",{key:0,class:Q(f.$style["actions-notification"]),"data-notification":"true"},[(j(!0),ue(xt,null,xn(g.actions,C=>(j(),qe(mt,Xt({key:C.label},{ref_for:!0},C,{onClick:Pt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ge(()=>[C.btnIcon?(j(),qe(lt,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)]),_:2},1040,["onClick"]))),128))],2)):Je("",!0),g.type!=="interactive"?Ke((j(),ue("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(mt,{variant:"secondary",onClick:C=>u(g.message),class:Q(f.$style["copy-btn"])},{prefix:ge(()=>[fe(lt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,qge)),[[U(t),a.value]]):Je("",!0),g.type=="interactive"?Ke((j(),ue("div",Yge,[fe(mt,{variant:"tertiary",onClick:C=>U(o)(g.id),class:Q(f.$style["close-btn"]),size:18},{default:ge(()=>[fe(lt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[U(t),"Close"]]):Je("",!0)],42,zge)),[[U(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
206
+ `,nfe=class extends Pue{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,tV),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==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,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}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 s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.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():(Xe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=tV),this.isFirstLine=!1}},sfe=class extends Fue{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()){Xe(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;Aue(this.getFileName(o),s)}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:s,valueSvc:o,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u,suppressQuotes:c,columnSeparator:d}=e;return new nfe({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function ofe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function ife(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var rfe={moduleName:"CsvExport",version:ut,beans:[sfe],apiFunctions:{getDataAsCsv:ofe,exportDataAsCsv:ife},dependsOn:[tfe]},afe=class extends We{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:s,rowNodes:o}=this;for(let i=0;i<e;i++){const r=n+i,a=new Ja(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Xe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,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((o,i)=>{const r=e.rowData?e.rowData[i]:void 0;!o.id&&o.alreadyRendered&&r&&(t[i]=new Ja(n),t[i].setRowIndex(o.rowIndex),t[i].setRowTop(o.rowTop),t[i].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},lfe=2,ufe=class extends We{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 s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new afe(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()&&(ja(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,i=lfe-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,u=s?a>=o:!1;if(l||u){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}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:s}=this.params,i=(e.id+1)*n+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,dt(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,s)=>n.id-s.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 s=-1,o=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&s+1!==l.id){r=!0;continue}s=l.id,l.forEachNode(u=>{const c=u===e||u===t;(o||c)&&n.push(u),c&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},cfe=class extends We{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 Ja(e);this.rootNode=t,t.level=-1,this.rowHeight=lu(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=lu(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!ff(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;jc(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:s,eventSvc:o,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:lu(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new ufe(this.cacheParams)),o.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 dfe(e){var t;(t=Gv(e))==null||t.refreshCache()}function hfe(e){var t;(t=Gv(e))==null||t.purgeCache()}function ffe(e){var t;return(t=Gv(e))==null?void 0:t.getRowCount()}var pfe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=sQ(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=As(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Mi(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){ja(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:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){ja(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},gfe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[cfe,pfe]},mfe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:dfe,purgeInfiniteCache:hfe,getInfiniteRowCount:ffe},dependsOn:[gfe,xhe]},vfe="↑",yfe="↓",wfe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Cfe=class extends yn{constructor(){super(wfe),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=dt(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=vfe+o:r.textContent=yfe+o,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}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"),Ps(this.eDelta)}refresh(e,t=!1){var u;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:Ps(o),(u=r.filterManager)!=null&&u.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return i&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},bfe=".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}",Sfe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Efe=class extends yn{constructor(){super(Sfe),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(bfe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=is({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:Ps(s),!0}},_fe=class extends We{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"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const i=Date.now(),r=i+n,a=i+n+s,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.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&&r+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=r)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,i=`${o}-animation`;for(const[r,a]of s){if(!r.isAlive()||!r.comp){s.delete(r);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}}=r;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(i,!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(o,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(r);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=Eoe(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 Rfe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var Dfe={moduleName:"HighlightChanges",version:ut,beans:[_fe],userComponents:{agAnimateShowChangeCellRenderer:Cfe,agAnimateSlideCellRenderer:Efe},apiFunctions:{flashCells:Rfe}};function Tfe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Ife(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function nV(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=xfe(e)),e.version=ut,e}function xfe(e){return e.cellSelection=Ffe(e,"rangeSelection"),e}function Ffe(e,t){if(e&&typeof e=="object")return e[t]}var Pfe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=As(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=As(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=As(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=ss(e);const s=nV(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:u})=>{u==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=nV(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.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,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);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:s,rowGroupExpansion:o,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(c,d)=>!(n!=null&&n.has(c))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(i,o,t),l("rowSelection",r)&&this.setRowSelectionState(r,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))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.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:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Tue(dv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const k=!(s!=null&&s.has(D))&&!!(F||t==="api");return h||(h=k),k},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:D,sort:F},k)=>{const O=g(D);O.sort=F,O.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",i);S&&(i==null||i.groupColIds.forEach((D,F)=>{const k=g(D);k.rowGroup=!0,k.rowGroupIndex=F})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",r);b&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((D,F)=>{const k=g(D);k.pivot=!0,k.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(_||!n)&&(v.pinned=null);const R=f("columnVisibility",u);if(R)for(const D of(u==null?void 0:u.hiddenColIds)??[])g(D).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",c);if(T)for(const{colId:D,flex:F,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const O=g(D);O.flex=F??null,O.width=k}(T||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,x=!!(I!=null&&I.length)&&!(s!=null&&s.has("columnOrder")),P=x?I.map(D=>g(D)):Object.values(p);(P.length||h)&&(this.columnStates=P,Ni(this.beans,{state:P,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:i,colGroupSvc:r}=o;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Ni(o,{state:a,applyOrder:e},t)}s&&(r==null||r.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Iue(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=s.getColumnGroupState().map(({groupId:l})=>{const u=o.has(l);return u&&o.delete(l),{groupId:l,open:u}});for(const l of o)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),s.setColumnGroupState(r,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(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:i,endRow:r,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:s,visibleCols:o}=this.beans;if(!ta(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of r.colIds){const c=s.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const u=o.allCols,c=new Set(a);l=u.find(d=>c.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}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:s,rowRenderer:o,animationFrameSvc:i,ctrlsSvc:r}=this.beans;s.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),i==null||i.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:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:i}=e??{page:0,pageSize:s.get("paginationPageSize")},r=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.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 s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const i=t[o];ff(i,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),ff(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")}},Afe={moduleName:"GridState",version:ut,beans:[Pfe],apiFunctions:{getState:Tfe,setState:Ife}};function kfe(e){return e.rowModel.isLastRowIndexKnown()}function Ofe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Mfe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Nfe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Lfe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Vfe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Bfe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function $fe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Hfe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Gfe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Ufe=class extends We{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 s=Math.max(lu(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?As(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Yf="paginationPageSizeSelector",Wfe={tag:"span",cls:"ag-paging-page-size"},zfe=class extends yn{constructor(){super(Wfe),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(Yf,()=>{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(){Ps(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(Yf)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),i=this.gos.get(Yf)!==!0;Xe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||Xe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Yf}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(Ya(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new uE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Yf);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},jfe={selector:"AG-PAGE-SIZE-SELECTOR",component:zfe},Kfe=".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}",qfe=class extends fN{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Kfe)}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(),[jfe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",li(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",li(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",li(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",li(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:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):Une(this.beans,i),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:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Gne(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}):xue(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 s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){sJ(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(),s=e?n:null,o=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*o+1,a=r+i-1,e&&a>s&&(a=s));const l=r+i-1,u=!e&&n<l,c=this.formatNumber(r);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?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(c,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${r} ${s} ${l} ${o}`;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"))}},Yfe={selector:"AG-PAGINATION",component:qfe},Zfe=class extends We{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 Yfe}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,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.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 dt(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:dt(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:dt(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:dt(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,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,i=n*o;let r=n*(o+1)-1;if(r>s&&(r=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+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,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}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:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},Xfe={moduleName:"Pagination",version:ut,beans:[Zfe,Ufe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:kfe,paginationGetPageSize:Ofe,paginationGetCurrentPage:Mfe,paginationGetTotalPages:Nfe,paginationGetRowCount:Lfe,paginationGoToNextPage:Vfe,paginationGoToPreviousPage:Bfe,paginationGoToFirstPage:$fe,paginationGoToLastPage:Hfe,paginationGoToPage:Gfe},dependsOn:[Uv]};function Jfe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function sV(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&sV(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function Qfe(e,t){return e.rowModel.getRowNode(t)}function epe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function tpe(e){return e.rowRenderer.getRenderedNodes()}function npe(e,t,n){e.rowModel.forEachNode(t,n)}function spe(e){return e.rowRenderer.firstRenderedRow}function ope(e){return e.rowRenderer.lastRenderedRow}function ipe(e,t){return e.rowModel.getRow(t)}function rpe(e){return e.rowModel.getRowCount()}var ape={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:Jfe,setRowNodeExpanded:sV,getRowNode:Qfe,addRenderedRowListener:epe,getRenderedNodes:tpe,forEachNode:npe,getFirstDisplayedRowIndex:spe,getLastDisplayedRowIndex:ope,getDisplayedRowAtIndex:ipe,getDisplayedRowCount:rpe}},lpe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:bde,getHorizontalPixelRange:Sde,ensureColumnVisible:VL,ensureIndexVisible:BL,ensureNodeVisible:Ede}};function upe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function cpe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function dpe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function hpe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function fpe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function ppe(e){return{rowHeight:lu(e),headerHeight:Nf(e)}}function gpe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(kf(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=r0(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!a0(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&s.push(kf(u))}}return[...s,...n]}var mpe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:upe,refreshCells:cpe,refreshHeader:dpe,isAnimationFrameQueueEmpty:hpe,flushAllAnimationFrames:fpe,getSizesForCurrentTheme:ppe,getCellRendererInstances:gpe}};function vpe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function oV({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function ype(e,t){var n;t&&typeof t=="object"?oV(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var wpe=class extends We{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 s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&ss(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var u;const o=c=>Yc(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=iV(this.beans),r=c=>n.leftCols.some(d=>Ff(d,c)),a=c=>n.rightCols.some(d=>Ff(d,c)),l=e.colKeys.filter(c=>!sa(c)&&!oa(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(i,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}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:i,stopAtGroup:r,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 C=-1;const S=Object.fromEntries(u.map(({colId:_,...R})=>[_,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=i??b;for(;C!==0;){C=0;const _=[];for(const R of s){if(!R||mQ(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const I=p.getPreferredWidthForColumn(T,b);if(I>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const P=Cpe(T,I,x);T.setActualWidth(P,c),v.add(T),C++}_.push(T)}_.length&&g.refresh(c)}w||this.autoSizeColumnGroupsByColumns(s,c,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,i=new Set,r=s.getColsForKeys(e);for(const l of r){let u=l.getParent();for(;u&&u!=n;)u.isPadding()||i.add(u),u=u.getParent()}let a;for(const l of i){for(const u of o.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"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new yu(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=iV(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):Xe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=na(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),_=C.getActualWidth();return(b==null||_>=b)&&(w==null||_<=w)}))return;const l=[],u=[];for(const v of i){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Ff(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{Mi(l,v),u.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-na(u);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/na(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],_=o==null?void 0:o[w.getId()],R=(_==null?void 0:_.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(_==null?void 0:_.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),P=typeof R=="number"&&R>I?R:I,D=typeof T=="number"&&T<x?T:x;let F=Math.round(w.getActualWidth()*C);F<P?(F=P,h(w),d=!1):F>D?(F=D,h(w),d=!1):b===0&&(F=S),w.setActualWidth(F,t,!0),S-=F}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Yc(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 s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:i,defaultMaxWidth:r}=n,a=o==null?void 0:o.map(({colId:l,minWidth:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.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 Cpe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function iV({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return yf(n.eGridBody)-o}var bpe={moduleName:"ColumnAutoSize",version:ut,beans:[wpe],apiFunctions:{sizeColumnsToFit:vpe,autoSizeColumns:oV,autoSizeAllColumns:ype},dependsOn:[FN]},Spe=".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 Epe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function _pe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Rpe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function Dpe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function Tpe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var Ipe={moduleName:"PinnedRow",version:ut,beans:[Rse],css:[Spe],apiFunctions:{getPinnedTopRowCount:Epe,getPinnedBottomRowCount:_pe,getPinnedTopRow:Rpe,getPinnedBottomRow:Dpe,forEachPinnedRow:Tpe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},xpe=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 s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},Fpe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:i,pagination:r}}=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 C=(w,_)=>{p=w,g=null,v=_},S=w=>{const _=!w.isExpandable()&&!w.group&&!w.detail&&(c?!c({rowNode:w}):!0);if(w.rowIndex==null||!_){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,i.getValue(t,w));return}const R=i.getValue(t,w);if(f){const T=Ft(n,{valueA:v,nodeA:p,valueB:R,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,R);return}}else if(d?!d(v,R):v!==R){C(w,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new xpe(t,p),u.set(p,g)}g.addSpannedNode(w),u.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!r||r.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=u;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":s==null||s.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}}},Ppe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=As(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=As(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 Fpe(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,s=e.column,o=e.rowIndex,i=this.spanningColumns.get(s);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(o);break;default:r=n.getRow(o)}if(r)return i.getCellSpan(r)}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,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},Ape=class extends ad{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,s,o,i,r){this.eWrapper=n,super.setComp(e,t,n,s,o,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||zm(e,t.rowIndex)}setAriaRowSpan(){lJ(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(Pv(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}},kpe=class extends Hv{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new Ape(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Ope=class extends We{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),s=n.size,o=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(u,c)=>{if(i.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){i.set(c.firstNode,d),n.delete(c.firstNode);return}r=!0;const h=new kpe(c.firstNode,this.beans,!1,!1,!1);i.set(c.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===s;if(!(!r&&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 s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.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")}},Mpe={moduleName:"CellSpan",version:ut,beans:[Ppe,Ope]},Npe=class extends We{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,s=n.cellClassRules,o=this.getCellClassParams(e,n);o0(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const i of o)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},Lpe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){o0(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new Npe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},Vpe={moduleName:"CellStyle",version:ut,beans:[Lpe]},Bpe={moduleName:"RowStyle",version:ut,beans:[Rle]};function $pe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var Hpe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:i,columns:r}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),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}},Gpe="ag-column-hover",Upe=class extends We{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 s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(Gpe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new Hpe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},Wpe={moduleName:"ColumnHover",version:ut,beans:[Upe],apiFunctions:{isColumnHovered:$pe}},zpe=class extends We{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 i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,s=!Vv.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{Vv.has(r)&&t(r,a)},s=(r,a)=>{Vv.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:r,asyncListener:a}=s.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,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:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function jpe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function Kpe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function qpe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function Ype(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var Zpe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:jpe,addGlobalListener:qpe,removeEventListener:Kpe,removeGlobalListener:Ype},beans:[zpe]},Xpe={moduleName:"Locale",version:ut,beans:[Due]},Jpe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=As(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:s}=this.beans,o=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=Ka(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),i=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",r),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",r),(u=t.forEachDisplayedNode)==null||u.call(t,r),i&&((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 s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=o.getLeftColsForRow(t);break;case"right":i=o.getRightColsForRow(t);break;case null:i=s.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:i}=e,r=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}=ru(s),g=d+h+f+p,C=t.offsetHeight+g;if(c<5){const b=Rs(r),w=!(b!=null&&b.contains(t)),_=C==0;if(w||_){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(o,C,i)},l=()=>a(0);l();const u=Wa(r,t,l);return n.addDestroyFunc(()=>{u(),this.setRowAutoHeight(o,void 0,i)}),!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(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},Qpe={moduleName:"RowAutoHeight",version:ut,beans:[Jpe]},ege={moduleName:"AllCommunity",version:ut,dependsOn:[eV,rfe,mfe,Wue,ehe,the,nhe,she,ohe,ihe,rhe,Qde,jce,Kce,qce,zce,Zce,Xce,Afe,Phe,Xfe,ON,ape,lpe,mpe,bpe,Boe,Ipe,bhe,aue,Vpe,Wpe,Bpe,Zpe,cue,Dfe,ML,Xpe,Qpe,Voe,Qhe,Mpe]};const tge=rt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,s=Y(()=>{const h=Yn();return h==null?void 0:h.appContext.config.globalProperties.apiServices}),o=t,i=V(!1),r=V(null),a=h=>{i.value=!1,o("updated",h)},l=Y(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId}));Zi("bulkUpdate",!0);const u=(h,f)=>{console.trace("Status update button setLoading called with value:",h,"hide:",f),i.value=h,o(h?"update-start":"update-completed"),setTimeout(()=>{var p,g;f?(p=r.value)==null||p.hide():(g=r.value)==null||g.open()},300)},c=V(null),d=(h,f)=>{var p;h&&((p=c.value)==null||p.focus())};return(h,f)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:r,isUpdating:i.value,disabled:n.disabled||i.value,onOnVisibleChange:d},{trigger:ge(({hide:p,disabled:g})=>[fe(mt,{variant:n.variant,loading:i.value,disabled:g,onEscape:p},{default:ge(()=>[fe(lt,{src:"Square",class:"icon"}),f[3]||(f[3]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({hide:p,isVisible:g})=>[Ke(fe(Bk,Xt({disabled:i.value,ref_key:"statusRef",ref:c},l.value,{onUpdated:a,onCancel:p,onStartUpdate:f[0]||(f[0]=v=>u(!0,!0)),onFinishUpdate:f[1]||(f[1]=v=>u(!1,!0)),onError:f[2]||(f[2]=()=>{u(!1,!1)}),callback:()=>u(!1,!0)}),null,16,["disabled","onCancel","callback"]),[[To,g]])]),default:ge(()=>[f[4]||(f[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),rV=_t(rt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const s=Ur,o=e,i=Y(()=>(o==null?void 0:o.workspaceId)||""),r=Y(()=>(o==null?void 0:o.entityId)||""),a=()=>{var O,B,Z;return(Z=(O=o.params)==null?void 0:O.api)==null?void 0:Z.getCellRendererInstances({columns:["options"],rowNodes:(B=o.params)!=null&&B.node?[o.params.node]:[]})[0]},l=()=>{var B,Z,J,ee;const O=a();(Z=(B=O==null?void 0:O.componsenExposed)==null?void 0:B.blur)==null||Z.call(B),(ee=(J=O==null?void 0:O.container)==null?void 0:J.parentElement)==null||ee.classList.remove("ag-cell-focus")},u=()=>{var Z,J,ee;(J=(Z=o.params)==null?void 0:Z.api)==null||J.stopEditing(),l();const O=`scene-name-${o.id}`,B=document.getElementById(O);(ee=B==null?void 0:B.__sceneNameEditor)==null||ee.startEdit()},{apiServices:c}=ts(!0,o),d=Y(()=>{var O;return{ws_code:i.value,entity_id:r.value,scene_id:o.id,axiosService:c,optionBlock:o.optionBlock,permissions:(O=o.data)==null?void 0:O.permissions}}),h=O=>{var Z,J,ee,X,ve,ne;let B=(J=(Z=o.params)==null?void 0:Z.api)==null?void 0:J.getRowNode(String(o.id));if(B){const L={...B.data,isDeleted:O==="deleted",isArchived:O==="archived"?!0:B.data.isArchived,isLocked:O==="locked"?!0:B.data.isLocked,disabled:!1};O=="deleted"&&(L.isLocked=!1,L.disabled=!0),O=="unarchived"&&(L.isArchived=!1),(X=(ee=o.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[B]}),B.setData(L),(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.redrawRows({rowNodes:[B]})}},f=tf(),{openSceneHub:p}=f,g=()=>{Ct(()=>{var Z,J,ee,X,ve,ne;const O=((J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex)||0,B=((X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId())||"";(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.setFocusedCell(O,B)})};Y(()=>{var B,Z;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return O==null?void 0:O.data});const{options:v}=pY(d,h,u,p,g),C=n,S=()=>{var O,B,Z,J,ee,X;console.trace("Focusing current cell for row:",o.id),(X=(O=o.params)==null?void 0:O.api)==null||X.setFocusedCell(((Z=(B=o.params)==null?void 0:B.node)==null?void 0:Z.rowIndex)||0,((ee=(J=o.params)==null?void 0:J.column)==null?void 0:ee.getColId())||"")},b=Y(()=>{var O;return(O=o.params)==null?void 0:O.api}),w=(O,B)=>{var Z,J,ee,X,ve,ne,L,H;if(C("actionExecuted",O),O.id=="copy-link"){(ve=b.value)==null||ve.startEditingCell({rowIndex:(J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex,colKey:(X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId()});return}else{if(O.id!=="copy-link"&&((ne=b.value)==null||ne.stopEditing()),O.id==="rename")(L=b.value)==null||L.stopEditing(),(H=b.value)==null||H.clearFocusedCell(),l();else if(O.id==="copy-link"){const te=document.getElementById(B);setTimeout(()=>{var he,me,re;(re=(me=(he=te==null?void 0:te.__vueParentComponent)==null?void 0:he.exposed)==null?void 0:me.focus)==null||re.call(me)},300)}else if(["delete-rendition","delete-thumbnail"].includes(O.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var te,he;(he=(te=o.params)==null?void 0:te.api)==null||he.clearFocusedCell()},300)}},_=()=>{var O,B;(B=(O=o.params)==null?void 0:O.api)==null||B.stopEditing()},R=O=>{var B,Z,J,ee;return O==="archive"?!((Z=(B=o.params)==null?void 0:B.data)!=null&&Z.isArchived):O==="unarchive"?(ee=(J=o.params)==null?void 0:J.data)==null?void 0:ee.isArchived:!0},T=Y(()=>v.value.map(O=>({...O,options:O.options.filter(B=>!B.hide&&R(B.id))})).filter(O=>O.options.length>0)),I=V({}),x=V(null),P=Y(()=>{var B,Z;if(o.focusableIndex)return o.focusableIndex;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return`${((O==null?void 0:O.rowIndex)??0)+10}`}),D=(O,B)=>`${P.value}.${O*10+B}`,F=(O,B)=>{if(B&&"focus"in B){I.value[O]=B;return}delete I.value[O]},k=O=>{O.preventDefault(),O.stopPropagation(),O.stopImmediatePropagation()};return nn(()=>{var O;(O=x.value)==null||O.focus()}),t({focus(){var Z;const O=`${P.value}.0`,B=I.value[O];B&&B.focus?B.focus():(Z=x.value)==null||Z.focus()}}),(O,B)=>Ke((j(),ue("div",{onKeydown:k,class:Q([O.$style["more-option-section"],{[O.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:x,tabindex:"0",role:"menu"},[(j(!0),ue(xt,null,xn(T.value,(Z,J)=>(j(),ue("div",{key:Z.id,style:dn({"--g-number":Math.min(Z.options.length,4),"--g-size":Z.type==="column"?"36px":"auto"}),class:Q([O.$style["option-block"],O.$style[Z.type]])},[(j(!0),ue(xt,null,xn(Z.options,(ee,X)=>(j(),ue("div",{key:ee.id,class:Q(O.$style["option-item"])},[fe(sge,{layer:o.layer,"scene-id":String(o.id),option:ee,type:Z.type,onActionExecuted:ve=>w(ve,`more-action-${ve.id}-${o.id}`),focusableIndex:D(J,X),ref_for:!0,ref:ve=>F(D(J,X),ve),onHandleHide:_,id:`more-action-${ee.id}-${o.id}`,label:ee.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[U(s),P.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"}}]]),nge={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},sge=_t(rt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Ur,o=Jt,i=e,r=V(!1),a=V(!1),l=(I,x)=>{if(!x){p();return}const P=x.target;P.closest(".tippy-content")||P.closest(".tippy-box")||P.closest("[data-tippy-root]")||P.closest(".option-item")||p()},u=V(null),{triggerRef:c,popupRef:d,show:h,isVisible:f,hide:p}=Fs({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 I=>{var x,P;if(!a.value){a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,r.value=!1}}},C=async I=>{var x,P;if(I.preventDefault(),I.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},S=I=>{g("actionExecuted",I),p()},b=I=>{I.key==="Escape"&&p()},w=I=>({row:"small",column:"medium",block:"small"})[I]||"medium",_=I=>{const x=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...x],column:["menu-item",...x],block:["secondary",...x]}[I]||[]},R=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{Ct(()=>{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:()=>{C(new MouseEvent("click"))}});const T=I=>{var x;I.stopPropagation(),I.preventDefault(),r.value=!1,(x=c.value)==null||x.focus()};return(I,x)=>{var P;return Ke((j(),ue("div",{ref_key:"wrapperRef",ref:u,class:Q(I.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(C,["stop","prevent"])},[Ke((j(),qe(mt,{ref_key:"triggerRef",ref:c,class:Q(I.$style["option-item"]),disabled:e.option.disabled||a.value,actived:U(f)||r.value,size:w(e.type),variant:_(e.type),onClick:Pt(C,["stop","prevent"]),onKeydown:b,onEscape:R,label:e.option.label},{prefix:ge(()=>[e.option.icon?(j(),ue("div",nge,[fe(lt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Je("",!0)]),suffix:ge(()=>[e.option.subMenu?(j(),qe(lt,{key:0,src:"Play",source:"remote"})):Je("",!0),e.option.isDanger&&r.value?(j(),ue("div",{key:1,class:Q(I.$style["confirm-action"])},[Ke((j(),qe(mt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.0`],[U(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((j(),qe(mt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:x[0]||(x[0]=D=>r.value=!1)},{default:ge(()=>[fe(lt,{src:"Check",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.1`],[U(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Je("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[U(s),i.focusableIndex]]),e.option.subMenu?(j(),ue("div",{key:0,ref_key:"popupRef",ref:d,class:Q(I.$style["submenu-container"])},[fe(rV,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((P=e.option)==null?void 0:P.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Je("",!0)],2)),[[U(o),{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"}}]]),oge={style:{"max-width":"225px","line-height":"14px"}},ige={style:{"max-width":"100px","line-height":"14px"}},rge=_t(rt({__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"],setup(e,{emit:t}){const n=Jt,s=Ur,o=e,i=t,r=Wm(),{handelSelectAll:a}=r,{selectionStatus:l}=Qs(r),u=Y(()=>l.value===Lt.CHECKED),c=Y(()=>o.selectRowData.map(me=>me.id)),d=Y(()=>o.selectRowData.length>0);Zi("bulkUpdate",d),Zi("isSelectAll",u);const h=({itemIds:me,data:re})=>{const oe=o.gridApi;me.forEach(z=>{if(!oe){console.error("Grid API is undefined");return}const pe=oe.getRowNode(z);if(pe){const ie={...pe.data,status:re};pe.setData(ie)}})},f=Y(()=>o.selectRowData),p=({itemIds:me,data:re})=>{const oe=o.gridApi;if(!oe){console.error("Grid API is undefined");return}me.forEach(z=>{const pe=oe.getRowNode(z);if(pe){const ie=pe.data.dateRange||[null,null];"startDate"in re&&re.startDate!==void 0&&(ie[0]=re.startDate?new Date(re.startDate):null),"dueDate"in re&&re.dueDate!==void 0&&(ie[1]=re.dueDate?new Date(re.dueDate):null);const be={...pe.data,dateRange:ie};pe.setData(be)}}),i("updated")},g=Y(()=>o.selectRowData.map(me=>me.id)),v=me=>{const re=o.gridApi,{id:oe,value:z}=me;if(!re){console.error("Grid API is undefined");return}g.value.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,[`metric_${oe}`]:z};ie.setData(be)}}),i("updated")},C=["primary"],S=[{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}],b=()=>{i("unselect")},w=Qb(),{userPermissions:_}=Qs(w),R=Y(()=>_.value.includes(eS)),T=Y(()=>{if(!R.value){console.error("User does not have permission to open review.");return}if(l.value==Lt.CHECKED)return co({type:"review_take",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,take_id:o.entityId}}).url;const me=o.selectRowData.map(oe=>oe.id).join(",");return co({type:"review_multiple_scenes",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:me}}).url}),I=me=>{console.log("Updating assignees with params:",me);const{assignees:re,type:oe}=me,z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(ie=>{const be=z.getRowNode(ie.id);if(!be)return null;const G=be.data.assignees||[];let q=[];switch(oe){case"add":{const ce=new Set(G.map(Fe=>Fe.id)),ke=re.filter(Fe=>!ce.has(Fe.id));q=[...G,...ke];break}case"overwrite":{q=re;break}case"remove":{const ce=new Set(re.map(ke=>ke.id));q=G.filter(ke=>!ce.has(ke.id));break}case"removeAll":{q=[];break}}return{...be.data,assignees:q}}).filter(ie=>ie!==null).forEach(ie=>{const be=z.getRowNode(ie.id);be&&be.setData(ie)})},{apiServices:x}=ts(!1,o),P=async()=>{var z;const me=o.selectRowData.map(pe=>pe.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk delete.");return}const oe=await((z=x.value)==null?void 0:z.bulkDeleteItems(O.value));(oe==null?void 0:oe.message)=="Done"&&(me.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,isDeleted:!0,disabled:!0};ie.setData(be)}}),re.deselectAll())},D=V(null),F=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const oe=await((z=x.value)==null?void 0:z.bulkUnarchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to unarchive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!1),(ie=D.value)==null||ie.hide()},k=_n("filterParams",void 0),O=Y(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&u.value?[]:o.selectRowData.map(me=>me.id),entityId:o.entityId,filterParams:k!=null&&k.value?k.value:void 0})),B=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const oe=await((z=x.value)==null?void 0:z.bulkArchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to archive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!0),(ie=D.value)==null||ie.hide()},Z=(me,re,oe)=>{const z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}const pe=me.map(ie=>{const be=z.getRowNode(ie);if(be){const G={...be.data,[re]:oe};be.setData(G)}return be}).filter(ie=>ie!=null);console.log("Updated row nodes:",{idsToUpdate:me,rowNodes:pe}),z.redrawRows({rowNodes:pe})},J=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk thumbnail deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteThumbnail(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete thumbnails."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,thumbnail:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},ee=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk rendition deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteRendition(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete renditions."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,rendition:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},X=V(!1),ve=V(null),ne=async me=>{var re,oe;try{switch(H.value=!0,X.value=!0,me.id){case"unarchive":await F();break;case"delete":await P();break;case"archive":await B();break;case"delete-thumbnail":await J();break;case"delete-rendition":await ee();break;default:console.error("Unknown action:",me.id),X.value=!1;break}}catch(z){console.error("Error performing action:",z),(re=D.value)==null||re.open()}finally{(oe=ve.value)==null||oe.focus(),Ct(()=>{H.value=!1,X.value=!1})}},L=(me,re)=>{var oe;!me&&re&&((oe=ve.value)==null||oe.focus())},H=V(!0),te=me=>{Ct(()=>{H.value=me})};tt(()=>o.selectRowData,me=>{H.value=!1},{deep:!0,immediate:!0});const he=Y(()=>({workspaceId:o.workspaceId,entityId:o.entityId,variant:C,disabled:H.value,ids:c.value}));return(me,re)=>Ke((j(),ue("div",{class:Q(me.$style["bulk-update-action"])},[_e("div",{class:Q(me.$style["left-actions"])},[_e("div",{class:Q(me.$style["selection-track"])},[fe(mt,{class:Q(me.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),U(l)==U(Lt).INDETERMINATE?(j(),ue("span",{key:0,class:Q(me.$style["selected-count"])},wt(e.selectRowData.length)+" selected ",3)):Je("",!0),U(l)==U(Lt).CHECKED?(j(),ue("span",{key:1,class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[12]||(re[12]=nt(' All in  " ',-1)),Ke((j(),ue("span",oge,[nt(wt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[13]||(re[13]=nt(' " ',-1))],2)):Je("",!0),!e.loading&&U(l)==U(Lt).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(j(),qe(mt,{key:2,variant:"secondary",onHandleClick:U(a)},{default:ge(()=>[_e("span",{class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[14]||(re[14]=nt(' Select all in  " ',-1)),Ke((j(),ue("span",ige,[nt(wt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[15]||(re[15]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Je("",!0),_e("span",{class:Q(me.$style.divider)},null,2)],2),fe(tge,Xt(he.value,{onUpdated:h,onUpdateStart:re[0]||(re[0]=oe=>H.value=!0),onUpdateCompleted:re[1]||(re[1]=oe=>te(!1)),onUpdateFailed:re[2]||(re[2]=oe=>te(!1))}),null,16),fe(VY,Xt({onUpdate:I,onUpdateStart:re[3]||(re[3]=oe=>H.value=!0),onUpdateCompleted:re[4]||(re[4]=oe=>te(!1)),onUpdateFailed:re[5]||(re[5]=oe=>te(!1))},he.value),null,16),fe(XY,Xt({"row-selected":f.value},he.value,{onUpdated:p,onUpdateStart:re[6]||(re[6]=oe=>H.value=!0),onUpdateCompleted:re[7]||(re[7]=oe=>te(!1)),onUpdateFailed:re[8]||(re[8]=oe=>te(!1))}),null,16,["row-selected"]),fe(WX,{disabled:H.value,onUpdate:v,onUpdateStart:re[9]||(re[9]=oe=>H.value=!0),onUpdateCompleted:re[10]||(re[10]=oe=>te(!1)),onUpdateFailed:re[11]||(re[11]=oe=>te(!1)),selectedIds:c.value,"workspace-id":e.workspaceId,variant:C,"entity-id":e.entityId},null,8,["disabled","selectedIds","workspace-id","entity-id"]),_e("span",{class:Q(me.$style.divider)},null,2),Ke((j(),ue("div",null,[R.value?(j(),qe(mt,{key:0,class:Q(me.$style["action-button"]),variant:[...C,"icon"],href:T.value,disabled:o.selectRowData.length>40&&U(l)!=U(Lt).CHECKED},{default:ge(()=>[fe(lt,{src:"PenRuler",class:Q(me.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Je("",!0)])),[[U(n),o.selectRowData.length<=40?"Open in Review":"Select fewer than 40 items to open in Review"]]),_e("span",{class:Q(me.$style.divider)},null,2),fe(sf,{ref_key:"wrapperRef",ref:D,isUpdating:H.value,disabled:H.value,onOnVisibleChange:L},{trigger:ge(({hide:oe,toggle:z,isVisible:pe,disabled:ie})=>[Ke((j(),qe(mt,{onEscape:oe,actived:pe,ref_key:"moreActionRef",ref:ve,class:Q(me.$style["action-button"]),variant:["secondary","icon"],loading:X.value,disabled:ie||H.value,onClick:Pt(z,["stop"])},{default:ge(()=>[fe(lt,{src:"EllipsisVertical",class:Q(me.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[U(s),"99999"],[U(n),{content:"More actions"}]])]),popup:ge(({isVisible:oe,hide:z})=>[(j(),ue(xt,null,xn(S,(pe,ie)=>fe(eu,Xt({clickable:!0,key:pe.id},{ref_for:!0},pe,{show:oe,style:{borderLeft:0},"focus-index":"99999."+ie,onClick:()=>{ne(pe)},onEscape:z}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[To,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1c92i_1","left-actions":"_left-actions_1c92i_19","right-actions":"_right-actions_1c92i_20","selection-track":"_selection-track_1c92i_25","btn-close":"_btn-close_1c92i_31","close-icon":"_close-icon_1c92i_37","selected-count":"_selected-count_1c92i_41",divider:"_divider_1c92i_47","more-button":"_more-button_1c92i_52",dropdown:"_dropdown_1c92i_56","dropdown-content":"_dropdown-content_1c92i_59",delete:"_delete_1c92i_82","icon-btn":"_icon-btn_1c92i_89","selected-list":"_selected-list_1c92i_93"}}]]),il=_t(rt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Io,n=Jt,s=e,o=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:i}=ws(o),r=Y(()=>{var u,c,d;return!!((u=s.params)!=null&&u.api||(c=s.params)!=null&&c.node||(d=s.params)!=null&&d.context)}),a=Y(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const u=s.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=fe(Ih,{id:u.id,name:u.display_name,profile_image:u.profile_image,size:20,initial:u.initial,color:u.color});Yw(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}}}return{content:void 0}}),l=Y(()=>s.value===void 0);return(u,c)=>Ke((j(),qe(Cs,iR(Lw(U(i))),{default:ge(()=>[_e("span",{class:Q(u.$style["item-table-label-renderer"])},wt(s.value||"-"),3)]),_:1},16)),[[U(t),{isLoading:l.value||!r.value}],[U(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),age=["placeholder","maxlength"],lge={key:0,class:"wrapper-suffix"},uge=_t(rt({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 s=Io,o=Jt,i=e,r=n,a=V(i.value),l=V(null),u=V(null),c=V(i.value||""),d=V(!1),h=V(!1),f=Y(()=>{var F;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((F=i.value)==null?void 0:F.length)===0,inputRef:l,wrapperRef:u,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p,isHover:g}=ws(f),v=F=>{const k=document.createElement("div");return k.textContent=F,k.innerHTML},C=()=>c.value!==a.value,S=()=>{h.value=!0,d.value=!1,c.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},b=()=>{if(!d.value||!l.value)return;const F=v(l.value.value);if(!C()){d.value=!1;return}a.value=F,r("update:value",F),r("enter",F),d.value=!1},w=()=>{h.value||(i.saveOnBlur?b():S(),r("blur",c.value))},_=F=>{var k;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.stopPropagation();return}F.ctrlKey&&(F.key=="a"||F.key=="A")?(F.stopPropagation(),(k=l.value)==null||k.select()):F.key==="Enter"?(F.preventDefault(),F.stopPropagation(),b()):F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),S())},R=()=>{a.value=i.value,c.value=i.value,d.value=!0,Ct(()=>{var F,k;(F=l.value)==null||F.click(),(k=l.value)==null||k.focus()})},T=()=>{var F;d.value?S():(F=l.value)==null||F.blur(),r("blur",c.value)},I={focus:()=>{R()}};nn(()=>{var k;const F=(k=u.value)==null?void 0:k.$el;F&&(F.__sceneNameEditor=I)}),vs(()=>{const F=u.value;F&&delete F.__sceneNameEditor});const x=V(null),P=V(null);t({focus:R,blur:()=>{var F;return(F=l.value)==null?void 0:F.blur()},save:b,cancel:S,focusEditButton:()=>{Ct(()=>{var F;(F=x.value)==null||F.focus()})},focusCancelButton:()=>{Ct(()=>{var F;(F=P.value)==null||F.focus()})},startEdit:R});const D=Y(()=>i.value===void 0);return sS(u,()=>{d.value&&w()}),(F,k)=>Ke((j(),qe(U(Cs),Xt(U(p),{ref_key:"wrapperRef",ref:u,bordered:i.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),nh({default:ge(()=>[d.value?Je("",!0):Tt(F.$slots,"default",{key:0,isEditting:d.value,isHover:U(g)},()=>[Ke((j(),ue("span",{class:Q(F.$style["label-renderer"])},[nt(wt(c.value),1)],2)),[[U(o),{content:c.value||void 0}]])]),Ke(_e("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=O=>c.value=O),class:Q(F.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:_,onBlur:w},null,42,age),[[To,d.value],[ST,c.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ge(({hovered:O,focused:B})=>[O?(j(),ue("div",lge,[O&&!B?Ke((j(),qe(mt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(R,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:x,onKeydown:[zn(Pt(R,["prevent","stop"]),["enter"]),zn(Pt(T,["prevent","stop"]),["escape"])]},{default:ge(()=>[fe(U(lt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[U(o),"Edit"]]):Je("",!0)])):Je("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[U(s),{isLoading:D.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),cge=["tabindex"],aV=_t(rt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=Jt,o=Io,i=e,r=n,a=V(i.value),l=V(i.value),u=V(null),c=V(null),d=_n("bulkUpdate",!1),{apiServices:h}=ts(!d,i),f=Y(()=>{var X;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((X=a==null?void 0:a.value)==null?void 0:X.length)===0,inputRef:u,wrapperRef:c,clickable:!0}}),{isFocus:p}=ws(f),g=Y(()=>{const X=En.getInstance().getItem("ws.code"),ve=En.getInstance().getItem("BASE_URL"),ne=X||i.workspaceId;return co({type:"scene_hub",config:{baseDomain:ve,ws_code:ne,scene_id:String(i.id)}}).url}),v=Y(()=>{var X,ve,ne;return((ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.state)==0||((ne=i.data)==null?void 0:ne.isDeleted)==!0}),C=Y(()=>i.readOnly||R.value),S=Y(()=>{var X,ve,ne,L,H;return((X=i.data)==null?void 0:X.isDeleted)==!0||((ne=(ve=i.data)==null?void 0:ve.isProcessing)==null?void 0:ne.state)==0||((H=(L=i.data)==null?void 0:L.isProcessing)==null?void 0:H.state)==1}),b=Y(()=>{var X,ve;return(ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.message}),w=Y(()=>{var X;return((X=i.data)==null?void 0:X.isArchived)==1}),_=Y(()=>{var X;return((X=i.data)==null?void 0:X.isLocked)==1}),R=Y(()=>i.value===void 0),T=async X=>{var ve,ne,L,H,te,he,me,re,oe,z;a.value=X,p.value=!1;try{const pe=await((ne=(ve=h.value)==null?void 0:ve.updateSceneName)==null?void 0:ne.call(ve,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),ie=MF.get(TF)||"UTC";if(pe){const be=PF(pe,ie),G={...i.data,...be};(L=i.params)==null||L.api.clearFocusedCell();const q=((te=(H=i.params)==null?void 0:H.column)==null?void 0:te.getColId())||"",ce=((me=(he=i.params)==null?void 0:he.node)==null?void 0:me.rowIndex)||0;(re=i.params)==null||re.api.setFocusedCell(ce,q),(z=(oe=i.params)==null?void 0:oe.node)==null||z.setData(G),l.value=a.value,r("enter")}else a.value=l.value}catch(pe){console.error("Failed to update scene name:",pe),a.value=l.value}},I={focus:()=>{p.value=!0,Ct(()=>{var X;return(X=c.value)==null?void 0:X.focus()})},startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}},x=()=>c.value?"$el"in c.value?c.value.$el:c.value:null;tt(()=>i.value,X=>{a.value=X,l.value=X}),nn(()=>{const X=x();X&&(X.__sceneNameEditor=I)}),vs(()=>{const X=c.value,ve=X&&"$el"in X?X.$el:X;ve&&delete ve.__sceneNameEditor});const P=tf(),{openSceneHub:D}=P,F=X=>{try{if(X.ctrlKey||X.metaKey){window.open(g.value,"_blank");return}D(String(i.id))}catch{window.open(g.value,"_blank")}finally{J()}},k=()=>{setTimeout(()=>{ee.value=!0,O.value=0,Ct(()=>{var X;(X=B.value)==null||X.focus()})},300)},O=V(-1),B=V(null);t({focus:k,trigerFocus:k,startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}});const Z=X=>{if(X.key==="Enter"){X.preventDefault(),F(X);return}if(X.key==="Escape"){X.preventDefault(),J();return}X.key==="Tab"&&(X.preventDefault(),X.stopPropagation(),X.stopImmediatePropagation(),Ct(()=>{var ve;(ve=c.value)==null||ve.focusEditButton()}))},J=()=>{var ne,L,H,te,he,me;ee.value=!1,O.value=-1,(ne=i.params)==null||ne.api.clearFocusedCell();const X=((H=(L=i.params)==null?void 0:L.column)==null?void 0:H.getColId())||"",ve=((he=(te=i.params)==null?void 0:te.node)==null?void 0:he.rowIndex)||0;(me=i.params)==null||me.api.setFocusedCell(ve,X)},ee=V(!1);return(X,ve)=>Ke((j(),qe(uge,{"save-on-blur":!0,ref_key:"wrapperRef",ref:c,disabled:i.disabled,"read-only":C.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":ve[0]||(ve[0]=ne=>a.value=ne),id:`scene-name-${i.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ee.value,onBlur:J},{default:ge(({isHover:ne,isEditting:L})=>[Ke(_e("div",{class:Q(X.$style["scene-name-display"])},[Ke((j(),ue("a",{tabindex:O.value,ref_key:"nameRef",ref:B,onClick:Pt(F,["prevent"]),onKeydown:Z,target:"_blank",class:Q(X.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(wt(a.value),1)],42,cge)),[[U(s),{content:a.value,delay:[1e3,0]}]]),C.value||!ne&&!L&&!C.value?(j(),ue(xt,{key:0},[_.value?Ke((j(),ue("div",{key:0,class:Q([X.$style["icon-processing"],X.$style.isLocked])},[fe(lt,{src:"Lock"})],2)),[[U(s),{content:"Locked",delay:[1e3,0]}]]):Je("",!0),w.value?Ke((j(),ue("div",{key:1,class:Q([X.$style["icon-processing"],X.$style.archived])},[fe(lt,{src:"BoxArchive"})],2)),[[U(s),{content:"Archived",delay:[1e3,0]}]]):Je("",!0),S.value?Ke((j(),ue("div",{key:2,class:Q([X.$style["icon-processing"],X.$style.processing,v.value&&X.$style["icon-red"]])},[fe(lt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[U(s),b.value]]):Je("",!0)],64)):Je("",!0)],2),[[To,!U(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[U(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_1ws9s_1","scene-name-display":"_scene-name-display_1ws9s_11","icon-processing":"_icon-processing_1ws9s_18",archived:"_archived_1ws9s_28",locked:"_locked_1ws9s_31",processing:"_processing_1ws9s_34","icon-red":"_icon-red_1ws9s_38","scene-name-text":"_scene-name-text_1ws9s_43"}}]]),_0=_t(rt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const s=Ur,o=V([]),i=e,r=V(null),a=Y(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Y(()=>{let C=[];return typeof i.variant=="string"?C.push(i.variant):Array.isArray(i.variant)&&(C=[...i.variant]),[...C,"icon"]}),u=n,{hide:c,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=Fs({toggleOnClick:!0,offset:[0,0]});function v(C){u("select",C),c()}return th(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:c,hideDropdown:()=>{c()},popupRef:p}),tt(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(j(),ue("div",{class:Q(C.$style["button-dropdown-wrapper"]),style:dn({"--button-size":a.value})},[_e("div",{class:Q(C.$style["button-group"])},[Tt(C.$slots,"prefix"),_e("div",{ref_key:"triggerRef",ref:f,class:Q(U(d)?C.$style.open:"")},[Tt(C.$slots,"triggerDropdown",{open:U(d)},()=>[i.readOnly?Je("",!0):Ke((j(),qe(mt,{key:0,onEscape:U(c),ref_key:"mainButton",ref:r,actived:U(d),class:Q(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:ge(()=>[Tt(C.$slots,"iconDropdown",{},()=>[fe(lt,{class:Q(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[U(s),e.tabIndex]])])],2)],2),_e("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:Q(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(j(!0),ue(xt,null,xn(e.options,(b,w)=>Ke((j(),qe(eu,Xt({ref_for:!0,ref:_=>o.value[w]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Pt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ge(()=>[nt(wt(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[U(s),`${e.tabIndex}.${w}`]])),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"}}]]),Zf=_t(rt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},r=Y(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(j(),ue("div",{class:Q(a.$style["close-wrapper"])},[e.disableRemove?Je("",!0):(j(),ue("div",{key:0,class:Q(a.$style["close-button"])},[Ke((j(),qe(mt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:ge(()=>[fe(lt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[U(n),r.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),dge=_t(rt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Jt,n=Io,s=e,{isEditing:o}=Ac(s),i=V(s.value),r=V(null),a=V(null),{apiServices:l}=ts(!0,s),u=V(!0),c=()=>{u.value=s.value===void 0};eh(()=>{c()}),nn(()=>{c()}),tt(()=>s.value,I=>{c()});const d=Y(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:r,wrapperRef:a,clickable:!(s.readOnly||u.value),active:o})),{argsMain:h,isHover:f}=ws(d),p=Y(()=>{var I;return((I=i.value)==null?void 0:I.slice(0,s.maxVisible))||[]}),g=Y(()=>{var I;return Math.max(0,(((I=i.value)==null?void 0:I.length)||0)-s.maxVisible)}),v=Y(()=>{var I;return g.value<=0?"":((I=i.value)==null?void 0:I.slice(s.maxVisible).map(x=>x.name).join(", "))||""}),C=Y(()=>p.value.map(I=>({id:I.id,name:I.name,initial:I.initial,avatarId:I.id,profile_image:I.profile_image,color:I.color,size:24,user:I}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));tt(()=>s.value,I=>{i.value=I},{immediate:!0,deep:!0});const b=async I=>{var P,D,F;await T(I)&&(i.value=(P=i.value)==null?void 0:P.filter(k=>k.id!==I),(F=s.params)==null||F.node.setData({...(D=s.params)==null?void 0:D.node.data,assignees:i.value}))},w=I=>{var P;const x=En.getInstance().getItem("ws.code");return((P=l.value)==null?void 0:P.getUserInformation(x,I))||Promise.resolve(null)},{id:_}=Up(s),R=I=>{var P,D;const x=(D=(P=s.params)==null?void 0:P.api)==null?void 0:D.getRowNode(String(_.value));x==null||x.setDataValue("assignees",$I(I.assignees))},{removeAssignee:T}=mm({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(I,x)=>Ke((j(),qe(Cs,Xt(U(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ge(()=>{var P;return[_e("div",{class:Q(I.$style.assigneeGroupRenderer)},[((P=i.value)==null?void 0:P.length)===0?(j(),qe(lt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:dn(S.value)},null,8,["style"])):Je("",!0),(j(!0),ue(xt,null,xn(C.value,D=>(j(),qe(Zf,{key:D.id,"disable-remove":s.readOnly||s.disabled,onClear:F=>b(D.id),style:{marginLeft:"0"}},{default:ge(()=>[fe(Oc,{user:D.user,"show-profile":!0,apiUpdateFunction:w,class:Q(I.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((j(),ue("div",{key:1,class:Q(I.$style["extra-avatars"])},[nt(" +"+wt(g.value),1)],2)),[[U(t),v.value]]):Je("",!0)],2)]}),_:1},16)),[[U(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"}}]]),hge=_t(rt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var R,T;const t=Jt,n=Io,s=Eb(),o=e,i=V(null),r=V(null),{isEditing:a}=Ac(o),l=I=>{if(I){if(typeof I=="string")return I;if(I instanceof Date)return I.toISOString()}},u=Y(()=>o.value===void 0),c=Y(()=>{var I;return(I=o.data)==null?void 0:I.isStarted}),d=Y(()=>{var I;return(I=o.data)==null?void 0:I.isCompleted}),h=Y(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=Y(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=ws(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:w,fullEndDate:_}=O7({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:c.value,isEnded:d.value,timezone:o.timezone||s});return(I,x)=>Ke((j(),qe(Cs,Xt(U(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:ge(()=>[u.value?Je("",!0):(j(),ue("div",{key:0,class:Q(I.$style.dateRangeRenderer)},[h.value?Je("",!0):(j(),qe(lt,{key:0,src:"Calendar",class:Q(I.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(j(),ue(xt,{key:1},[Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(S).map(P=>I.$style[P])])},[nt(wt(U(v)),1)],2)),[[U(t),U(w)]]),x[0]||(x[0]=_e("span",null,"→",-1)),Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(b).map(P=>I.$style[P])])},[nt(wt(U(C)),1)],2)),[[U(t),U(_)]])],64)):Je("",!0)],2))]),_:1},16)),[[U(n),{isLoading:u.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),fge=rt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:Eb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=V(null);nn(()=>{Ct(()=>{s.value&&s.value.focus()})});const o=e,i=n,r=()=>{var C;(C=o.params)==null||C.api.stopEditing(),i("closed")},a=C=>`${bt.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},u=async()=>{await v({startDate:null})},c=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=_n("bulkUpdate",!1),{apiServices:g}=ts(!p,o),v=async C=>{var S,b,w,_,R;try{const T=(S=s.value)==null?void 0:S.getValues(),I=await((w=(b=g.value)==null?void 0:b.changeDate)==null?void 0:w.call(b,{workspaceId:o.workspaceId,itemIds:[o.id],startDate:C.startDate,dueDate:C.dueDate}));I!=null&&I.message&&((R=o.params)==null||R.node.setData({...(_=o.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:()=>{Ct(()=>{var C;(C=s.value)==null||C.focus()})}}),(C,S)=>(j(),qe(Am,Xt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:c,onClearStart:u,onClosed:r,ref_key:"calendarRef",ref:s}),null,16))}}),pge=_t(rt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=V(null),s=V(0);let o=null;nn(()=>{n.value&&(o=new ResizeObserver(r=>{for(const a of r)s.value=a.contentRect.height}),o.observe(n.value))}),Il(()=>{o&&n.value&&o.unobserve(n.value)});const i=Y(()=>{const r=s.value;return r>120?r-42-36:0});return(r,a)=>(j(),ue("div",{class:Q(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[_e("div",{class:Q(r.$style["item-header"])},[_e("div",{class:Q(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[_e("h1",{class:Q(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),_e("div",{class:Q(r.$style["item-header__spacer"])},null,2),_e("div",{class:Q(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:i.value}),_e("div",{class:Q(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$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"}}]]),lV=(e,t)=>{const n=V(Number(e.value.value)),s=Y(()=>e.value.metricConfig),o=Y(()=>{var g,v;const l=s.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}}),i=17,r=Y(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:o,metricConfig:s,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var u;return(((u=s.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}},gge=["aria-label"],uV=_t(rt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Io,s=Jt,o=e,i=Gp(!1),r=V(null),a=V(null),{isEditing:l}=Ac(o),u=Y(()=>{var B,Z;return{value:o.value,metricConfig:((Z=(B=o.params)==null?void 0:B.colDef)==null?void 0:Z.context)||o.config,error:o.error,hovered:i.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=lV(u,i),f=Y(()=>{var Z,J;let B=!1;if(["number","formula"].includes(d.value.metric_type.code)){const ee=Number(o.value),X=Number((Z=d.value)==null?void 0:Z.format_value);Number.isFinite(X)&&X>=0&&(B=(((J=ee.toString().split(".")[1])==null?void 0:J.length)||0)>X)}return B}),p=Y(()=>{var B;return!!((B=d.value)!=null&&B.morpheme_value)||c.value.isEmpty||f.value}),g=Y(()=>{var J,ee,X;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 B=x.value,Z=(J=d.value)==null?void 0:J.morpheme_type;return Z==="prefix"?`${((ee=d.value)==null?void 0:ee.morpheme_value)||""} ${B}`.trim():Z==="suffix"?`${B} ${((X=d.value)==null?void 0:X.morpheme_value)||""}`.trim():B}),v=Y(()=>{const{format_type:B,format_value:Z}=d.value;if(B==="dropdown"&&typeof Z=="string"&&Z.startsWith("["))try{return JSON.parse(Z)}catch{return[]}return[]}),C=Y(()=>({disabled:o.disabled,error:c.value.isError,inputRef:r,wrapperRef:a,clickable:!I.value,readOnly:o.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:S,isHover:b}=ws(C),w=(B,Z,J="en-US")=>new Intl.NumberFormat(J,{minimumFractionDigits:Z,maximumFractionDigits:Z}).format(B),_=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?R(B,J):R(X,J)}return typeof B=="number"?R(B,J):String(B)}),R=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].substring(0,ee).padEnd(ee,"0"):"0".repeat(ee);return ee>0?`${ve}.${ne}`:ve}return w(B,ee)}catch(X){return console.error("Error formatting metric value:",X,{num:B,decimals:ee}),String(B)}},T=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].length:0,L=Math.max(ee,ne),H=X[1]?X[1].padEnd(L,"0"):"0".repeat(L);return L>0?`${ve}.${H}`:ve}return new Intl.NumberFormat("en-US",{minimumFractionDigits:ee,maximumFractionDigits:20}).format(B)}catch(X){return console.error("Error formatting exact metric value:",X,{num:B,decimals:ee}),String(B)}},I=Y(()=>{var B;return((B=d.value)==null?void 0:B.metric_type.code)==="formula"}),x=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?T(B,J):T(X,J)}return typeof B=="number"?T(B,J):String(B)}),{tooltip:P}=NF(""),D=async B=>{B.stopPropagation(),B.preventDefault(),B.stopImmediatePropagation();try{await navigator.clipboard.writeText(x.value),P.value="Copied",setTimeout(()=>{P.value="Copy"},3e3)}catch(Z){console.error("Failed to copy text:",Z),P.value="Copy failed",setTimeout(()=>{P.value="Copy"},3e3)}};tt(()=>o.value,(B,Z)=>{const J=Number(B);Number.isFinite(J)&&J!==h.value?h.value=J:B==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{i.value=!0},O=()=>{i.value=!1};return(B,Z)=>Ke((j(),qe(Cs,Xt(U(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:O,ref_key:"wrapperRef",ref:a,actived:U(l),bordered:!0}),{suffix:ge(()=>[o.disabled?Je("",!0):(j(),ue("div",{key:0,class:Q([B.$style.suffix,"wrapper-suffix"])},[i.value&&!U(c).isEmpty&&!U(c).isError?Ke((j(),qe(mt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"])},{default:ge(()=>[fe(lt,{src:"Copy",source:"remote",size:12})]),_:1})),[[U(s),{content:U(P),hideOnClick:!1,contentClass:"extra-padding"}]]):Je("",!0)],2))]),default:ge(()=>[_e("div",{class:Q(B.$style["metric-wrapper"]),"aria-label":U(d).format_value||void 0},[_e("div",{class:Q([B.$style["metric-content"],o.disabled?B.$style.disabled:""])},[!U(c).isError&&U(c).isEmpty?(j(),ue(xt,{key:0},[U(c).pendingCalculation?Ke((j(),ue("span",{key:0,class:Q(B.$style["metric-empty"])},[...Z[0]||(Z[0]=[nt(" - ",-1)])],2)),[[U(s),"Can’t calculate yet. Complete required fields."]]):U(c).isEmpty?(j(),ue("span",{key:1,class:Q(B.$style["metric-empty"])}," - ",2)):Je("",!0)],64)):Je("",!0),U(c).isError?Ke((j(),ue("div",{key:1,class:Q(B.$style["metric-error"])},[...Z[1]||(Z[1]=[nt(" Error ",-1)])],2)),[[U(s),"Something went wrong. Review formula, inputs and retry."]]):Je("",!0),!U(c).isEmpty&&!U(c).isError?Ke((j(),ue("span",{key:2,class:Q([B.$style["metric-value"],U(b)?B.$style.hovered:"",{[B.$style.disabled]:o.disabled}])},[nt(wt(_.value),1)],2)),[[U(s),{content:g.value,bypassOverflowCheck:p.value}]]):Je("",!0)],2)],10,gge)]),_:1},16,["actived"])),[[U(n),{isLoading:U(c).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),mge={key:0,style:{color:"#6b6b6b"}},vge=_t(rt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Jt,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"}},o={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"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var F,k;if(a.headerType)return a.headerType;if(((k=(F=a.params)==null?void 0:F.column)==null?void 0:k.getColId()).includes("metric"))return"default";const D=a.headerType??a.params.column.getColId();return l[D]||"default"}),c=V(),d=()=>{var D,F,k;const P=(F=(D=a.params)==null?void 0:D.column)==null?void 0:F.getColDef();if((k=P.colId)!=null&&k.includes("metric")){if(P.context.is_primary==1)return"primary";if(P.context.is_point_metric==1)return"secondary"}};th(()=>{c.value=d()}),nn(()=>{c.value=d()});const h=Y(()=>{var P,D;return((D=(P=a.params)==null?void 0:P.column.getColDef().context)==null?void 0:D.morpheme_value)||void 0}),f=Y(()=>{var P;return(P=a.params)==null?void 0:P.displayName}),p=Y(()=>{let P=[];switch(u.value){case"dateRange":P=Object.values(s).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"date":P=Object.values(o).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"number":P=Object.values(i).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;default:P=Object.values(r).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break}return v.value!=="none"&&P.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),P}),g=Y(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=V(a.modelValue??"none"),C=P=>{_("update:modelValue",P),_("sort-changed",P)},S=P=>{v.value=P},b=Di(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let P;v.value==="none"?P="asc":v.value==="asc"?P="desc":P="none",v.value=P}else{const P=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],F=(P.indexOf(v.value)+1)%P.length;v.value=P[F]}},rr),w=Y(()=>{if(v.value==="none")return"No sorting applied";const P=p.value.find(D=>D.value===v.value);return(P==null?void 0:P.label)||""}),_=t,R=Y(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});tt(()=>a.modelValue,P=>{P!=v.value&&(v.value=P)}),tt(v,P=>{P!==a.modelValue&&C(P)});const T=V(v.value);tt(()=>v.value,P=>{T.value=P});const I=P=>{var O,B;if(a.readOnly||a.disabled)return;let D=0;P.key==="ArrowDown"?D=1:P.key==="ArrowUp"&&(D=-1);const F=p.value.findIndex(Z=>Z.value===T.value),k=p.value.length;if(P.key==="Enter"||P.key===" ")P.preventDefault(),v.value=T.value,(O=x.value)==null||O.hide();else if(D!==0){P.preventDefault();let Z=(F+D+k)%k;T.value=p.value[Z].value}else P.key==="Escape"&&((B=x.value)==null||B.hide())},x=V(null);return nn(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.addEventListener("keydown",I)}),Il(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.removeEventListener("keydown",I)}),(P,D)=>(j(),qe(_0,{ref_key:"dropdownRef",ref:x,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:U(b),onSelect:D[0]||(D[0]=F=>S(F))},{prefix:ge(()=>[fe(mt,{variant:["text"],onClick:U(b),size:"small"},{default:ge(()=>[Ke((j(),ue("b",null,[nt(wt(f.value),1)])),[[U(n),{content:f.value}]]),h.value?(j(),ue("small",mge," ("+wt(h.value)+") ",1)):Je("",!0),c.value=="primary"?Ke((j(),ue("div",{key:1,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Woohoo metric"]]):Je("",!0),c.value=="secondary"?Ke((j(),ue("div",{key:2,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Point Metric"]]):Je("",!0)]),_:1},8,["onClick"])]),iconDropdown:ge(()=>[Ke(fe(lt,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[U(n),w.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"}}]]),yge=["disabled","readonly","checked","indeterminate"],cV=_t(rt({__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=Jt,s=Ur,o=e,i=t,r=Y(()=>{if(typeof o.size=="string"){if(["small","medium","large"].includes(o.size))switch(o.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(o.size.endsWith("px"))return o.size}return typeof o.size=="number"?`${o.size}px`:"20px"}),a=Y(()=>o.allowIndeterminate?[Lt.UNCHECK,Lt.INDETERMINATE,Lt.CHECKED]:[Lt.UNCHECK,Lt.CHECKED]),l=Y(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(c.value){case Lt.UNCHECK:return o.tooltipText.unchecked;case Lt.INDETERMINATE:return o.tooltipText.indeterminate;case Lt.CHECKED:return o.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=V(typeof o.modelValue=="boolean"?o.modelValue?Lt.CHECKED:Lt.UNCHECK:o.modelValue),d=Y(()=>({checked:c.value===Lt.CHECKED,indeterminate:c.value===Lt.INDETERMINATE,none:c.value===Lt.UNCHECK})),h=Y(()=>o.disabled||o.readOnly);return tt(()=>c.value,f=>{i("update:modelValue",f===Lt.CHECKED)}),(f,p)=>Ke((j(),ue("input",{disabled:o.disabled,key:c.value,readonly:o.readOnly,type:"checkbox",class:Q([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:u,"aria-label":"Select All Items",style:dn({"--input-size":r.value})},null,46,yge)),[[U(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[U(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),wge=_t(rt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Jt,s=Wm(),{setSelectionStatus:o}=s,{rowCount:i,selectionStatus:r}=Qs(s),a=V(new Set);tt(r,w=>{o(w)},{immediate:!0});const l=Y(()=>r.value!==Lt.UNCHECK),u=Y(()=>({checked:r.value===Lt.CHECKED,indeterminate:r.value===Lt.INDETERMINATE,UNCHECK:r.value===Lt.UNCHECK})),c=Y(()=>({[Lt.UNCHECK]:"Click to select all",[Lt.INDETERMINATE]:"Click to clear selection",[Lt.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Y(()=>{const w=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&w.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),w}),h=w=>({selected:w.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:w,state:_})=>{if(w)if(_===Lt.UNCHECK)w.deselectAll(),a.value.clear(),r.value=_;else if(_===Lt.CHECKED){const R=new Set;w.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,w.forEachNode(T=>T.setSelected(!0)),r.value=_}else w.forEachNode(R=>R.setSelected(!0)),r.value=_},p=()=>{var R;const w=(R=t.params)==null?void 0:R.api;if(!w){console.error("[HeaderCheckbox] There is no API available");return}const _={[Lt.UNCHECK]:Lt.INDETERMINATE,[Lt.INDETERMINATE]:Lt.UNCHECK,[Lt.CHECKED]:Lt.UNCHECK};f({api:w,state:_[r.value]})},g=w=>{var T;const _=(T=t.params)==null?void 0:T.api;if(!_){console.error("no api");return}const R={INDETERMINATE:Lt.INDETERMINATE,GLOBAL:Lt.CHECKED,UNCHECK:Lt.UNCHECK};f({api:_,state:R[w]})},v=Di(w=>{const{selected:_,total:R}=h(w);if(R==0){r.value=Lt.UNCHECK;return}_===R?r.value=Lt.CHECKED:_===0?r.value=Lt.UNCHECK:r.value=Lt.INDETERMINATE},300);let C=[];const S=w=>{v(w)};nn(()=>{var I;const w=(I=t.params)==null?void 0:I.api;if(!w)return;const _=x=>v(x.api),R=()=>S(w),T=()=>S(w);w.addEventListener("selectionChanged",_),w.addEventListener("rowDataUpdated",R),w.addEventListener("modelUpdated",R),C=[()=>w.removeEventListener("selectionChanged",_),()=>w.removeEventListener("rowDataUpdated",R),()=>w.removeEventListener("modelUpdated",T)]}),vs(()=>{C.forEach(w=>w())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(w,_)=>(j(),qe(_0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ge(()=>[Ke((j(),qe(cV,{"tab-index":"8",id:b,disabled:t.disabled,key:U(r),readonly:t.readOnly,type:"checkbox",checked:u.value.checked,indeterminate:u.value.indeterminate,modelValue:U(r),"onUpdate:modelValue":_[0]||(_[0]=R=>gn(r)?r.value=R:null),onChange:p,"aria-label":U(r)===U(Lt).CHECKED?"All items selected":"Select visible items",class:Q(w.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[U(n),{content:c.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),Cge={key:1},bge=_t(rt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Io,n=Jt,s=e,{isEditing:o}=Ac(s),i=V(null),r=V(null),a=Y(()=>s.value),l=Y(()=>a.value===void 0),u=Y(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),c=Y(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:Cj((g=a.value)==null?void 0:g.label),inputRef:i,wrapperRef:r,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ws(c),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=Y(()=>new Nn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((j(),qe(U(Cs),Xt(U(d),{ref_key:"wrapperRef",ref:r,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!U(o)&&!U(h)?"#f3f5f8":void 0}}),{default:ge(()=>[l.value?Je("",!0):(j(),ue("div",{key:0,class:Q(g.$style["status-renderer"])},[a.value?Ke((j(),ue("div",{key:0,class:Q(g.$style["status-renderer__status-name"])},[nt(wt(u.value),1)],2)),[[U(n),{content:u.value,delay:[1e3,0]}]]):l.value?Je("",!0):(j(),ue("div",Cge,"No status"))],2))]),_:1},16,["style"])),[[U(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_108pu_1","status-renderer__color-code":"_status-renderer__color-code_108pu_10","status-renderer__status-name":"_status-renderer__status-name_108pu_20"}}]]),dV=_t(rt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const s=e,{popupRef:o,show:i,hide:r,isVisible:a}=$7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(c){return document.body}}),l=c=>{s.closeOnEscape&&c.key==="Escape"&&a.value&&r()};nn(()=>{document.addEventListener("keydown",l)}),vs(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const u=n;return tt(()=>a.value,c=>{u(c?"shown":"hidden")}),(c,d)=>{const h=_o("tooltip");return j(),ue("div",{ref_key:"popupRef",ref:o,class:Q(c.$style.popupContainer)},[_e("div",{class:Q(c.$style.popupWrapper)},[_e("div",{class:Q(c.$style.header)},[_e("span",{class:Q(c.$style["header-title"])},wt(e.popupName),3),Ke((j(),qe(mt,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:U(r),"aria-label":"Close popup"},{default:ge(()=>[fe(lt,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),_e("div",{class:Q(c.$style.body)},[Tt(c.$slots,"default")],2),_e("div",{class:Q(c.$style.footer)},[Tt(c.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),Sge={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class Ege extends Error{}class rl extends Ege{constructor(){super("Zone is an abstract class")}}class hV{get type(){throw new rl}get name(){throw new rl}get ianaName(){return this.name}get isUniversal(){throw new rl}offsetName(t,n){throw new rl}formatOffset(t,n){throw new rl}offset(t){throw new rl}equals(t){throw new rl}get isValid(){throw new rl}}const R0=new Map;function _ge(e){let t=R0.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"}),R0.set(e,t)),t}const Rge={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Dge(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function Tge(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=Rge[i];i==="era"?s[a]=r:Zv(a)||(s[a]=parseInt(r,10))}return s}const D0=new Map;class Yv extends hV{static create(t){let n=D0.get(t);return n===void 0&&D0.set(t,n=new Yv(t)),n}static resetCache(){D0.clear(),R0.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=Yv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Fge(t,n,s,this.name)}formatOffset(t,n){return Jv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=_ge(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?Tge(s,n):Dge(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=xge({year:o,month:i,day:r,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 T0=null;class hd extends hV{static get utcInstance(){return T0===null&&(T0=new hd(0)),T0}static instance(t){return t===0?hd.utcInstance:new hd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new hd(pV(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Jv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Zv(e){return typeof e>"u"}function Xv(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function fV(e){if(!(Zv(e)||e===null||e===""))return parseInt(e,10)}function Ige(e){if(!(Zv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function xge(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 Fge(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function pV(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Jv(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Xv(n,2)}:${Xv(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${Xv(n,2)}${Xv(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const gV=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fd(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function pd(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function mV(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=fV(t[n+o]);return[s,null,n+o]}}const vV=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Pge=`(?:${vV.source}?(?:\\[(${gV.source})\\])?)?`,yV=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,wV=RegExp(`${yV.source}${Pge}`),I0=RegExp(`(?:[Tt]${wV.source})?`),Age=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,kge=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Oge=/(\d{4})-?(\d{3})/,Mge=mV("weekYear","weekNumber","weekDay"),Nge=mV("year","ordinal"),Lge=/(\d{4})-(\d\d)-(\d\d)/,CV=RegExp(`${yV.source} ?(?:${vV.source}|(${gV.source}))?`),Vge=RegExp(`(?: ${CV.source})?`);function gd(e,t,n){const s=e[t];return Zv(s)?n:fV(s)}function Bge(e,t){return[{year:gd(e,t),month:gd(e,t+1,1),day:gd(e,t+2,1)},null,t+3]}function md(e,t){return[{hours:gd(e,t,0),minutes:gd(e,t+1,0),seconds:gd(e,t+2,0),milliseconds:Ige(e[t+3])},null,t+4]}function Xf(e,t){const n=!e[t]&&!e[t+1],s=pV(e[t+1],e[t+2]),o=n?null:hd.instance(s);return[{},o,t+3]}function Jf(e,t){const n=e[t]?Yv.create(e[t]):null;return[{},n,t+1]}fd(Age,I0),fd(kge,I0),fd(Oge,I0),fd(wV),pd(Bge,md,Xf,Jf),pd(Mge,md,Xf,Jf),pd(Nge,md,Xf,Jf),pd(md,Xf,Jf),pd(md),fd(Lge,Vge),fd(CV),pd(md,Xf,Jf);function vd(e){"@babel/helpers - typeof";return vd=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},vd(e)}var bs;(function(e){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}"})(bs||(bs={})),bs.review,bs.review_take,bs.review_scene,bs.review_rendition,bs.review_frame,bs.review_rendition_comment,bs.review_comment,bs.scene_hub,bs.hub_rendition,bs.hub_comment,bs.people_insight,bs.people_detail,bs.project,bs.woohoo,bs.update,bs.core,bs.project_focusMode;var x0=null;function $ge(e){x0=e}function Qv(){if(!x0)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return x0}function bV(){try{var e=Qv();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function Hge(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&vd(s)==="object")Object.keys(s).forEach(function(r){var a="{".concat(r,"}"),l=s[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(s.min||s.max)&&(l="".concat(s.min||s.value," and ").concat(s.max||s.value)),o=o.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),o=o.replace(/{value}/g,i)}return o}function Gge(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var i=o[s],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function SV(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function EV(e,t){if(!e||vd(e)!=="object")return null;try{var n=Qv();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),i=0,r=o;i<r.length;i++){var a=r[i],l=s[a];if(l&&l.rule){var u=l.rule,c=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[u]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[u]}if(v&&typeof v=="string")return Hge(v,a,c,d)}catch(w){console.error("Error in validation rules",w)}}}}catch(w){return console.error("Error in getValidationErrorMessage:",w),null}return null}function Uge(e){if(!e)return bV();var t=e.code,n=e.error,s=e.details,o=e.message;if(SV(s)&&s){var i=EV(s,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=Qv();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&vd(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l,u,c,d="errorMessages.".concat(a,".").concat(n.key),h=Qv(),f=((l=h.messages)===null||l===void 0?void 0:l.value)||h.messages,p=((u=h.locale)===null||u===void 0?void 0:u.value)||h.locale,g=(c=f[p])===null||c===void 0||(c=c.errorMessages)===null||c===void 0||(c=c[a])===null||c===void 0?void 0:c[n.key];if(g&&typeof g=="string"){var v=g;return s!=null&&s.context&&(v=Gge(v,s.context),console.log("[Error Utils Debug]",v)),t!==""?"[".concat(t,"] ").concat(v):v}}catch(S){console.error("[Error Utils Debug]",S)}}if(n&&vd(n)!=="object"&&SV(s)){var C=EV(s);if(C)return t!==""?"[".concat(t,"] ").concat(C):C}return o||bV()}var Wge={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}.",before_or_equal:"{field} must be a date before or equal {value}.",after_or_equal:"{field} must be a date after or equal {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}.",in:"Update failed. Only these values are allowed: {value}.",between:"Update failed. Enter a value between {value}."},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const Qf=Ql("toast",()=>{const e=l=>{var u;if((l==null?void 0:l.apiCode)==="offline")o({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const c=Uge((u=l==null?void 0:l.res)==null?void 0:u.data);o({id:l==null?void 0:l.apiCode,type:"error",message:c})}},t=V([]),n=(l,u)=>{const c=Sge[l];if(c){const d=c[u];if(d){o({id:l,type:u,message:d});return}}else o({id:l,type:u,message:l})},s=new Map,o=(l,u=5e3)=>{const c={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(c),u>0){const d=Date.now(),h=setTimeout(()=>{i(c.id),s.delete(c.id)},u);s.set(c.id,{timeoutId:h,remainingTime:u,startTime:d})}};function i(l){t.value=t.value.filter(c=>c.id!==l);const u=s.get(l);u&&(clearTimeout(u.timeoutId),s.delete(l))}function r(l){const u=s.get(l);if(u){clearTimeout(u.timeoutId);const c=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-c)}}function a(l){const u=s.get(l);if(u&&u.remainingTime>0){const c=setTimeout(()=>{i(l),s.delete(l)},u.remainingTime);u.timeoutId=c,u.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),zge=["onMouseenter","onMouseleave"],jge=["innerHTML"],Kge=["innerHTML"],qge=["data-tooltip"],Yge={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},Zge=_t(rt({__name:"Snackbar",setup(e){const t=Jt,n=EU,s=Qf(),{removeNotification:o}=s,{notifications:i}=Qs(s),r=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},u=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},c=V(new Set),d=f=>{var p;c.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;c.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(j(),qe(rU,{name:"list",tag:"div",class:Q(["notification-center",f.$style["notification-wrapper"]])},{default:ge(()=>[(j(!0),ue(xt,null,xn(U(i),g=>{var v;return Ke((j(),ue("div",{key:g.id,class:Q([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[_e("p",{class:Q(f.$style.snackbar__message)},[_e("span",{class:Q(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(j(),qe(lt,{key:0,src:"CircleCheck",source:"remote"})):Je("",!0),!g.icon&&g.type=="interactive"?(j(),qe(lt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(j(),qe(lt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(j(),ue("i",{key:3,class:Q(f.$style["icon-draw"]),innerHTML:g.icon},null,10,jge)):g.icon&&!r(g.icon)?(j(),qe(lt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)],2),_e("span",{class:Q(f.$style["error-message"])},[_e("span",{class:Q(f.$style.message),innerHTML:g.message},null,10,Kge)],2)],2),g.actions?(j(),ue("div",{key:0,class:Q(f.$style["actions-notification"]),"data-notification":"true"},[(j(!0),ue(xt,null,xn(g.actions,C=>(j(),qe(mt,Xt({key:C.label},{ref_for:!0},C,{onClick:Pt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ge(()=>[C.btnIcon?(j(),qe(lt,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)]),_:2},1040,["onClick"]))),128))],2)):Je("",!0),g.type!=="interactive"?Ke((j(),ue("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(mt,{variant:"secondary",onClick:C=>u(g.message),class:Q(f.$style["copy-btn"])},{prefix:ge(()=>[fe(lt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,qge)),[[U(t),a.value]]):Je("",!0),g.type=="interactive"?Ke((j(),ue("div",Yge,[fe(mt,{variant:"tertiary",onClick:C=>U(o)(g.id),class:Q(f.$style["close-btn"]),size:18},{default:ge(()=>[fe(lt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[U(t),"Close"]]):Je("",!0)],42,zge)),[[U(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
207
207
  * vue-draggable-next v2.3.0
208
208
  * (c) 2025 Anish George
209
209
  * @license MIT
@@ -212,7 +212,7 @@ If you are trying to annotate ${s} with application data, use the '${s}.context'
212
212
  * @author RubaXa <trash@rubaxa.org>
213
213
  * @author owenm <owen23355@gmail.com>
214
214
  * @license MIT
215
- */function DV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DV(Object(n),!0).forEach(function(s){tme(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DV(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ey(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ey=function(t){return typeof t}:ey=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ey(e)}function tme(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function da(){return da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},da.apply(this,arguments)}function nme(e,t){if(e==null)return{};var n={},s=Object.keys(e),o,i;for(i=0;i<s.length;i++)o=s[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function sme(e,t){if(e==null)return{};var n=nme(e,t),s,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)s=i[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}var ome="1.14.0";function ha(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var fa=ha(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ep=ha(/Edge/i),TV=ha(/firefox/i),tp=ha(/safari/i)&&!ha(/chrome/i)&&!ha(/android/i),IV=ha(/iP(ad|od|hone)/i),ime=ha(/chrome/i)&&ha(/android/i),xV={capture:!1,passive:!1};function wn(e,t,n){e.addEventListener(t,n,!fa&&xV)}function fn(e,t,n){e.removeEventListener(t,n,!fa&&xV)}function ty(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 rme(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function _r(e,t,n,s){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&ty(e,t):ty(e,t))||s&&e===n)return e;if(e===n)break}while(e=rme(e))}return null}var FV=/\s+/g;function Bo(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(FV," ").replace(" "+t+" "," ");e.className=(s+(n?" "+t:"")).replace(FV," ")}}function Bt(e,t,n){var s=e&&e.style;if(s){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 s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=n+(typeof n=="string"?"":"px")}}function yd(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Bt(e,"transform");s&&s!=="none"&&(n=s+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function PV(e,t,n){if(e){var s=e.getElementsByTagName(t),o=0,i=s.length;if(n)for(;o<i;o++)n(s[o],o);return s}return[]}function Rr(){var e=document.scrollingElement;return e||document.documentElement}function Ss(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==Rr()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!fa))do if(o&&o.getBoundingClientRect&&(Bt(o,"transform")!=="none"||n&&Bt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Bt(o,"border-top-width")),a-=h.left+parseInt(Bt(o,"border-left-width")),l=r+i.height,u=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=yd(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,c/=g,l=r+c,u=a+d)}return{top:r,left:a,bottom:l,right:u,width:d,height:c}}}function AV(e,t,n){for(var s=al(e,!0),o=Ss(e)[t];s;){var i=Ss(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===Rr())break;s=al(s,!1)}return!1}function wd(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==$t.ghost&&(s||r[i]!==$t.dragged)&&_r(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function P0(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!ty(n,t));)n=n.previousElementSibling;return n||null}function di(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||ty(e,t))&&n++;return n}function kV(e){var t=0,n=0,s=Rr();if(e)do{var o=yd(e),i=o.a,r=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,n]}function ame(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[n][s])return Number(n)}return-1}function al(e,t){if(!e||!e.getBoundingClientRect)return Rr();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Bt(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Rr();if(s||t)return n;s=!0}}while(n=n.parentNode);return Rr()}function lme(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function A0(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 np;function OV(e,t){return function(){if(!np){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),np=setTimeout(function(){np=void 0},t)}}}function ume(){clearTimeout(np),np=void 0}function MV(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function NV(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 $o="Sortable"+new Date().getTime();function cme(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Bt(o,"display")==="none"||o===$t.ghost)){e.push({target:o,rect:Ss(o)});var i=Er({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=yd(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(ame(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var i=!1,r=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=Ss(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=yd(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&A0(h,d)&&!A0(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=hme(p,h,f,o.options)),A0(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,p,d,l)),l&&(i=!0,r=Math.max(r,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),i?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,i,r){if(r){Bt(s,"transition",""),Bt(s,"transform","");var a=yd(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-i.left)/(l||1),d=(o.top-i.top)/(u||1);s.animatingX=!!c,s.animatingY=!!d,Bt(s,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=dme(s),Bt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Bt(s,"transition",""),Bt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function dme(e){return e.offsetWidth}function hme(e,t,n,s){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))*s.animation}var Cd=[],k0={initializeByDefault:!0},sp={mount:function(t){for(var n in k0)k0.hasOwnProperty(n)&&!(n in t)&&(t[n]=k0[n]);Cd.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Cd.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Cd.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](Er({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](Er({sortable:n},s)))})},initializePlugins:function(t,n,s,o){Cd.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,da(s,u.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);typeof r<"u"&&(t.options[i]=r)}},getEventProperties:function(t,n){var s={};return Cd.forEach(function(o){typeof o.eventProperties=="function"&&da(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return Cd.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function fme(e){var t=e.sortable,n=e.rootEl,s=e.name,o=e.targetEl,i=e.cloneEl,r=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[$o],!!t){var g,v=t.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!fa&&!ep?g=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(s,!0,!0)),g.to=r||n,g.from=a||n,g.item=o||n,g.clone=i,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=Er(Er({},p),sp.getEventProperties(s,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[C]&&v[C].call(t,g)}}var pme=["evt"],vo=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=sme(s,pme);sp.pluginEvent.bind($t)(t,n,Er({dragEl:ft,parentEl:Jn,ghostEl:Yt,rootEl:Un,nextEl:Su,lastDownEl:ny,cloneEl:Qn,cloneHidden:ll,dragStarted:ip,putSortable:Os,activeSortable:$t.active,originalEvent:o,oldIndex:bd,oldDraggableIndex:op,newIndex:Ho,newDraggableIndex:ul,hideGhostForTarget:UV,unhideGhostForTarget:WV,cloneNowHidden:function(){ll=!0},cloneNowShown:function(){ll=!1},dispatchSortableEvent:function(a){to({sortable:n,name:a,originalEvent:o})}},i))};function to(e){fme(Er({putSortable:Os,cloneEl:Qn,targetEl:ft,rootEl:Un,oldIndex:bd,oldDraggableIndex:op,newIndex:Ho,newDraggableIndex:ul},e))}var ft,Jn,Yt,Un,Su,ny,Qn,ll,bd,Ho,op,ul,sy,Os,Sd=!1,oy=!1,iy=[],Eu,Vi,O0,M0,LV,VV,ip,Ed,rp,ap=!1,ry=!1,ay,zs,N0=[],L0=!1,ly=[],uy=typeof document<"u",cy=IV,BV=ep||fa?"cssFloat":"float",gme=uy&&!ime&&!IV&&"draggable"in document.createElement("div"),$V=function(){if(uy){if(fa)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),HV=function(t,n){var s=Bt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=wd(t,0,n),r=wd(t,1,n),a=i&&Bt(i),l=r&&Bt(r),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ss(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ss(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=o&&s[BV]==="none"||r&&s[BV]==="none"&&u+c>o)?"vertical":"horizontal"},mme=function(t,n,s){var o=s?t.left:t.top,i=s?t.right:t.bottom,r=s?t.width:t.height,a=s?n.left:n.top,l=s?n.right:n.bottom,u=s?n.width:n.height;return o===a||i===l||o+r/2===a+u/2},vme=function(t,n){var s;return iy.some(function(o){var i=o[$o].options.emptyInsertThreshold;if(!(!i||P0(o))){var r=Ss(o),a=t>=r.left-i&&t<=r.right+i,l=n>=r.top-i&&n<=r.bottom+i;if(a&&l)return s=o}}),s},GV=function(t){function n(i,r){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(i==null&&(r||d))return!0;if(i==null||i===!1)return!1;if(r&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,u,c),r)(a,l,u,c);var h=(r?a:l).options.group.name;return i===!0||typeof i=="string"&&i===h||i.join&&i.indexOf(h)>-1}}var s={},o=t.group;(!o||ey(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=n(o.pull,!0),s.checkPut=n(o.put),s.revertClone=o.revertClone,t.group=s},UV=function(){!$V&&Yt&&Bt(Yt,"display","none")},WV=function(){!$V&&Yt&&Bt(Yt,"display","")};uy&&document.addEventListener("click",function(e){if(oy)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),oy=!1,!1},!0);var _u=function(t){if(ft){t=t.touches?t.touches[0]:t;var n=vme(t.clientX,t.clientY);if(n){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=n,s.preventDefault=void 0,s.stopPropagation=void 0,n[$o]._onDragOver(s)}}},yme=function(t){ft&&ft.parentNode[$o]._isOutsideThisEl(t.target)};function $t(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=da({},t),e[$o]=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 HV(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(r,a){r.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:$t.supportPointer!==!1&&"PointerEvent"in window&&!tp,emptyInsertThreshold:5};sp.initializePlugins(this,e,n);for(var s in n)!(s in t)&&(t[s]=n[s]);GV(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:gme,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)),iy.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),da(this,cme())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ed=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ft):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,s=this.el,o=this.options,i=o.preventOnFilter,r=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=o.filter;if(Dme(s),!ft&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&tp&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=_r(l,o.draggable,s,!1),!(l&&l.animated)&&ny!==l)){if(bd=di(l),op=di(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){to({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:s,fromEl:s}),vo("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=_r(u,d.trim(),s,!1),d)return to({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),vo("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!_r(u,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,s){var o=this,i=o.el,r=o.options,a=i.ownerDocument,l;if(s&&!ft&&s.parentNode===i){var u=Ss(s);if(Un=i,ft=s,Jn=ft.parentNode,Su=ft.nextSibling,ny=s,sy=r.group,$t.dragged=ft,Eu={target:ft,clientX:(n||t).clientX,clientY:(n||t).clientY},LV=Eu.clientX-u.left,VV=Eu.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ft.style["will-change"]="all",l=function(){if(vo("delayEnded",o,{evt:t}),$t.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!TV&&o.nativeDraggable&&(ft.draggable=!0),o._triggerDragStart(t,n),to({sortable:o,name:"choose",originalEvent:t}),Bo(ft,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){PV(ft,c.trim(),V0)}),wn(a,"dragover",_u),wn(a,"mousemove",_u),wn(a,"touchmove",_u),wn(a,"mouseup",o._onDrop),wn(a,"touchend",o._onDrop),wn(a,"touchcancel",o._onDrop),TV&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ft.draggable=!0),vo("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ep||fa))){if($t.eventCanceled){this._onDrop();return}wn(a,"mouseup",o._disableDelayedDrag),wn(a,"touchend",o._disableDelayedDrag),wn(a,"touchcancel",o._disableDelayedDrag),wn(a,"mousemove",o._delayedDragTouchMoveHandler),wn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&wn(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.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(){ft&&V0(ft),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._disableDelayedDrag),fn(t,"touchend",this._disableDelayedDrag),fn(t,"touchcancel",this._disableDelayedDrag),fn(t,"mousemove",this._delayedDragTouchMoveHandler),fn(t,"touchmove",this._delayedDragTouchMoveHandler),fn(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(ft,"dragend",this),wn(Un,"dragstart",this._onDragStart));try{document.selection?hy(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Sd=!1,Un&&ft){vo("dragStarted",this,{evt:n}),this.nativeDraggable&&wn(document,"dragover",yme);var s=this.options;!t&&Bo(ft,s.dragClass,!1),Bo(ft,s.ghostClass,!0),$t.active=this,t&&this._appendGhost(),to({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Vi){this._lastX=Vi.clientX,this._lastY=Vi.clientY,UV();for(var t=document.elementFromPoint(Vi.clientX,Vi.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Vi.clientX,Vi.clientY),t!==n);)n=t;if(ft.parentNode[$o]._isOutsideThisEl(t),n)do{if(n[$o]){var s=void 0;if(s=n[$o]._onDragOver({clientX:Vi.clientX,clientY:Vi.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);WV()}},_onTouchMove:function(t){if(Eu){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=Yt&&yd(Yt,!0),a=Yt&&r&&r.a,l=Yt&&r&&r.d,u=cy&&zs&&kV(zs),c=(i.clientX-Eu.clientX+o.x)/(a||1)+(u?u[0]-N0[0]:0)/(a||1),d=(i.clientY-Eu.clientY+o.y)/(l||1)+(u?u[1]-N0[1]:0)/(l||1);if(!$t.active&&!Sd){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Yt){r?(r.e+=c-(O0||0),r.f+=d-(M0||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Bt(Yt,"webkitTransform",h),Bt(Yt,"mozTransform",h),Bt(Yt,"msTransform",h),Bt(Yt,"transform",h),O0=c,M0=d,Vi=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Yt){var t=this.options.fallbackOnBody?document.body:Un,n=Ss(ft,!0,cy,!0,t),s=this.options;if(cy){for(zs=t;Bt(zs,"position")==="static"&&Bt(zs,"transform")==="none"&&zs!==document;)zs=zs.parentNode;zs!==document.body&&zs!==document.documentElement?(zs===document&&(zs=Rr()),n.top+=zs.scrollTop,n.left+=zs.scrollLeft):zs=Rr(),N0=kV(zs)}Yt=ft.cloneNode(!0),Bo(Yt,s.ghostClass,!1),Bo(Yt,s.fallbackClass,!0),Bo(Yt,s.dragClass,!0),Bt(Yt,"transition",""),Bt(Yt,"transform",""),Bt(Yt,"box-sizing","border-box"),Bt(Yt,"margin",0),Bt(Yt,"top",n.top),Bt(Yt,"left",n.left),Bt(Yt,"width",n.width),Bt(Yt,"height",n.height),Bt(Yt,"opacity","0.8"),Bt(Yt,"position",cy?"absolute":"fixed"),Bt(Yt,"zIndex","100000"),Bt(Yt,"pointerEvents","none"),$t.ghost=Yt,t.appendChild(Yt),Bt(Yt,"transform-origin",LV/parseInt(Yt.style.width)*100+"% "+VV/parseInt(Yt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(vo("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}vo("setupClone",this),$t.eventCanceled||(Qn=NV(ft),Qn.draggable=!1,Qn.style["will-change"]="",this._hideClone(),Bo(Qn,this.options.chosenClass,!1),$t.clone=Qn),s.cloneId=hy(function(){vo("clone",s),!$t.eventCanceled&&(s.options.removeCloneOnHide||Un.insertBefore(Qn,ft),s._hideClone(),to({sortable:s,name:"clone"}))}),!n&&Bo(ft,i.dragClass,!0),n?(oy=!0,s._loopId=setInterval(s._emulateDragOver,50)):(fn(document,"mouseup",s._onDrop),fn(document,"touchend",s._onDrop),fn(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ft)),wn(document,"drop",s),Bt(ft,"transform","translateZ(0)")),Sd=!0,s._dragStartId=hy(s._dragStarted.bind(s,n,t)),wn(document,"selectstart",s),ip=!0,tp&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,u=$t.active,c=sy===l,d=a.sort,h=Os||u,f,p=this,g=!1;if(L0)return;function v(ee,X){vo(ee,p,Er({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:S,onMove:function(ne,L){return dy(Un,n,ft,o,ne,Ss(ne),t,L)},changed:b},X))}function C(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(p),p!==h&&(Bo(ft,Os?Os.options.ghostClass:u.options.ghostClass,!1),Bo(ft,a.ghostClass,!0)),Os!==p&&p!==$t.active?Os=p:p===$t.active&&Os&&(Os=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ft&&!ft.animated||s===n&&!s.animated)&&(Ed=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ft.parentNode[$o]._isOutsideThisEl(t.target),!ee&&_u(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Ho=di(ft),ul=di(ft,a.draggable),to({sortable:p,name:"change",toEl:n,newIndex:Ho,newDraggableIndex:ul,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=_r(s,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(ft.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return S(!1);if(oy=!1,u&&!a.disabled&&(c?d||(r=Jn!==Un):Os===this||(this.lastPutMode=sy.checkPull(this,u,ft,t))&&l.checkPut(this,u,ft,t))){if(f=this._getDirection(t,s)==="vertical",o=Ss(ft),v("dragOverValid"),$t.eventCanceled)return g;if(r)return Jn=Un,C(),this._hideClone(),v("revert"),$t.eventCanceled||(Su?Un.insertBefore(ft,Su):Un.appendChild(ft)),S(!0);var w=P0(n,a.draggable);if(!w||Sme(t,f,this)&&!w.animated){if(w===ft)return S(!1);if(w&&n===t.target&&(s=w),s&&(i=Ss(s)),dy(Un,n,ft,o,s,i,t,!!s)!==!1)return C(),n.appendChild(ft),Jn=n,b(),S(!0)}else if(w&&bme(t,f,this)){var _=wd(n,0,a,!0);if(_===ft)return S(!1);if(s=_,i=Ss(s),dy(Un,n,ft,o,s,i,t,!1)!==!1)return C(),n.insertBefore(ft,_),Jn=n,b(),S(!0)}else if(s.parentNode===n){i=Ss(s);var R=0,T,I=ft.parentNode!==n,x=!mme(ft.animated&&ft.toRect||o,s.animated&&s.toRect||i,f),P=f?"top":"left",D=AV(s,"top","top")||AV(ft,"top","top"),F=D?D.scrollTop:void 0;Ed!==s&&(T=i[P],ap=!1,ry=!x&&a.invertSwap||I),R=Eme(t,s,i,f,x?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,ry,Ed===s);var k;if(R!==0){var O=di(ft);do O-=R,k=Jn.children[O];while(k&&(Bt(k,"display")==="none"||k===Yt))}if(R===0||k===s)return S(!1);Ed=s,rp=R;var B=s.nextElementSibling,Z=!1;Z=R===1;var J=dy(Un,n,ft,o,s,i,t,Z);if(J!==!1)return(J===1||J===-1)&&(Z=J===1),L0=!0,setTimeout(Cme,30),C(),Z&&!B?n.appendChild(ft):s.parentNode.insertBefore(ft,Z?B:s),D&&MV(D,0,F-D.scrollTop),Jn=ft.parentNode,T!==void 0&&!ry&&(ay=Math.abs(T-Ss(s)[P])),b(),S(!0)}if(n.contains(ft))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){fn(document,"mousemove",this._onTouchMove),fn(document,"touchmove",this._onTouchMove),fn(document,"pointermove",this._onTouchMove),fn(document,"dragover",_u),fn(document,"mousemove",_u),fn(document,"touchmove",_u)},_offUpEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._onDrop),fn(t,"touchend",this._onDrop),fn(t,"pointerup",this._onDrop),fn(t,"touchcancel",this._onDrop),fn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(Ho=di(ft),ul=di(ft,s.draggable),vo("drop",this,{evt:t}),Jn=ft&&ft.parentNode,Ho=di(ft),ul=di(ft,s.draggable),$t.eventCanceled){this._nulling();return}Sd=!1,ry=!1,ap=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),B0(this.cloneId),B0(this._dragStartId),this.nativeDraggable&&(fn(document,"drop",this),fn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),tp&&Bt(document.body,"user-select",""),Bt(ft,"transform",""),t&&(ip&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Yt&&Yt.parentNode&&Yt.parentNode.removeChild(Yt),(Un===Jn||Os&&Os.lastPutMode!=="clone")&&Qn&&Qn.parentNode&&Qn.parentNode.removeChild(Qn),ft&&(this.nativeDraggable&&fn(ft,"dragend",this),V0(ft),ft.style["will-change"]="",ip&&!Sd&&Bo(ft,Os?Os.options.ghostClass:this.options.ghostClass,!1),Bo(ft,this.options.chosenClass,!1),to({sortable:this,name:"unchoose",toEl:Jn,newIndex:null,newDraggableIndex:null,originalEvent:t}),Un!==Jn?(Ho>=0&&(to({rootEl:Jn,name:"add",toEl:Jn,fromEl:Un,originalEvent:t}),to({sortable:this,name:"remove",toEl:Jn,originalEvent:t}),to({rootEl:Jn,name:"sort",toEl:Jn,fromEl:Un,originalEvent:t}),to({sortable:this,name:"sort",toEl:Jn,originalEvent:t})),Os&&Os.save()):Ho!==bd&&Ho>=0&&(to({sortable:this,name:"update",toEl:Jn,originalEvent:t}),to({sortable:this,name:"sort",toEl:Jn,originalEvent:t})),$t.active&&((Ho==null||Ho===-1)&&(Ho=bd,ul=op),to({sortable:this,name:"end",toEl:Jn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){vo("nulling",this),Un=ft=Jn=Yt=Su=Qn=ny=ll=Eu=Vi=ip=Ho=ul=bd=op=Ed=rp=Os=sy=$t.dragged=$t.ghost=$t.clone=$t.active=null,ly.forEach(function(t){t.checked=!0}),ly.length=O0=M0=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ft&&(this._onDragOver(t),wme(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,s=this.el.children,o=0,i=s.length,r=this.options;o<i;o++)n=s[o],_r(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||Rme(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];_r(a,this.options.draggable,o,!1)&&(s[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){s[i]&&(o.removeChild(s[i]),o.appendChild(s[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return _r(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var s=this.options;if(n===void 0)return s[t];var o=sp.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&GV(s)},destroy:function(){vo("destroy",this);var t=this.el;t[$o]=null,fn(t,"mousedown",this._onTapStart),fn(t,"touchstart",this._onTapStart),fn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(fn(t,"dragover",this),fn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),iy.splice(iy.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!ll){if(vo("hideClone",this),$t.eventCanceled)return;Bt(Qn,"display","none"),this.options.removeCloneOnHide&&Qn.parentNode&&Qn.parentNode.removeChild(Qn),ll=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(ll){if(vo("showClone",this),$t.eventCanceled)return;ft.parentNode==Un&&!this.options.group.revertClone?Un.insertBefore(Qn,ft):Su?Un.insertBefore(Qn,Su):Un.appendChild(Qn),this.options.group.revertClone&&this.animate(ft,Qn),Bt(Qn,"display",""),ll=!1}}};function wme(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function dy(e,t,n,s,o,i,r,a){var l,u=e[$o],c=u.options.onMove,d;return window.CustomEvent&&!fa&&!ep?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=s,l.related=o||t,l.relatedRect=i||Ss(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),c&&(d=c.call(u,l,r)),d}function V0(e){e.draggable=!1}function Cme(){L0=!1}function bme(e,t,n){var s=Ss(wd(n.el,0,n.options,!0)),o=10;return t?e.clientX<s.left-o||e.clientY<s.top&&e.clientX<s.right:e.clientY<s.top-o||e.clientY<s.bottom&&e.clientX<s.left}function Sme(e,t,n){var s=Ss(P0(n.el,n.options.draggable)),o=10;return t?e.clientX>s.right+o||e.clientX<=s.right&&e.clientY>s.bottom&&e.clientX>=s.left:e.clientX>s.right&&e.clientY>s.top||e.clientX<=s.right&&e.clientY>s.bottom+o}function Eme(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,u=s?n.height:n.width,c=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&ay<u*o){if(!ap&&(rp===1?l>c+u*i/2:l<d-u*i/2)&&(ap=!0),ap)h=!0;else if(rp===1?l<c+ay:l>d-ay)return-rp}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return _me(t)}return h=h||r,h&&(l<c+u*i/2||l>d-u*i/2)?l>c+u/2?1:-1:0}function _me(e){return di(ft)<di(e)?1:-1}function Rme(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,s=0;n--;)s+=t.charCodeAt(n);return s.toString(36)}function Dme(e){ly.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&ly.push(s)}}function hy(e){return setTimeout(e,0)}function B0(e){return clearTimeout(e)}uy&&wn(document,"touchmove",function(e){($t.active||Sd)&&e.cancelable&&e.preventDefault()}),$t.utils={on:wn,off:fn,css:Bt,find:PV,is:function(t,n){return!!_r(t,n,t,!1)},extend:lme,throttle:OV,closest:_r,toggleClass:Bo,clone:NV,index:di,nextTick:hy,cancelNextTick:B0,detectDirection:HV,getChild:wd},$t.get=function(e){return e[$o]},$t.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(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&($t.utils=Er(Er({},$t.utils),s.utils)),sp.mount(s)})},$t.create=function(e,t){return new $t(e,t)},$t.version=ome;var hs=[],lp,$0,H0=!1,G0,U0,fy,up;function Tme(){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 s=n.originalEvent;this.sortable.nativeDraggable?wn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?wn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?wn(document,"touchmove",this._handleFallbackAutoScroll):wn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?fn(document,"dragover",this._handleAutoScroll):(fn(document,"pointermove",this._handleFallbackAutoScroll),fn(document,"touchmove",this._handleFallbackAutoScroll),fn(document,"mousemove",this._handleFallbackAutoScroll)),zV(),py(),ume()},nulling:function(){fy=$0=lp=H0=up=G0=U0=null,hs.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,s){var o=this,i=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,r);if(fy=n,s||this.options.forceAutoScrollFallback||ep||fa||tp){W0(n,this.options,a,s);var l=al(a,!0);H0&&(!up||i!==G0||r!==U0)&&(up&&zV(),up=setInterval(function(){var u=al(document.elementFromPoint(i,r),!0);u!==l&&(l=u,py()),W0(n,o.options,u,s)},10),G0=i,U0=r)}else{if(!this.options.bubbleScroll||al(a,!0)===Rr()){py();return}W0(n,this.options,al(a,!1),!1)}}},da(e,{pluginName:"scroll",initializeByDefault:!0})}function py(){hs.forEach(function(e){clearInterval(e.pid)}),hs=[]}function zV(){clearInterval(up)}var W0=OV(function(e,t,n,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=Rr(),u=!1,c;$0!==n&&($0=n,py(),lp=t.scroll,c=t.scrollFn,lp===!0&&(lp=al(n,!0)));var d=0,h=lp;do{var f=h,p=Ss(f),g=p.top,v=p.bottom,C=p.left,S=p.right,b=p.width,w=p.height,_=void 0,R=void 0,T=f.scrollWidth,I=f.scrollHeight,x=Bt(f),P=f.scrollLeft,D=f.scrollTop;f===l?(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),R=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"),R=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"));var F=_&&(Math.abs(S-o)<=r&&P+b<T)-(Math.abs(C-o)<=r&&!!P),k=R&&(Math.abs(v-i)<=r&&D+w<I)-(Math.abs(g-i)<=r&&!!D);if(!hs[d])for(var O=0;O<=d;O++)hs[O]||(hs[O]={});(hs[d].vx!=F||hs[d].vy!=k||hs[d].el!==f)&&(hs[d].el=f,hs[d].vx=F,hs[d].vy=k,clearInterval(hs[d].pid),(F!=0||k!=0)&&(u=!0,hs[d].pid=setInterval((function(){s&&this.layer===0&&$t.active._onTouchMove(fy);var B=hs[this.layer].vy?hs[this.layer].vy*a:0,Z=hs[this.layer].vx?hs[this.layer].vx*a:0;typeof c=="function"&&c.call($t.dragged.parentNode[$o],Z,B,e,fy,hs[this.layer].el)!=="continue"||MV(hs[this.layer].el,Z,B)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=al(h,!1)));H0=u}},30),jV=function(t){var n=t.originalEvent,s=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=s||i;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)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function z0(){}z0.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=wd(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),s&&s.animateAll()},drop:jV},da(z0,{pluginName:"revertOnSpill"});function j0(){}j0.prototype={onSpill:function(t){var n=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:jV},da(j0,{pluginName:"removeOnSpill"}),$t.mount(new Tme),$t.mount(j0,z0);function Ime(e,t){return Object.values(e).indexOf(t)}function xme(e,t,n,s){if(!e)return[];const o=Object.values(e),i=t.length-s;return[...t].map((a,l)=>l>=i?o.length:o.indexOf(a))}function Fme(e){return["transition-group","TransitionGroup"].includes(e)}function KV(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?Fme(t.name):!1}function Pme(e,t){return t?{...t.props,...t.attrs}:e}const K0=["Start","Add","Remove","Update","End"],q0=["Choose","Unchoose","Sort","Filter","Clone"],Ame=["Move",...K0,...q0].map(e=>"on"+e);let Y0=null;const kme=rt({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",...K0.map(e=>e.toLowerCase()),...q0.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:s}){const o=V(!1),i=V(!1),r=V(0),a=V(0),l=V([]),u=V(null),c=V(null),d=Y(()=>e.list?e.list:e.modelValue),h=Yn();function f(){return e.component?VH(e.component):e.tag}function p(H){if(c.value)for(const te in H){const he=_V(te);Ame.indexOf(he)===-1&&c.value.option(he,H[te])}}function g(){var H;return((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[]}async function v(){var H;await Ct(),l.value=xme(g(),((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[],o.value,a.value)}function C(H){const te=Ime(g()||[],H);if(te===-1)return null;const he=d.value?d.value[te]:null;return{index:te,element:he}}function S(H){Ct(()=>t("change",H))}function b(H){if(e.list){H(e.list);return}const te=[...e.modelValue||[]];H(te),t("update:modelValue",te)}function w(...H){b(he=>he.splice(...H))}function _(H,te){b(me=>me.splice(te,0,me.splice(H,1)[0]))}function R(H){const te=l.value,he=te.length;return H>he-1?he:te[H]}function T(){var te,he;return n.default&&((he=(te=n.default()[0])==null?void 0:te.component)==null?void 0:he.proxy)||null}function I(H){if(!e.noTransitionOnDrag||!o.value)return;const te=g();te[H]&&(te[H].data=null);const he=T();he&&(he.children=[],he.kept=void 0)}function x(H){v(),u.value=C(H.item),u.value&&(H.item._underlying_vm_=e.clone(u.value.element),Y0=H.item)}function P(H){const te=H.item._underlying_vm_;if(te===void 0)return;F0(H.item);const he=R(H.newIndex);w(he,0,te),v(),S({added:{element:te,newIndex:he}})}function D(H){var he;if(RV((he=h==null?void 0:h.proxy)==null?void 0:he.$el,H.item,H.oldIndex),H.pullMode==="clone"){F0(H.clone);return}if(!u.value)return;const te=u.value.index;w(te,1),I(te),S({removed:{element:u.value.element,oldIndex:te}})}function F(H){var me,re;F0(H.item),RV(H.from,H.item,H.oldIndex);const te=(me=u.value)==null?void 0:me.index,he=R(H.newIndex);_(te,he),S({moved:{element:(re=u.value)==null?void 0:re.element,oldIndex:te,newIndex:he}})}function k(H,te){Object.prototype.hasOwnProperty.call(H,te)&&(H[te]+=r.value)}function O(H){return H.__draggable_component__}function B({to:H,related:te}){const he=O(H);if(!he)return{component:he};const me=he.realList,re={list:me,component:he};if(H!==te&&me&&he.getUnderlyingVm){const oe=he.getUnderlyingVm(te);if(oe)return Object.assign(oe,re)}return re}function Z(H,te){const he=[...te.to.children].filter(z=>z.style.display!=="none");if(he.length===0)return 0;const me=he.indexOf(te.related),re=H.component.getVmIndex(me);return he.indexOf(Y0)!==-1||!te.willInsertAfter?re:re+1}const J=()=>{var re,oe;const H={};K0.forEach(z=>{H["on"+z]=X(z)}),q0.forEach(z=>{H["on"+z]=ee.bind(null,z)});const te=Object.keys(s).reduce((z,pe)=>(z[_V(pe)]=s[pe],z),{}),he=Object.assign({},te,H,{onMove:(z,pe)=>ve(z,pe)});"draggable"in he||(he.draggable=">*");const me=((re=h==null?void 0:h.proxy)==null?void 0:re.$el.nodeType)===1?h.proxy.$el:((oe=h==null?void 0:h.proxy)==null?void 0:oe.$el.parentElement)||null;me&&(c.value=new $t(me,he),me.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(H,te){Ct(()=>t(H.toLowerCase(),te))}function X(H){return te=>{if(d.value!==null){const he="onDrag"+H,me=L[he];me&&me(te)}ee(H,te)}}function ve(H,te){const he=e.move;if(!he||!d.value)return!0;const me=B(H),re=u.value,oe=Z(me,H);re&&Object.assign(re,{futureIndex:oe});const z=Object.assign({},H,{relatedContext:me,draggedContext:re});return he(z,te)}function ne(){v(),Y0=null}const L={onDragStart:x,onDragAdd:P,onDragRemove:D,onDragUpdate:F,onDragMove:ve,onDragEnd:ne};return nn(()=>{J()}),e.list!==null&&e.modelValue!==null&&Jge.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:i,headerOffset:r,footerOffset:a,transitionMode:o,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:C,emitChanges:S,alterList:b,spliceList:w,updatePosition:_,getVmIndex:R,getComponent:T,resetTransitionData:I,onDragStart:x,onDragAdd:P,onDragRemove:D,onDragUpdate:F,updateProperty:k,onDragMove:ve,onDragEnd:ne,mounted:J,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:B,getTargetedComponent:O,computeFutureIndex:Z}},render(){const e=this.getTag(),t=Pme(this.$attrs,this.componentData);if(typeof e=="string"){const s=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return s?(this.transitionMode=KV(s),Zu(e,t,s)):Zu(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const s=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=KV(s||[])}return Zu(e,t,n)}}),Ome=_t(rt({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=V([]),s=e,o=t,i=V({}),r=()=>{n.value=s.modelValue.map(u=>({id:u.field,name:u.headerName,...u}))||[],s.modelValue.forEach(u=>{i.value[u.field]={...u}})};tt(()=>s.modelValue,u=>{r()},{immediate:!0,deep:!0}),tt(n,u=>{if(u.length===s.modelValue.length&&!u.every((d,h)=>d.id===s.modelValue[h].field)){const d=u.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=u=>!(s.readOnly||s.disabled);return(u,c)=>(j(),qe(U(kme),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),tag:"transition-group",disabled:s.disabled||s.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:ge(()=>[(j(!0),ue(xt,null,xn(n.value,(d,h)=>(j(),ue("div",{key:d.id,class:"fade-item"},[Tt(u.$slots,"item",{item:d,index:h},()=>[nt(wt(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),Mme={key:0},Nme={key:1,style:{"font-style":"italic"}},Lme={key:2,style:{"font-style":"italic"}},Vme={key:3},gy=_t(rt({__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=Jt,s=e,o=V(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=Y(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=Y(()=>{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=Y(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(j(),ue("div",{key:e.item.field,class:Q([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[fe(cV,{focusIndex:s.focusIndex,id:`col-${e.item.field}`,"model-value":o.value==!0?U(Vt).CHECKED:U(Vt).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((j(),ue("div",{class:"move-handler",style:dn({cursor:s.disableDrag?"not-allowed":"move"})},[fe(lt,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:Q(h.$style.handler)},null,8,["color","class"])],4)),[[U(n),s.disableDrag==!0?s.disableDragTooltip:""]]),u.value?(j(),ue("div",{key:0,class:Q(h.$style["metric-type"])},[l.value=="rating"?(j(),ue("span",Mme,"★")):l.value=="formular"?(j(),ue("span",Nme," ƒx ")):l.value=="number"?(j(),ue("span",Lme," # ")):(j(),ue("span",Vme,wt(l.value),1))],2)):Je("",!0),_e("span",{class:Q(h.$style["column-config__item-label"])},[Ke((j(),ue("div",null,[nt(wt(e.item.headerName),1)])),[[U(n),{content:e.item.headerName}]])],2),d.value?Ke((j(),ue("div",{key:1,class:Q(h.$style["metric-icon"])},[fe(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[U(n),"Point metric"]]):Je("",!0),c.value?Ke((j(),ue("div",{key:2,class:Q(h.$style["metric-icon"])},[fe(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[U(n),"Woohoo metric"]]):Je("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_7scp0_1","is-metric":"_is-metric_7scp0_8","is-woohoo-metric":"_is-woohoo-metric_7scp0_12","is-point-metric":"_is-point-metric_7scp0_15","column-config__item-label":"_column-config__item-label_7scp0_18",disabled:"_disabled_7scp0_34",readOnly:"_readOnly_7scp0_38","column-config__item--pinned":"_column-config__item--pinned_7scp0_41",handler:"_handler_7scp0_48",badge:"_badge_7scp0_52","metric-type":"_metric-type_7scp0_78","metric-icon":"_metric-icon_7scp0_106"}}]]),Bme=_t(rt({__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 s=e,o=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:u}=Fs({toggleOnClick:!0,placement:s.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:s.show,maxWidth:s.maxWidth}),c=Y(()=>l.value);tt(l,f=>{o(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:c});const h=f=>{f.key==="Escape"&&a.value&&i()};return nn(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),vs(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(j(),ue("div",{ref_key:"triggerRef",ref:r,class:Q(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:U(l),toggle:U(u),closeDropdown:d},()=>[_e("button",{class:Q(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),_e("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:Q(f.$style["dropdown-content"]),style:dn({display:U(l)?"block":"none",maxWidth:s.maxWidth?s.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:U(l)},()=>[_e("div",{class:Q(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"}}]]),$me={class:"reach-limit-icon"},Hme=_t(rt({__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 s=Jt,o=e,i=n,r=V(""),a=V(),l=Y(()=>r.value.trim().length>0),u=V([]),c=V({}),{triggerRef:d,popupRef:h,isVisible:f,hide:p}=Fs({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});tt(f,k=>{var O;k&&((O=a.value)==null||O.focus())});const g=Y(()=>o.disabled||r.value.length>0),v=Y(()=>u.value.filter(k=>k.pinned==="left"&&k.field&&k.headerName)),C=Y(()=>u.value.filter(k=>k.pinned==="right"&&k.field||k.field==="blank")),S=Y({get:()=>u.value.filter(k=>!k.pinned&&k.field&&k.field!=="blank"),set:k=>{u.value=[...v.value,...k,...C.value]}}),b=Y(()=>{if(!r.value)return{};const k=r.value.toLowerCase();return[...u.value,...S.value].reduce((O,B)=>{var Z;return(Z=B.headerName)!=null&&Z.toLowerCase().includes(k)&&B.field&&(O[B.field]=!0),O},{})}),w=Y(()=>o.modelValue),_=()=>{const k={};u.value.forEach(O=>{O.field&&(k[O.field]=!O.hide)}),c.value=k},R=Y(()=>{if(!r.value)return u.value;const k=r.value.toLowerCase();return u.value.filter(O=>{var B;return(B=O.headerName)==null?void 0:B.toLowerCase().includes(k)})}),T=()=>{var B;const k=(B=o.gridApi)==null?void 0:B.getColumnState().reduce((Z,J)=>(Z[J.colId]=Number(J.width),Z),{}),O=u.value.map(Z=>({...Z,hide:Z.field?!c.value[Z.field]:!1,width:Z.field?k==null?void 0:k[Z.field]:Z.width}));i("update:modelValue",O),i("change",O),i("input",O)},I=k=>{const O=[...v.value,...k,...C.value];o.checkboxColumn&&O.unshift(o.checkboxColumn),u.value=O,T()},x=k=>{k&&(c.value[k]=!c.value[k],T())};tt(w,k=>{k&&k.length>0&&(u.value=[...k],_())},{immediate:!0}),t({updateColumnDefs(k){u.value=[...k],_()}});const P=Y(()=>F.value>=5),D=Y(()=>o.disabled||r.value.length>0),F=Y(()=>u.value.reduce((k,O)=>O.field&&O.field.includes("metric")&&c.value[O.field]===!0?k+1:k,0));return(k,O)=>{const B=_o("focusable");return j(),ue("div",{class:Q(k.$style["table-customization"])},[_e("div",{ref_key:"triggerRef",ref:d},[Tt(k.$slots,"trigger",{},()=>[Ke((j(),qe(mt,{variant:["secondary"],disabled:o.disabled,actived:U(f),style:{width:"32px"},onEscape:U(p)},{prefix:ge(()=>[fe(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[B,"7"],[U(s),"Columns"]])])],512),_e("div",{ref_key:"popupRef",ref:h,class:Q(k.$style["tippy-content-wrapper"])},[_e("div",{class:Q([k.$style["column-config"],P.value?k.$style["has-warning"]:""]),style:dn({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[fe(iS,{tabIndex:"7.0",modelValue:r.value,"onUpdate:modelValue":O[0]||(O[0]=Z=>r.value=Z),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),_e("div",{class:Q(k.$style["column-config__header"])},[...O[2]||(O[2]=[_e("span",null,"Manage columns",-1)])],2),P.value?(j(),ue("div",{key:0,class:Q(k.$style["reach-limit"])},[_e("div",$me,[fe(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),_e("div",{class:Q(k.$style["warning-limit-text"])},[...O[3]||(O[3]=[nt(" You’ve reached the maximum number of metric columns. ",-1),_e("br",null,null,-1),nt(" Deselect one to show another. ",-1)])],2)],2)):Je("",!0),l.value?(j(),ue(xt,{key:1},[R.value.length===0&&l.value?(j(),ue("div",{key:0,class:Q(k.$style["no-columns"])},[...O[4]||(O[4]=[nt(" No results. ",-1),_e("br",null,null,-1),nt(" Try another search. ",-1)])],2)):Je("",!0),l.value&&R.value.length>0?(j(),ue("div",{key:1,class:Q(k.$style["column-config__pinned-section"])},[(j(!0),ue(xt,null,xn(R.value,Z=>{var J;return j(),qe(gy,{key:Z.colId,item:Z,columnStates:c.value,disableDrag:D.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:P.value&&((J=Z.colId)==null?void 0:J.includes("metric")),onToggleColumn:x},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Je("",!0)],64)):Je("",!0),l.value?Je("",!0):(j(),ue("div",{key:2,class:Q(k.$style["column-config__list"])},[(j(!0),ue(xt,null,xn(v.value,Z=>Ke((j(),qe(gy,{key:Z.field,item:Z,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:c.value},null,8,["item","columnStates"])),[[To,b.value[Z.field]||!r.value]])),128)),fe(Ome,{modelValue:S.value,"onUpdate:modelValue":O[1]||(O[1]=Z=>S.value=Z),"group-name":"columns",onChanged:I,disabled:g.value,readOnly:o.readOnly},{item:ge(({item:Z,index:J})=>[Ke((j(),qe(gy,{focusIndex:`7.${J+1}`,key:Z.id,item:Z,columnStates:c.value,disableDrag:D.value,disableDragTooltip:D.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:P.value&&Z.id.includes("metric"),onToggleColumn:x},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[To,b.value[Z.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(j(!0),ue(xt,null,xn(C.value.filter(Z=>{var J;return Z.headerName&&((J=Z.headerName)==null?void 0:J.length)>0}),Z=>Ke((j(),qe(gy,{key:Z.field,item:Z,disabled:o.disabled,readOnly:o.readOnly,columnStates:c.value},null,8,["item","disabled","readOnly","columnStates"])),[[To,b.value[Z.field]||!r.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"}}]]),Gme=["aria-label"],Ume=["aria-disabled","onClick"],Wme=_t(rt({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,s=t,o=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||s("select",a)},i=new Date().getFullYear(),r=new Date().getMonth()+1;return(a,l)=>(j(),ue("div",{class:Q([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[_e("div",{class:Q(a.$style.months)},[(j(!0),ue(xt,null,xn(n.monthLabels,(u,c)=>(j(),ue("a",{key:u,tabindex:"0",class:Q([a.$style["month-cell"],{[a.$style.selected]:c+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:c+1===r&&U(i)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(c+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(c+1),onClick:d=>o(c+1),onKeydown:l[0]||(l[0]=d=>s("keydown",d))},wt(u),43,Ume))),128))],2)],10,Gme))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_a776x_1",months:"_months_a776x_8","month-cell":"_month-cell_a776x_22",selected:"_selected_a776x_36",compact:"_compact_a776x_40",current:"_current_a776x_53",disabled:"_disabled_a776x_61"}}]]),zme=["data-year","aria-disabled","onClick"],jme=_t(rt({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=V(null),r=new Date().getFullYear(),a=l=>{s.disabled||!s.isYearSelectable(l)||o("select",l)};return t({rootEl:i}),nn(()=>{if(i.value){const l=i.value.querySelector(`[data-year="${s.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,u)=>(j(),ue("div",{ref_key:"rootEl",ref:i,class:Q([l.$style["year-grid-body"],s.scrollable?l.$style.scrollable:"",s.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(j(!0),ue(xt,null,xn(s.years,c=>(j(),ue("a",{key:c,"data-year":c,tabindex:"0",class:Q([l.$style["year-cell"],{[l.$style.selected]:c===s.selectedYear,[l.$style.current]:c===U(r),[l.$style.disabled]:s.disabled||!s.isYearSelectable(c)}]),"aria-disabled":s.disabled||!s.isYearSelectable(c),onClick:d=>a(c),onKeydown:u[0]||(u[0]=d=>o("keydown",d))},wt(c),43,zme))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_1us7k_1",scrollable:"_scrollable_1us7k_11","year-cell":"_year-cell_1us7k_16",selected:"_selected_1us7k_28",current:"_current_1us7k_31",compact:"_compact_1us7k_35",disabled:"_disabled_1us7k_47"}}]]),Kme={class:"navigation"},qme={class:"picker"},Yme={key:0,class:"footer"},Zme=_t(rt({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(j(),ue("div",{class:Q(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[_e("div",Kme,[Tt(t.$slots,"navigation",{},void 0,!0)]),_e("div",qme,[Tt(t.$slots,"picker",{},void 0,!0)]),fe(XD,{name:"fade",mode:"out-in"},{default:ge(()=>[e.disableConfirm?Je("",!0):(j(),ue("div",Yme,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),Xme={style:{flex:"1"}},Jme=_t(rt({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,s=t,o=()=>{s("cancel")},i=()=>{s("confirm")},r=(l=new Date)=>{s("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const u=l.target;u.dataset.index==="today-btn"?r():u.dataset.index==="cancel-btn"?o():u.dataset.index==="save-btn"&&i()}};return(l,u)=>{const c=_o("tooltip");return n.readOnly?Je("",!0):(j(),ue("div",{key:0,class:Q(l.$style["arbo-calendar-actions"])},[_e("div",Xme,[Ke((j(),qe(U(mt),{variant:"secondary",size:"medium",onClick:u[0]||(u[0]=d=>r()),onKeydown:a,"data-index":"today-btn"},{prefix:ge(()=>[fe(U(lt),{src:"CalendarDay"})]),_:1})),[[c,"Today"]])]),fe(U(mt),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:o,"data-index":"cancel-btn"},{default:ge(()=>[nt(wt(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),fe(U(mt),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:i},{default:ge(()=>[nt(wt(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),Qme=_t(rt({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,s=Eo({month:new Date().getMonth()+1,year:new Date().getFullYear()}),o=Y(()=>{if(n.minDate){const h=s.month===1?12:s.month-1,f=s.month===1?s.year-1:s.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),i=Y(()=>{if(n.maxDate){const h=s.month===12?1:s.month+1,f=s.month===12?s.year+1:s.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),r=t,a=()=>{o.value||(n.mode==="month"?s.month=s.month===0?11:s.month-1:n.mode==="year"&&(s.year-=1)),r("prev",{month:s.month,year:s.year})},l=()=>{i.value||(n.mode==="month"?s.month=s.month===11?0:s.month+1:n.mode==="year"&&(s.year+=1)),r("next",{month:s.month,year:s.year})},u=()=>{r("toggle-months")},c=()=>{r("toggle-years")},d=Y(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,C)=>p.format(new Date(Date.UTC(2020,C,1))))});return(h,f)=>(j(),ue("div",{class:Q(h.$style["cal-nav-bar"])},[e.mode!="year"?(j(),qe(U(mt),{key:0,variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:o.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:zn(Pt(a,["prevent","stop"]),["enter"])},{default:ge(({hovered:p})=>[fe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!0),_e("div",{class:Q([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Je("",!0):(j(),qe(U(mt),{key:0,"data-index":"month-btn",variant:"secondary",onClick:u},{default:ge(()=>[nt(wt(d.value[n.month-1]),1)]),_:1})),fe(U(mt),{variant:"secondary",onClick:c,"data-index":"year-btn"},{default:ge(()=>[nt(wt(n.year),1)]),_:1})],2),e.mode!="year"?(j(),qe(U(mt),{key:1,"data-index":"next-btn",variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:i.value,label:"",onClick:l,onKeydownCapture:zn(Pt(l,["prevent","stop"]),["enter"])},{default:ge(({hovered:p})=>[fe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_beyjg_1","cal-nav-bar":"_cal-nav-bar_beyjg_12","cal-nav-btn":"_cal-nav-btn_beyjg_19",prev:"_prev_beyjg_32","year-grid-header":"_year-grid-header_beyjg_36","cal-nav-center":"_cal-nav-center_beyjg_45",single:"_single_beyjg_52","cal-nav-label":"_cal-nav-label_beyjg_56","year-grid":"_year-grid_beyjg_36",months:"_months_beyjg_78","month-cell":"_month-cell_beyjg_85","year-cell":"_year-cell_beyjg_86","pg-btn":"_pg-btn_beyjg_108","year-grid-body":"_year-grid-body_beyjg_121",selected:"_selected_beyjg_125","days-slot":"_days-slot_beyjg_131","range-label":"_range-label_beyjg_135"}}]]),eve=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const tve={class:"wrapper-suffix"},nve=_t(rt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=Jt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=V(i.modelValue),a=n,l=Y(()=>f.value.find(D=>D.id===r.value)||null),u=D=>{r.value=D.id,a("update:modelValue",D.id)},c=Y(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const D=f.value.find(k=>k.id===r.value),F=String((D==null?void 0:D.color)||"white");return{backgroundColor:F,border:Lg(F,"white")?"1px solid #ccc":"1px solid #fff"}}),d=V(null),h=()=>{var D;(D=d.value)==null||D.focus()},f=V([]),p=V(!1),g=V(!1),v=V(null),C=V(o.INITIAL_PAGE),S=V(!0),b=V(0),w=V(""),_=Y(()=>!!(i.id&&i.workspaceId)),R=D=>{const F=f.value.find(k=>k.id===D.value);F&&u(F)},T=D=>({label:D.name,value:D.id,selected:r.value===D.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:D,id:D.id,color:D.color}),I=async(D=o.INITIAL_PAGE,F="",k=!1)=>{var O;if(!_.value){console.error("Missing required props",i);return}k?g.value=!0:p.value=!0,v.value=null;try{const B={workspaceId:String(i.workspaceId),itemIds:i.id,page:D,perPage:o.PER_PAGE,name_like:F.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const Z=await i.getStatusFunc(B);if(!Z){k||(f.value=[]),S.value=!1;return}const J=Z.data.map(T);f.value=k?[...f.value,...J]:J,b.value=((O=Z.meta)==null?void 0:O.total)??Z.data.length,S.value=f.value.length<b.value,C.value=D}catch(B){console.error("Error fetching statuses:",B),v.value="Failed to load statuses",k||(f.value=[]),S.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},x=async()=>{!S.value||g.value||await I(C.value+1,w.value,!0)};tt([()=>i.id,()=>i.workspaceId],()=>{I()},{deep:!0,immediate:!0});const P=async D=>{w.value=D,C.value=o.INITIAL_PAGE,await I(o.INITIAL_PAGE,D,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(D,F)=>(j(),qe(Bme,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:ge(({open:k})=>[fe(Cs,{actived:k,class:Q(D.$style["status-wrapper"])},{suffix:ge(()=>[_e("div",tve,[fe(lt,{src:"ChevronUp",source:"remote",class:Q([[D.$style["dropdown-icon"]],{[D.$style["dropdown-icon-show"]]:!k}])},null,8,["class"])])]),default:ge(()=>{var O;return[_e("div",{class:Q(D.$style.status)},[_e("div",{class:Q(D.$style["color-indicator"]),style:dn(c.value)},null,6),Ke((j(),ue("span",{style:{"max-width":"400px"},class:Q({[D.$style.empty]:!l.value})},[nt(wt(l.value?l.value.label:"Select status"),1)],2)),[[U(s),{content:((O=l.value)==null?void 0:O.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:ge(({closeDropdown:k})=>{var O;return[fe(Jr,{ref_key:"popupRef",ref:d,"selected-id":(O=l.value)==null?void 0:O.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":S.value,error:v.value,onSearch:P,onSelect:B=>{R(B),k()},onLoadMore:x,onCancel:F[0]||(F[0]=B=>a("cancel")),style:{width:"500px"}},null,8,["selected-id","options","loading","loading-more","has-more","error","onSelect"])]}),_:1}))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_1hlgx_1",status:"_status_1hlgx_1","color-indicator":"_color-indicator_1hlgx_12",empty:"_empty_1hlgx_21","dropdown-icon":"_dropdown-icon_1hlgx_25","dropdown-icon-show":"_dropdown-icon-show_1hlgx_30",options:"_options_1hlgx_34"}}]]),qV=e=>({updateCellData:({rowId:n,field:s,value:o})=>{if(!e)return;const i=e.getRowNode(n);i&&i.setDataValue(s,o),e.refreshCells({rowNodes:i?[i]:[],columns:[s],force:!0})}}),sve={key:2},ove=_t(rt({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,s=V(n.value),o=V(!0),i=V(""),r=()=>{var P,D,F;const b=(P=c.value)==null?void 0:P.restricted_type.trim(),w=((F=(D=c.value)==null?void 0:D.restricted_value)==null?void 0:F.split(",").map(Number))||[],[_,R]=w,I={range:`Enter a value between ${_} and ${R}`,not:`These values are not allowed: ${w.join(", ")}`,exact:"Value is not allowed"}[b];return o.value?"":I},a=b=>{if(c.value){if(b===null||b===""){o.value=!0;return}if(u.value!=="number"){o.value=!0;return}o.value=dm(c.value,Number(b)),i.value=r()}};Y(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),u=Y(()=>OF(c.value)),c=Y(()=>{var w,_;return((_=(w=n.params)==null?void 0:w.colDef)==null?void 0:_.context)||null}),{apiServices:d}=ts(!0,n),{updateCellData:h}=qV((S=n.params)==null?void 0:S.api),f=V(!1),p=Ki(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},C=async b=>{var _,R;if(g(),f.value=!0,s.value=b||null,b===n.value){f.value=!1;return}const w={itemIds:[String(p.value)],metricId:((_=c.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?w.clear=1:w.value=b,h({rowId:String(p.value),field:`metric_${w.metricId}`,value:void 0});try{const T=await((R=d.value)==null?void 0:R.bulkUpdateMetric(w));(T==null?void 0:T.message)=="Done"?h({rowId:String(p.value),field:`metric_${w.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${w.metricId}`,value:n.value}),console.error("Failed to update metric value:",T),s.value=n.value)}catch(T){console.error("Error during bulk metric update:",T),h({rowId:String(p.value),field:`metric_${w.metricId}`,value:n.value})}finally{f.value=!1}};return(b,w)=>(j(),ue("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(j(),qe(KA,{key:0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=_=>s.value=_),onChange:C,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(j(),qe(qA,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=_=>s.value=_),style:{width:"100%"},onHandleChange:C,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(j(),ue("div",sve,"Metric type:"+wt(u.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),ive=_t(rt({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."},s=Y(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),o=Y(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),i=V(!1);return nn(()=>{i.value=!0}),(r,a)=>(j(),ue("div",{class:Q(r.$style["no-data-item-table"])},[_e("div",{class:Q(r.$style.visual)},[i.value?(j(),qe(Pm,{key:0,source:"remote",src:s.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):Je("",!0)],2),_e("div",{class:Q(r.$style.description)},wt(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),YV=Ql("sortStore",()=>{const e=V({}),t={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},n={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=Y(()=>{const a=e.value;return Object.values(a).filter(u=>u.sort!=="none"&&!!u.sort).map(u=>{let c;switch(u.colId){case"dateRange":c=n[u.sort];break;default:if(u.colId.includes("metric")){const[d,h]=u.colId.split("_");c={column:d,direction:u.sort,type:h}}else c={column:t[u.colId]||u.colId,direction:u.sort};break}return c})}),o=(a,l)=>{e.value={[a]:{colId:a,sort:l}}},i=()=>{e.value={}},r=V(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:o,clearSorting:i,isSortingRunning:r}}),Ru=rt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=YV(),{sorts:s}=Qs(n),o=Y(()=>{var l,u;return((u=(l=t.params)==null?void 0:l.column)==null?void 0:u.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=Y(()=>t.params.headerType||void 0),a=V("none");return tt(()=>s.value,Di(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},rr),{deep:!0,immediate:!0}),(l,u)=>o.value?(j(),qe(vge,Xt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),onSortChanged:i}),null,16,["header-type","modelValue"])):Je("",!0)}});function rve(){const e=Eo({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const o=e.name.trim();e.status,o.length===0?e.error="Name cannot be empty":o.length>25?e.error="Name cannot exceed 25 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},s=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:s,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const my=Ql("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),ave=["innerHTML"],lve=20,uve=_t(rt({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,{triggerRef:o,popupRef:i,isVisible:r,show:a,hide:l}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=V(null),d=()=>{P.value=[],he.value=!1},h=Y(()=>r.value),f=Y(()=>{var z;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((z=P.value)==null?void 0:z.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=ws(f),g=Jt,v=n,C=Y(()=>{var z;return Math.max(0,(((z=P.value)==null?void 0:z.length)||0)-s.maxVisible)}),S=Y(()=>{var z;return C.value<=0?"":((z=P.value)==null?void 0:z.slice(s.maxVisible).map(pe=>pe.name).join(", "))||""}),b=V(!1),w=V(!1),_=V(null),R=V(1),T=V(!0),I=V(0),x=V(""),P=V([]),D=Y(()=>{var z;return((z=P.value)==null?void 0:z.map(pe=>pe.id))||[]}),{assigneeList:F,mergedOptions:k}=mm({...s,value:[]}),{apiServices:O}=ts(!1,s),B=_n("entityId"),Z=async(z=1,pe="",ie=!1)=>{var G,q,ce,ke,Fe;if(!O.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(ie?w.value=!0:b.value=!0,_.value=null,!((G=O.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const be=En.getInstance().getItem("ws.code");try{const Le=await((q=O.value)==null?void 0:q.getAssignableAssignees(String(be),{entity_ids:(B==null?void 0:B.value)||"",page:z,per_page:lve,display_name_like:pe})),ye=((ce=Ec(Le.data))==null?void 0:ce.map(gm))??[];F.value=ie?uc(F.value,ye,"id"):ye,I.value=Le.meta.total,T.value=(((ke=Le==null?void 0:Le.meta)==null?void 0:ke.current_page)||0)<(((Fe=Le==null?void 0:Le.meta)==null?void 0:Fe.last_page)||0),R.value=z}catch(Le){console.error("Error fetching assignable users:",Le),_.value="Failed to load assignable users"}finally{b.value=!1,w.value=!1}},J=z=>{var pe,ie,be;if((pe=P.value)!=null&&pe.some(G=>G.id===z.data.id)){P.value=(ie=P.value)==null?void 0:ie.filter(G=>G.id!==z.data.id);return}P.value=[...P.value||[],z.data],(be=c.value)==null||be.focus()},ee=()=>{P.value=[]},X=()=>{!w.value&&T.value&&Z(R.value+1,x.value,!0)},ve=Di(async z=>{x.value=z,await Z(1,z,!1)},rr);tt(()=>r.value,z=>{var pe;z?(Z(1,x.value,!1),(pe=c.value)==null||pe.focus(),v("show")):v("hide")});const ne=Y(()=>{var z;return((z=P.value)==null?void 0:z.slice(0,3))||[]}),L=Y(()=>ne.value.map(z=>({id:z.id,name:z.name,initial:z.initial,avatarId:z.id,profile_image:z.profile_image,color:z.color,size:24,user:z}))),H=my(),{user:te}=Qs(H),he=V(!1);t({getData:()=>P.value,clear:d,setData:z=>{P.value=z},focus:()=>{a(),Ct(()=>{var z;(z=c.value)==null||z.focus()})},hide:()=>{l()}}),tt([P,he],()=>{v("updated",P.value)},{deep:!0});const me=z=>{var pe;P.value=(pe=P.value)==null?void 0:pe.filter(ie=>ie.id!==z)},re=z=>{var ie;const pe=En.getInstance().getItem("ws.code");return((ie=O.value)==null?void 0:ie.getUserInformation(pe,z))||Promise.resolve(null)},oe=V();return(z,pe)=>(j(),ue("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:oe},[fe(Cs,Xt(U(p),{style:{"--icon-size":"18px"}}),{prefix:ge(()=>[L.value.length==0?(j(),ue("div",{key:0,class:Q([z.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(u,["stop","prevent"])},[fe(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Je("",!0)]),default:ge(()=>[_e("div",{class:Q([z.$style["assignee-row"],z.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[_e("div",{style:{flex:1},class:Q([z.$style["assignee-row"]])},[(j(!0),ue(xt,null,xn(L.value,ie=>(j(),qe(Zf,{onClear:be=>me(ie.id),key:ie.user.id,"disable-remove":!1},{default:ge(()=>[fe(Oc,{user:ie.user,apiUpdateFunction:re,appendTo:oe.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),C.value>0?Ke((j(),ue("div",{key:0,class:Q(z.$style["extra-avatars"])},[nt(" +"+wt(C.value),1)],2)),[[U(g),S.value]]):Je("",!0)],2)],2)]),_:1},16),_e("div",{ref_key:"popupRef",ref:i},[fe(Jr,Xt({"selected-id":D.value},{...s},{options:U(k),loading:b.value,"loading-more":w.value,"has-more":T.value,ref_key:"searchListRef",ref:c,onTab:pe[0]||(pe[0]=ie=>v("tab",ie)),onSelect:pe[1]||(pe[1]=ie=>{J(ie),v("start-update")}),onSearch:U(ve),onClose:pe[2]||(pe[2]=()=>v("close")),onLoadMore:X}),{"extra-item":ge(()=>[fe(rS,{onClick:ee,label:"Unassign",borderLeft:!0},{icon:ge(()=>[fe(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:ge(({item:ie,selectedIndex:be,isSelected:G,handleSelect:q,handleItemHover:ce,getHighlightedLabel:ke,query:Fe,idx:Le})=>[fe(eu,Xt(ie,{hover:Le===be,selected:G(ie),type:ie.type,onClick:Pt(ye=>q(ie,ye),["stop","prevent"]),onMouseover:ye=>ce(Le),class:z.$style["item-assignee"]}),{prefix:ge(()=>[fe(Oc,{user:ie.data,apiUpdateFunction:re,appendTo:U(i)},null,8,["user","appendTo"])]),label:ge(({})=>[Fe?Ke((j(),ue("span",{key:0,class:Q([z.$style["item-label"],z.$style.match]),style:{flex:"1"},innerHTML:ke(ie.label)},null,10,ave)),[[U(g),{content:ie.label}]]):Ke((j(),ue("span",{key:1,class:Q(z.$style["item-label"]),style:{flex:"1"}},[nt(wt(ie.label),1)],2)),[[U(g),{content:ie.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),cve={key:0},dve={key:1},hve={key:0},fve={key:1},pve={key:0,class:"wrapper-suffix"},gve={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},mve=_t(rt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=Jt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=V([null,null]),d=w=>{const _=cm();return w?bt.fromJSDate(w,{zone:_}).toFormat("MMM dd"):""},h=Y(()=>r.value),f=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=ws(f),g=V(!1),v=w=>{S("tab",w)},C=w=>{"start"in w&&w.start!==void 0&&(c.value[0]=w.start),"end"in w&&w.end!==void 0&&(c.value[1]=w.end)};t({getData:()=>c.value,clear:u,setData:w=>{c.value=w},focus:()=>{l(),Ct(()=>{var w;(w=b.value)==null||w.focus()})},hide:()=>{a()}});const S=n;tt(()=>c.value,w=>{S("updated",w)},{deep:!0});const b=V(null);return tt(()=>r.value,w=>{w?(Ct(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(w,_)=>(j(),ue(xt,null,[fe(Cs,Xt({ref_key:"triggerRef",ref:o},U(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ge(({focused:R})=>[_e("div",{class:Q(w.$style["date-time"])},[_e("div",{class:Q(w.$style.date)},[c.value[0]==null&&(R||U(r))?(j(),ue("span",cve,"MMMDD")):(j(),ue("span",dve,wt(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||R||U(r)?(j(),ue("div",{key:0,class:Q(w.$style.separator)}," → ",2)):Je("",!0),_e("div",{class:Q(w.$style.date)},[c.value[1]==null&&(R||U(r))?(j(),ue("span",hve,"MMMDD")):(j(),ue("span",fve,wt(d(c.value[1])),1))],2)],2)]),suffix:ge(({hovered:R,focused:T})=>[(c.value[0]!==null||c.value[1]!==null)&&(R||T||U(r))?(j(),ue("div",pve,[Ke((j(),qe(mt,{onClick:Pt(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ge(()=>[fe(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[U(s),"Clear"]])])):Je("",!0)]),prefix:ge(()=>[c.value[0]===null&&c.value[1]===null?(j(),ue("div",gve,[fe(lt,{src:"Calendar",color:"#A6A6A6"})])):Je("",!0)]),_:1},16),_e("div",{ref_key:"popupRef",ref:i},[U(r)?(j(),qe(Am,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:C,ref_key:"calendarRef",ref:b,onClosed:U(a),onStartUpdate:_[0]||(_[0]=R=>g.value=!0),onFinishUpdate:_[1]||(_[1]=R=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Je("",!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"}}]]),vve=_t(rt({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,o={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,show:l,hide:u}=Fs({toggleOnClick:!0,appendTo:"parent"}),c=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(o.INITIAL_PAGE),v=V(!0),C=V(0),S=V(""),b=n,w=Y(()=>a.value),_=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:i,active:w,bordered:!0})),R=V(null),{argsMain:T}=ws(_),I=Y(()=>c.value?d.value.filter(ne=>ne.id===c.value):[]),x=Y(()=>!c.value||I.value.length===0?"":I.value[0].label),P=Y(()=>c.value?[c.value]:[]),D=Y(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const ne=I.value[0],L=String((ne==null?void 0:ne.color)||"white");return{backgroundColor:L,border:Lg(L,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),F=ne=>({label:ne.name,value:ne.id,selected:c.value===ne.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:ne,id:ne.id,color:ne.color}),{apiServices:k}=ts(!1,s),O=async(ne=o.INITIAL_PAGE,L="",H=!1)=>{var te,he;H?f.value=!0:h.value=!0,p.value=null;try{const me=En.getInstance().getItem("ws.code"),re=await((te=k.value)==null?void 0:te.getAssignableStatuses(me,{entity_id:s.entityId||"",name_like:L,page:ne,per_page:o.PER_PAGE}));if(!re){H||(d.value=[]),v.value=!1;return}const oe=re.data.map(F);d.value=H?[...d.value,...oe]:oe,C.value=((he=re.meta)==null?void 0:he.total)??re.data.length,v.value=d.value.length<C.value,g.value=ne}catch(me){console.error("Error fetching statuses:",me),p.value="Failed to load statuses",H||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},B=(ne,L)=>{var te;L.stopImmediatePropagation(),L.preventDefault(),L.stopPropagation();const H=ne.id;c.value=H,(te=R.value)==null||te.focus(),b("update:modelValue",c.value),u()},Z=async()=>{!v.value||f.value||await O(g.value+1,S.value,!0)},J=async ne=>{S.value=ne,g.value=o.INITIAL_PAGE,await O(o.INITIAL_PAGE,ne,!1)},ee=()=>{c.value=null,b("update:modelValue",null)},X=()=>{l(),Ct(()=>{var ne;(ne=R.value)==null||ne.focus()})};return tt(()=>a.value,ne=>{var L;ne?(O(1,S.value,!1),(L=R.value)==null||L.focus(),b("show")):b("hide")}),tt(()=>c.value,ne=>{b("updated",ne)}),t({focus:X,clear:ee,getData:()=>c.value,setData:ne=>{c.value=ne},hide:u,autoFillDefault:async()=>{S.value="",await O(1,S.value,!1),d.value.length>0&&(c.value=d.value[0].id,b("update:modelValue",c.value))}}),(ne,L)=>{const H=_o("tooltip");return j(),ue(xt,null,[fe(Cs,Xt({ref_key:"triggerRef",ref:i},U(T),{style:{"--icon-size":"18px"}}),{default:ge(()=>[_e("div",{class:Q(ne.$style.status)},[_e("div",{class:Q(ne.$style["color-indicator"]),style:dn(D.value)},null,6),Ke((j(),ue("span",{class:Q({[ne.$style.empty]:I.value.length===0,[ne.$style["status-text"]]:!0})},[nt(wt(x.value),1)],2)),[[H,{content:x.value}]])],2)]),_:1},16),_e("div",{ref_key:"popupRef",ref:r},[fe(Jr,{style:{width:"200px"},ref_key:"searchListRef",ref:R,"selected-id":P.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:J,onSelect:B,onLoadMore:Z,onCancel:L[0]||(L[0]=te=>b("cancel")),onTab:L[1]||(L[1]=te=>b("tab",te)),onClose:L[2]||(L[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-6fccb209"]]),yve=_t(rt({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const s=["name","assignees","status","date","cancel","create-keep","create"],o=Jt,i=xH("target"),r=_n("workspaceId"),a=_n("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=rve(),{apiServices:p}=ts(!1,u),{openSceneHub:g}=tf(),v=V(!1),C=V(!1),S=V(null),b=V({assignees:!1,status:!1,date:!1}),w={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},_=w.name,R=w.assignees,T=w.status,I=w.date,x=w.cancel,P=w["create-keep"],D=w.create,F=V(new Map),k=Y(()=>!!c.error||!c.name.trim()||C.value),O=(ye,M)=>{ye&&F.value.set(M,ye.$el||ye)},B=(ye,M)=>{if(ye==="date"){const[$,ae]=Array.isArray(M)?M:[void 0,void 0];c.start_date=$,c.due_date=ae}else c[ye]=M},Z=()=>{c.isCreating=!0,S.value="name"},J=()=>{c.isCreating=!1,h()},ee=_n("switchInstance"),{addNotification:X}=Qf(),ve=ye=>{l("focus-on-id",ye)},ne=(ye,M,$)=>{const ae=x7(void 0,"created");X({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${ae}</b>
215
+ */function DV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DV(Object(n),!0).forEach(function(s){tme(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DV(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ey(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ey=function(t){return typeof t}:ey=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ey(e)}function tme(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function da(){return da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},da.apply(this,arguments)}function nme(e,t){if(e==null)return{};var n={},s=Object.keys(e),o,i;for(i=0;i<s.length;i++)o=s[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function sme(e,t){if(e==null)return{};var n=nme(e,t),s,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)s=i[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}var ome="1.14.0";function ha(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var fa=ha(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ep=ha(/Edge/i),TV=ha(/firefox/i),tp=ha(/safari/i)&&!ha(/chrome/i)&&!ha(/android/i),IV=ha(/iP(ad|od|hone)/i),ime=ha(/chrome/i)&&ha(/android/i),xV={capture:!1,passive:!1};function wn(e,t,n){e.addEventListener(t,n,!fa&&xV)}function fn(e,t,n){e.removeEventListener(t,n,!fa&&xV)}function ty(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 rme(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function _r(e,t,n,s){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&ty(e,t):ty(e,t))||s&&e===n)return e;if(e===n)break}while(e=rme(e))}return null}var FV=/\s+/g;function Bo(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(FV," ").replace(" "+t+" "," ");e.className=(s+(n?" "+t:"")).replace(FV," ")}}function Bt(e,t,n){var s=e&&e.style;if(s){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 s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=n+(typeof n=="string"?"":"px")}}function yd(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Bt(e,"transform");s&&s!=="none"&&(n=s+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function PV(e,t,n){if(e){var s=e.getElementsByTagName(t),o=0,i=s.length;if(n)for(;o<i;o++)n(s[o],o);return s}return[]}function Rr(){var e=document.scrollingElement;return e||document.documentElement}function Ss(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==Rr()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!fa))do if(o&&o.getBoundingClientRect&&(Bt(o,"transform")!=="none"||n&&Bt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Bt(o,"border-top-width")),a-=h.left+parseInt(Bt(o,"border-left-width")),l=r+i.height,u=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=yd(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,c/=g,l=r+c,u=a+d)}return{top:r,left:a,bottom:l,right:u,width:d,height:c}}}function AV(e,t,n){for(var s=al(e,!0),o=Ss(e)[t];s;){var i=Ss(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===Rr())break;s=al(s,!1)}return!1}function wd(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==$t.ghost&&(s||r[i]!==$t.dragged)&&_r(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function P0(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!ty(n,t));)n=n.previousElementSibling;return n||null}function di(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||ty(e,t))&&n++;return n}function kV(e){var t=0,n=0,s=Rr();if(e)do{var o=yd(e),i=o.a,r=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,n]}function ame(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[n][s])return Number(n)}return-1}function al(e,t){if(!e||!e.getBoundingClientRect)return Rr();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Bt(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Rr();if(s||t)return n;s=!0}}while(n=n.parentNode);return Rr()}function lme(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function A0(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 np;function OV(e,t){return function(){if(!np){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),np=setTimeout(function(){np=void 0},t)}}}function ume(){clearTimeout(np),np=void 0}function MV(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function NV(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 $o="Sortable"+new Date().getTime();function cme(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Bt(o,"display")==="none"||o===$t.ghost)){e.push({target:o,rect:Ss(o)});var i=Er({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=yd(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(ame(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var i=!1,r=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=Ss(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=yd(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&A0(h,d)&&!A0(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=hme(p,h,f,o.options)),A0(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,p,d,l)),l&&(i=!0,r=Math.max(r,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),i?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,i,r){if(r){Bt(s,"transition",""),Bt(s,"transform","");var a=yd(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-i.left)/(l||1),d=(o.top-i.top)/(u||1);s.animatingX=!!c,s.animatingY=!!d,Bt(s,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=dme(s),Bt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Bt(s,"transition",""),Bt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function dme(e){return e.offsetWidth}function hme(e,t,n,s){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))*s.animation}var Cd=[],k0={initializeByDefault:!0},sp={mount:function(t){for(var n in k0)k0.hasOwnProperty(n)&&!(n in t)&&(t[n]=k0[n]);Cd.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Cd.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Cd.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](Er({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](Er({sortable:n},s)))})},initializePlugins:function(t,n,s,o){Cd.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,da(s,u.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);typeof r<"u"&&(t.options[i]=r)}},getEventProperties:function(t,n){var s={};return Cd.forEach(function(o){typeof o.eventProperties=="function"&&da(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return Cd.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function fme(e){var t=e.sortable,n=e.rootEl,s=e.name,o=e.targetEl,i=e.cloneEl,r=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[$o],!!t){var g,v=t.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!fa&&!ep?g=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(s,!0,!0)),g.to=r||n,g.from=a||n,g.item=o||n,g.clone=i,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=Er(Er({},p),sp.getEventProperties(s,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[C]&&v[C].call(t,g)}}var pme=["evt"],vo=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=sme(s,pme);sp.pluginEvent.bind($t)(t,n,Er({dragEl:ft,parentEl:Jn,ghostEl:Yt,rootEl:Un,nextEl:Su,lastDownEl:ny,cloneEl:Qn,cloneHidden:ll,dragStarted:ip,putSortable:Os,activeSortable:$t.active,originalEvent:o,oldIndex:bd,oldDraggableIndex:op,newIndex:Ho,newDraggableIndex:ul,hideGhostForTarget:UV,unhideGhostForTarget:WV,cloneNowHidden:function(){ll=!0},cloneNowShown:function(){ll=!1},dispatchSortableEvent:function(a){to({sortable:n,name:a,originalEvent:o})}},i))};function to(e){fme(Er({putSortable:Os,cloneEl:Qn,targetEl:ft,rootEl:Un,oldIndex:bd,oldDraggableIndex:op,newIndex:Ho,newDraggableIndex:ul},e))}var ft,Jn,Yt,Un,Su,ny,Qn,ll,bd,Ho,op,ul,sy,Os,Sd=!1,oy=!1,iy=[],Eu,Vi,O0,M0,LV,VV,ip,Ed,rp,ap=!1,ry=!1,ay,zs,N0=[],L0=!1,ly=[],uy=typeof document<"u",cy=IV,BV=ep||fa?"cssFloat":"float",gme=uy&&!ime&&!IV&&"draggable"in document.createElement("div"),$V=function(){if(uy){if(fa)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),HV=function(t,n){var s=Bt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=wd(t,0,n),r=wd(t,1,n),a=i&&Bt(i),l=r&&Bt(r),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ss(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ss(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=o&&s[BV]==="none"||r&&s[BV]==="none"&&u+c>o)?"vertical":"horizontal"},mme=function(t,n,s){var o=s?t.left:t.top,i=s?t.right:t.bottom,r=s?t.width:t.height,a=s?n.left:n.top,l=s?n.right:n.bottom,u=s?n.width:n.height;return o===a||i===l||o+r/2===a+u/2},vme=function(t,n){var s;return iy.some(function(o){var i=o[$o].options.emptyInsertThreshold;if(!(!i||P0(o))){var r=Ss(o),a=t>=r.left-i&&t<=r.right+i,l=n>=r.top-i&&n<=r.bottom+i;if(a&&l)return s=o}}),s},GV=function(t){function n(i,r){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(i==null&&(r||d))return!0;if(i==null||i===!1)return!1;if(r&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,u,c),r)(a,l,u,c);var h=(r?a:l).options.group.name;return i===!0||typeof i=="string"&&i===h||i.join&&i.indexOf(h)>-1}}var s={},o=t.group;(!o||ey(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=n(o.pull,!0),s.checkPut=n(o.put),s.revertClone=o.revertClone,t.group=s},UV=function(){!$V&&Yt&&Bt(Yt,"display","none")},WV=function(){!$V&&Yt&&Bt(Yt,"display","")};uy&&document.addEventListener("click",function(e){if(oy)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),oy=!1,!1},!0);var _u=function(t){if(ft){t=t.touches?t.touches[0]:t;var n=vme(t.clientX,t.clientY);if(n){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=n,s.preventDefault=void 0,s.stopPropagation=void 0,n[$o]._onDragOver(s)}}},yme=function(t){ft&&ft.parentNode[$o]._isOutsideThisEl(t.target)};function $t(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=da({},t),e[$o]=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 HV(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(r,a){r.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:$t.supportPointer!==!1&&"PointerEvent"in window&&!tp,emptyInsertThreshold:5};sp.initializePlugins(this,e,n);for(var s in n)!(s in t)&&(t[s]=n[s]);GV(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:gme,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)),iy.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),da(this,cme())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ed=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ft):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,s=this.el,o=this.options,i=o.preventOnFilter,r=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=o.filter;if(Dme(s),!ft&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&tp&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=_r(l,o.draggable,s,!1),!(l&&l.animated)&&ny!==l)){if(bd=di(l),op=di(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){to({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:s,fromEl:s}),vo("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=_r(u,d.trim(),s,!1),d)return to({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),vo("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!_r(u,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,s){var o=this,i=o.el,r=o.options,a=i.ownerDocument,l;if(s&&!ft&&s.parentNode===i){var u=Ss(s);if(Un=i,ft=s,Jn=ft.parentNode,Su=ft.nextSibling,ny=s,sy=r.group,$t.dragged=ft,Eu={target:ft,clientX:(n||t).clientX,clientY:(n||t).clientY},LV=Eu.clientX-u.left,VV=Eu.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ft.style["will-change"]="all",l=function(){if(vo("delayEnded",o,{evt:t}),$t.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!TV&&o.nativeDraggable&&(ft.draggable=!0),o._triggerDragStart(t,n),to({sortable:o,name:"choose",originalEvent:t}),Bo(ft,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){PV(ft,c.trim(),V0)}),wn(a,"dragover",_u),wn(a,"mousemove",_u),wn(a,"touchmove",_u),wn(a,"mouseup",o._onDrop),wn(a,"touchend",o._onDrop),wn(a,"touchcancel",o._onDrop),TV&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ft.draggable=!0),vo("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ep||fa))){if($t.eventCanceled){this._onDrop();return}wn(a,"mouseup",o._disableDelayedDrag),wn(a,"touchend",o._disableDelayedDrag),wn(a,"touchcancel",o._disableDelayedDrag),wn(a,"mousemove",o._delayedDragTouchMoveHandler),wn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&wn(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.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(){ft&&V0(ft),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._disableDelayedDrag),fn(t,"touchend",this._disableDelayedDrag),fn(t,"touchcancel",this._disableDelayedDrag),fn(t,"mousemove",this._delayedDragTouchMoveHandler),fn(t,"touchmove",this._delayedDragTouchMoveHandler),fn(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(ft,"dragend",this),wn(Un,"dragstart",this._onDragStart));try{document.selection?hy(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Sd=!1,Un&&ft){vo("dragStarted",this,{evt:n}),this.nativeDraggable&&wn(document,"dragover",yme);var s=this.options;!t&&Bo(ft,s.dragClass,!1),Bo(ft,s.ghostClass,!0),$t.active=this,t&&this._appendGhost(),to({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Vi){this._lastX=Vi.clientX,this._lastY=Vi.clientY,UV();for(var t=document.elementFromPoint(Vi.clientX,Vi.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Vi.clientX,Vi.clientY),t!==n);)n=t;if(ft.parentNode[$o]._isOutsideThisEl(t),n)do{if(n[$o]){var s=void 0;if(s=n[$o]._onDragOver({clientX:Vi.clientX,clientY:Vi.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);WV()}},_onTouchMove:function(t){if(Eu){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=Yt&&yd(Yt,!0),a=Yt&&r&&r.a,l=Yt&&r&&r.d,u=cy&&zs&&kV(zs),c=(i.clientX-Eu.clientX+o.x)/(a||1)+(u?u[0]-N0[0]:0)/(a||1),d=(i.clientY-Eu.clientY+o.y)/(l||1)+(u?u[1]-N0[1]:0)/(l||1);if(!$t.active&&!Sd){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Yt){r?(r.e+=c-(O0||0),r.f+=d-(M0||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Bt(Yt,"webkitTransform",h),Bt(Yt,"mozTransform",h),Bt(Yt,"msTransform",h),Bt(Yt,"transform",h),O0=c,M0=d,Vi=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Yt){var t=this.options.fallbackOnBody?document.body:Un,n=Ss(ft,!0,cy,!0,t),s=this.options;if(cy){for(zs=t;Bt(zs,"position")==="static"&&Bt(zs,"transform")==="none"&&zs!==document;)zs=zs.parentNode;zs!==document.body&&zs!==document.documentElement?(zs===document&&(zs=Rr()),n.top+=zs.scrollTop,n.left+=zs.scrollLeft):zs=Rr(),N0=kV(zs)}Yt=ft.cloneNode(!0),Bo(Yt,s.ghostClass,!1),Bo(Yt,s.fallbackClass,!0),Bo(Yt,s.dragClass,!0),Bt(Yt,"transition",""),Bt(Yt,"transform",""),Bt(Yt,"box-sizing","border-box"),Bt(Yt,"margin",0),Bt(Yt,"top",n.top),Bt(Yt,"left",n.left),Bt(Yt,"width",n.width),Bt(Yt,"height",n.height),Bt(Yt,"opacity","0.8"),Bt(Yt,"position",cy?"absolute":"fixed"),Bt(Yt,"zIndex","100000"),Bt(Yt,"pointerEvents","none"),$t.ghost=Yt,t.appendChild(Yt),Bt(Yt,"transform-origin",LV/parseInt(Yt.style.width)*100+"% "+VV/parseInt(Yt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(vo("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}vo("setupClone",this),$t.eventCanceled||(Qn=NV(ft),Qn.draggable=!1,Qn.style["will-change"]="",this._hideClone(),Bo(Qn,this.options.chosenClass,!1),$t.clone=Qn),s.cloneId=hy(function(){vo("clone",s),!$t.eventCanceled&&(s.options.removeCloneOnHide||Un.insertBefore(Qn,ft),s._hideClone(),to({sortable:s,name:"clone"}))}),!n&&Bo(ft,i.dragClass,!0),n?(oy=!0,s._loopId=setInterval(s._emulateDragOver,50)):(fn(document,"mouseup",s._onDrop),fn(document,"touchend",s._onDrop),fn(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ft)),wn(document,"drop",s),Bt(ft,"transform","translateZ(0)")),Sd=!0,s._dragStartId=hy(s._dragStarted.bind(s,n,t)),wn(document,"selectstart",s),ip=!0,tp&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,u=$t.active,c=sy===l,d=a.sort,h=Os||u,f,p=this,g=!1;if(L0)return;function v(ee,X){vo(ee,p,Er({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:S,onMove:function(ne,L){return dy(Un,n,ft,o,ne,Ss(ne),t,L)},changed:b},X))}function C(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(p),p!==h&&(Bo(ft,Os?Os.options.ghostClass:u.options.ghostClass,!1),Bo(ft,a.ghostClass,!0)),Os!==p&&p!==$t.active?Os=p:p===$t.active&&Os&&(Os=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ft&&!ft.animated||s===n&&!s.animated)&&(Ed=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ft.parentNode[$o]._isOutsideThisEl(t.target),!ee&&_u(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Ho=di(ft),ul=di(ft,a.draggable),to({sortable:p,name:"change",toEl:n,newIndex:Ho,newDraggableIndex:ul,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=_r(s,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(ft.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return S(!1);if(oy=!1,u&&!a.disabled&&(c?d||(r=Jn!==Un):Os===this||(this.lastPutMode=sy.checkPull(this,u,ft,t))&&l.checkPut(this,u,ft,t))){if(f=this._getDirection(t,s)==="vertical",o=Ss(ft),v("dragOverValid"),$t.eventCanceled)return g;if(r)return Jn=Un,C(),this._hideClone(),v("revert"),$t.eventCanceled||(Su?Un.insertBefore(ft,Su):Un.appendChild(ft)),S(!0);var w=P0(n,a.draggable);if(!w||Sme(t,f,this)&&!w.animated){if(w===ft)return S(!1);if(w&&n===t.target&&(s=w),s&&(i=Ss(s)),dy(Un,n,ft,o,s,i,t,!!s)!==!1)return C(),n.appendChild(ft),Jn=n,b(),S(!0)}else if(w&&bme(t,f,this)){var _=wd(n,0,a,!0);if(_===ft)return S(!1);if(s=_,i=Ss(s),dy(Un,n,ft,o,s,i,t,!1)!==!1)return C(),n.insertBefore(ft,_),Jn=n,b(),S(!0)}else if(s.parentNode===n){i=Ss(s);var R=0,T,I=ft.parentNode!==n,x=!mme(ft.animated&&ft.toRect||o,s.animated&&s.toRect||i,f),P=f?"top":"left",D=AV(s,"top","top")||AV(ft,"top","top"),F=D?D.scrollTop:void 0;Ed!==s&&(T=i[P],ap=!1,ry=!x&&a.invertSwap||I),R=Eme(t,s,i,f,x?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,ry,Ed===s);var k;if(R!==0){var O=di(ft);do O-=R,k=Jn.children[O];while(k&&(Bt(k,"display")==="none"||k===Yt))}if(R===0||k===s)return S(!1);Ed=s,rp=R;var B=s.nextElementSibling,Z=!1;Z=R===1;var J=dy(Un,n,ft,o,s,i,t,Z);if(J!==!1)return(J===1||J===-1)&&(Z=J===1),L0=!0,setTimeout(Cme,30),C(),Z&&!B?n.appendChild(ft):s.parentNode.insertBefore(ft,Z?B:s),D&&MV(D,0,F-D.scrollTop),Jn=ft.parentNode,T!==void 0&&!ry&&(ay=Math.abs(T-Ss(s)[P])),b(),S(!0)}if(n.contains(ft))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){fn(document,"mousemove",this._onTouchMove),fn(document,"touchmove",this._onTouchMove),fn(document,"pointermove",this._onTouchMove),fn(document,"dragover",_u),fn(document,"mousemove",_u),fn(document,"touchmove",_u)},_offUpEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._onDrop),fn(t,"touchend",this._onDrop),fn(t,"pointerup",this._onDrop),fn(t,"touchcancel",this._onDrop),fn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(Ho=di(ft),ul=di(ft,s.draggable),vo("drop",this,{evt:t}),Jn=ft&&ft.parentNode,Ho=di(ft),ul=di(ft,s.draggable),$t.eventCanceled){this._nulling();return}Sd=!1,ry=!1,ap=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),B0(this.cloneId),B0(this._dragStartId),this.nativeDraggable&&(fn(document,"drop",this),fn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),tp&&Bt(document.body,"user-select",""),Bt(ft,"transform",""),t&&(ip&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Yt&&Yt.parentNode&&Yt.parentNode.removeChild(Yt),(Un===Jn||Os&&Os.lastPutMode!=="clone")&&Qn&&Qn.parentNode&&Qn.parentNode.removeChild(Qn),ft&&(this.nativeDraggable&&fn(ft,"dragend",this),V0(ft),ft.style["will-change"]="",ip&&!Sd&&Bo(ft,Os?Os.options.ghostClass:this.options.ghostClass,!1),Bo(ft,this.options.chosenClass,!1),to({sortable:this,name:"unchoose",toEl:Jn,newIndex:null,newDraggableIndex:null,originalEvent:t}),Un!==Jn?(Ho>=0&&(to({rootEl:Jn,name:"add",toEl:Jn,fromEl:Un,originalEvent:t}),to({sortable:this,name:"remove",toEl:Jn,originalEvent:t}),to({rootEl:Jn,name:"sort",toEl:Jn,fromEl:Un,originalEvent:t}),to({sortable:this,name:"sort",toEl:Jn,originalEvent:t})),Os&&Os.save()):Ho!==bd&&Ho>=0&&(to({sortable:this,name:"update",toEl:Jn,originalEvent:t}),to({sortable:this,name:"sort",toEl:Jn,originalEvent:t})),$t.active&&((Ho==null||Ho===-1)&&(Ho=bd,ul=op),to({sortable:this,name:"end",toEl:Jn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){vo("nulling",this),Un=ft=Jn=Yt=Su=Qn=ny=ll=Eu=Vi=ip=Ho=ul=bd=op=Ed=rp=Os=sy=$t.dragged=$t.ghost=$t.clone=$t.active=null,ly.forEach(function(t){t.checked=!0}),ly.length=O0=M0=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ft&&(this._onDragOver(t),wme(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,s=this.el.children,o=0,i=s.length,r=this.options;o<i;o++)n=s[o],_r(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||Rme(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];_r(a,this.options.draggable,o,!1)&&(s[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){s[i]&&(o.removeChild(s[i]),o.appendChild(s[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return _r(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var s=this.options;if(n===void 0)return s[t];var o=sp.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&GV(s)},destroy:function(){vo("destroy",this);var t=this.el;t[$o]=null,fn(t,"mousedown",this._onTapStart),fn(t,"touchstart",this._onTapStart),fn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(fn(t,"dragover",this),fn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),iy.splice(iy.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!ll){if(vo("hideClone",this),$t.eventCanceled)return;Bt(Qn,"display","none"),this.options.removeCloneOnHide&&Qn.parentNode&&Qn.parentNode.removeChild(Qn),ll=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(ll){if(vo("showClone",this),$t.eventCanceled)return;ft.parentNode==Un&&!this.options.group.revertClone?Un.insertBefore(Qn,ft):Su?Un.insertBefore(Qn,Su):Un.appendChild(Qn),this.options.group.revertClone&&this.animate(ft,Qn),Bt(Qn,"display",""),ll=!1}}};function wme(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function dy(e,t,n,s,o,i,r,a){var l,u=e[$o],c=u.options.onMove,d;return window.CustomEvent&&!fa&&!ep?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=s,l.related=o||t,l.relatedRect=i||Ss(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),c&&(d=c.call(u,l,r)),d}function V0(e){e.draggable=!1}function Cme(){L0=!1}function bme(e,t,n){var s=Ss(wd(n.el,0,n.options,!0)),o=10;return t?e.clientX<s.left-o||e.clientY<s.top&&e.clientX<s.right:e.clientY<s.top-o||e.clientY<s.bottom&&e.clientX<s.left}function Sme(e,t,n){var s=Ss(P0(n.el,n.options.draggable)),o=10;return t?e.clientX>s.right+o||e.clientX<=s.right&&e.clientY>s.bottom&&e.clientX>=s.left:e.clientX>s.right&&e.clientY>s.top||e.clientX<=s.right&&e.clientY>s.bottom+o}function Eme(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,u=s?n.height:n.width,c=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&ay<u*o){if(!ap&&(rp===1?l>c+u*i/2:l<d-u*i/2)&&(ap=!0),ap)h=!0;else if(rp===1?l<c+ay:l>d-ay)return-rp}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return _me(t)}return h=h||r,h&&(l<c+u*i/2||l>d-u*i/2)?l>c+u/2?1:-1:0}function _me(e){return di(ft)<di(e)?1:-1}function Rme(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,s=0;n--;)s+=t.charCodeAt(n);return s.toString(36)}function Dme(e){ly.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&ly.push(s)}}function hy(e){return setTimeout(e,0)}function B0(e){return clearTimeout(e)}uy&&wn(document,"touchmove",function(e){($t.active||Sd)&&e.cancelable&&e.preventDefault()}),$t.utils={on:wn,off:fn,css:Bt,find:PV,is:function(t,n){return!!_r(t,n,t,!1)},extend:lme,throttle:OV,closest:_r,toggleClass:Bo,clone:NV,index:di,nextTick:hy,cancelNextTick:B0,detectDirection:HV,getChild:wd},$t.get=function(e){return e[$o]},$t.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(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&($t.utils=Er(Er({},$t.utils),s.utils)),sp.mount(s)})},$t.create=function(e,t){return new $t(e,t)},$t.version=ome;var hs=[],lp,$0,H0=!1,G0,U0,fy,up;function Tme(){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 s=n.originalEvent;this.sortable.nativeDraggable?wn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?wn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?wn(document,"touchmove",this._handleFallbackAutoScroll):wn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?fn(document,"dragover",this._handleAutoScroll):(fn(document,"pointermove",this._handleFallbackAutoScroll),fn(document,"touchmove",this._handleFallbackAutoScroll),fn(document,"mousemove",this._handleFallbackAutoScroll)),zV(),py(),ume()},nulling:function(){fy=$0=lp=H0=up=G0=U0=null,hs.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,s){var o=this,i=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,r);if(fy=n,s||this.options.forceAutoScrollFallback||ep||fa||tp){W0(n,this.options,a,s);var l=al(a,!0);H0&&(!up||i!==G0||r!==U0)&&(up&&zV(),up=setInterval(function(){var u=al(document.elementFromPoint(i,r),!0);u!==l&&(l=u,py()),W0(n,o.options,u,s)},10),G0=i,U0=r)}else{if(!this.options.bubbleScroll||al(a,!0)===Rr()){py();return}W0(n,this.options,al(a,!1),!1)}}},da(e,{pluginName:"scroll",initializeByDefault:!0})}function py(){hs.forEach(function(e){clearInterval(e.pid)}),hs=[]}function zV(){clearInterval(up)}var W0=OV(function(e,t,n,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=Rr(),u=!1,c;$0!==n&&($0=n,py(),lp=t.scroll,c=t.scrollFn,lp===!0&&(lp=al(n,!0)));var d=0,h=lp;do{var f=h,p=Ss(f),g=p.top,v=p.bottom,C=p.left,S=p.right,b=p.width,w=p.height,_=void 0,R=void 0,T=f.scrollWidth,I=f.scrollHeight,x=Bt(f),P=f.scrollLeft,D=f.scrollTop;f===l?(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),R=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"),R=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"));var F=_&&(Math.abs(S-o)<=r&&P+b<T)-(Math.abs(C-o)<=r&&!!P),k=R&&(Math.abs(v-i)<=r&&D+w<I)-(Math.abs(g-i)<=r&&!!D);if(!hs[d])for(var O=0;O<=d;O++)hs[O]||(hs[O]={});(hs[d].vx!=F||hs[d].vy!=k||hs[d].el!==f)&&(hs[d].el=f,hs[d].vx=F,hs[d].vy=k,clearInterval(hs[d].pid),(F!=0||k!=0)&&(u=!0,hs[d].pid=setInterval((function(){s&&this.layer===0&&$t.active._onTouchMove(fy);var B=hs[this.layer].vy?hs[this.layer].vy*a:0,Z=hs[this.layer].vx?hs[this.layer].vx*a:0;typeof c=="function"&&c.call($t.dragged.parentNode[$o],Z,B,e,fy,hs[this.layer].el)!=="continue"||MV(hs[this.layer].el,Z,B)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=al(h,!1)));H0=u}},30),jV=function(t){var n=t.originalEvent,s=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=s||i;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)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function z0(){}z0.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=wd(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),s&&s.animateAll()},drop:jV},da(z0,{pluginName:"revertOnSpill"});function j0(){}j0.prototype={onSpill:function(t){var n=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:jV},da(j0,{pluginName:"removeOnSpill"}),$t.mount(new Tme),$t.mount(j0,z0);function Ime(e,t){return Object.values(e).indexOf(t)}function xme(e,t,n,s){if(!e)return[];const o=Object.values(e),i=t.length-s;return[...t].map((a,l)=>l>=i?o.length:o.indexOf(a))}function Fme(e){return["transition-group","TransitionGroup"].includes(e)}function KV(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?Fme(t.name):!1}function Pme(e,t){return t?{...t.props,...t.attrs}:e}const K0=["Start","Add","Remove","Update","End"],q0=["Choose","Unchoose","Sort","Filter","Clone"],Ame=["Move",...K0,...q0].map(e=>"on"+e);let Y0=null;const kme=rt({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",...K0.map(e=>e.toLowerCase()),...q0.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:s}){const o=V(!1),i=V(!1),r=V(0),a=V(0),l=V([]),u=V(null),c=V(null),d=Y(()=>e.list?e.list:e.modelValue),h=Yn();function f(){return e.component?VH(e.component):e.tag}function p(H){if(c.value)for(const te in H){const he=_V(te);Ame.indexOf(he)===-1&&c.value.option(he,H[te])}}function g(){var H;return((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[]}async function v(){var H;await Ct(),l.value=xme(g(),((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[],o.value,a.value)}function C(H){const te=Ime(g()||[],H);if(te===-1)return null;const he=d.value?d.value[te]:null;return{index:te,element:he}}function S(H){Ct(()=>t("change",H))}function b(H){if(e.list){H(e.list);return}const te=[...e.modelValue||[]];H(te),t("update:modelValue",te)}function w(...H){b(he=>he.splice(...H))}function _(H,te){b(me=>me.splice(te,0,me.splice(H,1)[0]))}function R(H){const te=l.value,he=te.length;return H>he-1?he:te[H]}function T(){var te,he;return n.default&&((he=(te=n.default()[0])==null?void 0:te.component)==null?void 0:he.proxy)||null}function I(H){if(!e.noTransitionOnDrag||!o.value)return;const te=g();te[H]&&(te[H].data=null);const he=T();he&&(he.children=[],he.kept=void 0)}function x(H){v(),u.value=C(H.item),u.value&&(H.item._underlying_vm_=e.clone(u.value.element),Y0=H.item)}function P(H){const te=H.item._underlying_vm_;if(te===void 0)return;F0(H.item);const he=R(H.newIndex);w(he,0,te),v(),S({added:{element:te,newIndex:he}})}function D(H){var he;if(RV((he=h==null?void 0:h.proxy)==null?void 0:he.$el,H.item,H.oldIndex),H.pullMode==="clone"){F0(H.clone);return}if(!u.value)return;const te=u.value.index;w(te,1),I(te),S({removed:{element:u.value.element,oldIndex:te}})}function F(H){var me,re;F0(H.item),RV(H.from,H.item,H.oldIndex);const te=(me=u.value)==null?void 0:me.index,he=R(H.newIndex);_(te,he),S({moved:{element:(re=u.value)==null?void 0:re.element,oldIndex:te,newIndex:he}})}function k(H,te){Object.prototype.hasOwnProperty.call(H,te)&&(H[te]+=r.value)}function O(H){return H.__draggable_component__}function B({to:H,related:te}){const he=O(H);if(!he)return{component:he};const me=he.realList,re={list:me,component:he};if(H!==te&&me&&he.getUnderlyingVm){const oe=he.getUnderlyingVm(te);if(oe)return Object.assign(oe,re)}return re}function Z(H,te){const he=[...te.to.children].filter(z=>z.style.display!=="none");if(he.length===0)return 0;const me=he.indexOf(te.related),re=H.component.getVmIndex(me);return he.indexOf(Y0)!==-1||!te.willInsertAfter?re:re+1}const J=()=>{var re,oe;const H={};K0.forEach(z=>{H["on"+z]=X(z)}),q0.forEach(z=>{H["on"+z]=ee.bind(null,z)});const te=Object.keys(s).reduce((z,pe)=>(z[_V(pe)]=s[pe],z),{}),he=Object.assign({},te,H,{onMove:(z,pe)=>ve(z,pe)});"draggable"in he||(he.draggable=">*");const me=((re=h==null?void 0:h.proxy)==null?void 0:re.$el.nodeType)===1?h.proxy.$el:((oe=h==null?void 0:h.proxy)==null?void 0:oe.$el.parentElement)||null;me&&(c.value=new $t(me,he),me.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(H,te){Ct(()=>t(H.toLowerCase(),te))}function X(H){return te=>{if(d.value!==null){const he="onDrag"+H,me=L[he];me&&me(te)}ee(H,te)}}function ve(H,te){const he=e.move;if(!he||!d.value)return!0;const me=B(H),re=u.value,oe=Z(me,H);re&&Object.assign(re,{futureIndex:oe});const z=Object.assign({},H,{relatedContext:me,draggedContext:re});return he(z,te)}function ne(){v(),Y0=null}const L={onDragStart:x,onDragAdd:P,onDragRemove:D,onDragUpdate:F,onDragMove:ve,onDragEnd:ne};return nn(()=>{J()}),e.list!==null&&e.modelValue!==null&&Jge.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:i,headerOffset:r,footerOffset:a,transitionMode:o,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:C,emitChanges:S,alterList:b,spliceList:w,updatePosition:_,getVmIndex:R,getComponent:T,resetTransitionData:I,onDragStart:x,onDragAdd:P,onDragRemove:D,onDragUpdate:F,updateProperty:k,onDragMove:ve,onDragEnd:ne,mounted:J,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:B,getTargetedComponent:O,computeFutureIndex:Z}},render(){const e=this.getTag(),t=Pme(this.$attrs,this.componentData);if(typeof e=="string"){const s=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return s?(this.transitionMode=KV(s),Zu(e,t,s)):Zu(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const s=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=KV(s||[])}return Zu(e,t,n)}}),Ome=_t(rt({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=V([]),s=e,o=t,i=V({}),r=()=>{n.value=s.modelValue.map(u=>({id:u.field,name:u.headerName,...u}))||[],s.modelValue.forEach(u=>{i.value[u.field]={...u}})};tt(()=>s.modelValue,u=>{r()},{immediate:!0,deep:!0}),tt(n,u=>{if(u.length===s.modelValue.length&&!u.every((d,h)=>d.id===s.modelValue[h].field)){const d=u.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=u=>!(s.readOnly||s.disabled);return(u,c)=>(j(),qe(U(kme),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),tag:"transition-group",disabled:s.disabled||s.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:ge(()=>[(j(!0),ue(xt,null,xn(n.value,(d,h)=>(j(),ue("div",{key:d.id,class:"fade-item"},[Tt(u.$slots,"item",{item:d,index:h},()=>[nt(wt(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),Mme={key:0},Nme={key:1,style:{"font-style":"italic"}},Lme={key:2,style:{"font-style":"italic"}},Vme={key:3},gy=_t(rt({__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=Jt,s=e,o=V(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=Y(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=Y(()=>{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=Y(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(j(),ue("div",{key:e.item.field,class:Q([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[fe(cV,{focusIndex:s.focusIndex,id:`col-${e.item.field}`,"model-value":o.value==!0?U(Lt).CHECKED:U(Lt).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((j(),ue("div",{class:"move-handler",style:dn({cursor:s.disableDrag?"not-allowed":"move"})},[fe(lt,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:Q(h.$style.handler)},null,8,["color","class"])],4)),[[U(n),s.disableDrag==!0?s.disableDragTooltip:""]]),u.value?(j(),ue("div",{key:0,class:Q(h.$style["metric-type"])},[l.value=="rating"?(j(),ue("span",Mme,"★")):l.value=="formular"?(j(),ue("span",Nme," ƒx ")):l.value=="number"?(j(),ue("span",Lme," # ")):(j(),ue("span",Vme,wt(l.value),1))],2)):Je("",!0),_e("span",{class:Q(h.$style["column-config__item-label"])},[Ke((j(),ue("div",null,[nt(wt(e.item.headerName),1)])),[[U(n),{content:e.item.headerName}]])],2),d.value?Ke((j(),ue("div",{key:1,class:Q(h.$style["metric-icon"])},[fe(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[U(n),"Point metric"]]):Je("",!0),c.value?Ke((j(),ue("div",{key:2,class:Q(h.$style["metric-icon"])},[fe(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[U(n),"Woohoo metric"]]):Je("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_7scp0_1","is-metric":"_is-metric_7scp0_8","is-woohoo-metric":"_is-woohoo-metric_7scp0_12","is-point-metric":"_is-point-metric_7scp0_15","column-config__item-label":"_column-config__item-label_7scp0_18",disabled:"_disabled_7scp0_34",readOnly:"_readOnly_7scp0_38","column-config__item--pinned":"_column-config__item--pinned_7scp0_41",handler:"_handler_7scp0_48",badge:"_badge_7scp0_52","metric-type":"_metric-type_7scp0_78","metric-icon":"_metric-icon_7scp0_106"}}]]),Bme=_t(rt({__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 s=e,o=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:u}=Fs({toggleOnClick:!0,placement:s.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:s.show,maxWidth:s.maxWidth}),c=Y(()=>l.value);tt(l,f=>{o(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:c});const h=f=>{f.key==="Escape"&&a.value&&i()};return nn(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),vs(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(j(),ue("div",{ref_key:"triggerRef",ref:r,class:Q(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:U(l),toggle:U(u),closeDropdown:d},()=>[_e("button",{class:Q(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),_e("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:Q(f.$style["dropdown-content"]),style:dn({display:U(l)?"block":"none",maxWidth:s.maxWidth?s.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:U(l)},()=>[_e("div",{class:Q(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"}}]]),$me={class:"reach-limit-icon"},Hme=_t(rt({__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 s=Jt,o=e,i=n,r=V(""),a=V(),l=Y(()=>r.value.trim().length>0),u=V([]),c=V({}),{triggerRef:d,popupRef:h,isVisible:f,hide:p}=Fs({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});tt(f,k=>{var O;k&&((O=a.value)==null||O.focus())});const g=Y(()=>o.disabled||r.value.length>0),v=Y(()=>u.value.filter(k=>k.pinned==="left"&&k.field&&k.headerName)),C=Y(()=>u.value.filter(k=>k.pinned==="right"&&k.field||k.field==="blank")),S=Y({get:()=>u.value.filter(k=>!k.pinned&&k.field&&k.field!=="blank"),set:k=>{u.value=[...v.value,...k,...C.value]}}),b=Y(()=>{if(!r.value)return{};const k=r.value.toLowerCase();return[...u.value,...S.value].reduce((O,B)=>{var Z;return(Z=B.headerName)!=null&&Z.toLowerCase().includes(k)&&B.field&&(O[B.field]=!0),O},{})}),w=Y(()=>o.modelValue),_=()=>{const k={};u.value.forEach(O=>{O.field&&(k[O.field]=!O.hide)}),c.value=k},R=Y(()=>{if(!r.value)return u.value;const k=r.value.toLowerCase();return u.value.filter(O=>{var B;return(B=O.headerName)==null?void 0:B.toLowerCase().includes(k)})}),T=()=>{var B;const k=(B=o.gridApi)==null?void 0:B.getColumnState().reduce((Z,J)=>(Z[J.colId]=Number(J.width),Z),{}),O=u.value.map(Z=>({...Z,hide:Z.field?!c.value[Z.field]:!1,width:Z.field?k==null?void 0:k[Z.field]:Z.width}));i("update:modelValue",O),i("change",O),i("input",O)},I=k=>{const O=[...v.value,...k,...C.value];o.checkboxColumn&&O.unshift(o.checkboxColumn),u.value=O,T()},x=k=>{k&&(c.value[k]=!c.value[k],T())};tt(w,k=>{k&&k.length>0&&(u.value=[...k],_())},{immediate:!0}),t({updateColumnDefs(k){u.value=[...k],_()}});const P=Y(()=>F.value>=5),D=Y(()=>o.disabled||r.value.length>0),F=Y(()=>u.value.reduce((k,O)=>O.field&&O.field.includes("metric")&&c.value[O.field]===!0?k+1:k,0));return(k,O)=>{const B=_o("focusable");return j(),ue("div",{class:Q(k.$style["table-customization"])},[_e("div",{ref_key:"triggerRef",ref:d},[Tt(k.$slots,"trigger",{},()=>[Ke((j(),qe(mt,{variant:["secondary"],disabled:o.disabled,actived:U(f),style:{width:"32px"},onEscape:U(p)},{prefix:ge(()=>[fe(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[B,"7"],[U(s),"Columns"]])])],512),_e("div",{ref_key:"popupRef",ref:h,class:Q(k.$style["tippy-content-wrapper"])},[_e("div",{class:Q([k.$style["column-config"],P.value?k.$style["has-warning"]:""]),style:dn({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[fe(iS,{tabIndex:"7.0",modelValue:r.value,"onUpdate:modelValue":O[0]||(O[0]=Z=>r.value=Z),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),_e("div",{class:Q(k.$style["column-config__header"])},[...O[2]||(O[2]=[_e("span",null,"Manage columns",-1)])],2),P.value?(j(),ue("div",{key:0,class:Q(k.$style["reach-limit"])},[_e("div",$me,[fe(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),_e("div",{class:Q(k.$style["warning-limit-text"])},[...O[3]||(O[3]=[nt(" You’ve reached the maximum number of metric columns. ",-1),_e("br",null,null,-1),nt(" Deselect one to show another. ",-1)])],2)],2)):Je("",!0),l.value?(j(),ue(xt,{key:1},[R.value.length===0&&l.value?(j(),ue("div",{key:0,class:Q(k.$style["no-columns"])},[...O[4]||(O[4]=[nt(" No results. ",-1),_e("br",null,null,-1),nt(" Try another search. ",-1)])],2)):Je("",!0),l.value&&R.value.length>0?(j(),ue("div",{key:1,class:Q(k.$style["column-config__pinned-section"])},[(j(!0),ue(xt,null,xn(R.value,Z=>{var J;return j(),qe(gy,{key:Z.colId,item:Z,columnStates:c.value,disableDrag:D.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:P.value&&((J=Z.colId)==null?void 0:J.includes("metric")),onToggleColumn:x},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Je("",!0)],64)):Je("",!0),l.value?Je("",!0):(j(),ue("div",{key:2,class:Q(k.$style["column-config__list"])},[(j(!0),ue(xt,null,xn(v.value,Z=>Ke((j(),qe(gy,{key:Z.field,item:Z,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:c.value},null,8,["item","columnStates"])),[[To,b.value[Z.field]||!r.value]])),128)),fe(Ome,{modelValue:S.value,"onUpdate:modelValue":O[1]||(O[1]=Z=>S.value=Z),"group-name":"columns",onChanged:I,disabled:g.value,readOnly:o.readOnly},{item:ge(({item:Z,index:J})=>[Ke((j(),qe(gy,{focusIndex:`7.${J+1}`,key:Z.id,item:Z,columnStates:c.value,disableDrag:D.value,disableDragTooltip:D.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:P.value&&Z.id.includes("metric"),onToggleColumn:x},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[To,b.value[Z.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(j(!0),ue(xt,null,xn(C.value.filter(Z=>{var J;return Z.headerName&&((J=Z.headerName)==null?void 0:J.length)>0}),Z=>Ke((j(),qe(gy,{key:Z.field,item:Z,disabled:o.disabled,readOnly:o.readOnly,columnStates:c.value},null,8,["item","disabled","readOnly","columnStates"])),[[To,b.value[Z.field]||!r.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"}}]]),Gme=["aria-label"],Ume=["aria-disabled","onClick"],Wme=_t(rt({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,s=t,o=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||s("select",a)},i=new Date().getFullYear(),r=new Date().getMonth()+1;return(a,l)=>(j(),ue("div",{class:Q([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[_e("div",{class:Q(a.$style.months)},[(j(!0),ue(xt,null,xn(n.monthLabels,(u,c)=>(j(),ue("a",{key:u,tabindex:"0",class:Q([a.$style["month-cell"],{[a.$style.selected]:c+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:c+1===r&&U(i)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(c+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(c+1),onClick:d=>o(c+1),onKeydown:l[0]||(l[0]=d=>s("keydown",d))},wt(u),43,Ume))),128))],2)],10,Gme))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_a776x_1",months:"_months_a776x_8","month-cell":"_month-cell_a776x_22",selected:"_selected_a776x_36",compact:"_compact_a776x_40",current:"_current_a776x_53",disabled:"_disabled_a776x_61"}}]]),zme=["data-year","aria-disabled","onClick"],jme=_t(rt({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=V(null),r=new Date().getFullYear(),a=l=>{s.disabled||!s.isYearSelectable(l)||o("select",l)};return t({rootEl:i}),nn(()=>{if(i.value){const l=i.value.querySelector(`[data-year="${s.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,u)=>(j(),ue("div",{ref_key:"rootEl",ref:i,class:Q([l.$style["year-grid-body"],s.scrollable?l.$style.scrollable:"",s.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(j(!0),ue(xt,null,xn(s.years,c=>(j(),ue("a",{key:c,"data-year":c,tabindex:"0",class:Q([l.$style["year-cell"],{[l.$style.selected]:c===s.selectedYear,[l.$style.current]:c===U(r),[l.$style.disabled]:s.disabled||!s.isYearSelectable(c)}]),"aria-disabled":s.disabled||!s.isYearSelectable(c),onClick:d=>a(c),onKeydown:u[0]||(u[0]=d=>o("keydown",d))},wt(c),43,zme))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_1us7k_1",scrollable:"_scrollable_1us7k_11","year-cell":"_year-cell_1us7k_16",selected:"_selected_1us7k_28",current:"_current_1us7k_31",compact:"_compact_1us7k_35",disabled:"_disabled_1us7k_47"}}]]),Kme={class:"navigation"},qme={class:"picker"},Yme={key:0,class:"footer"},Zme=_t(rt({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(j(),ue("div",{class:Q(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[_e("div",Kme,[Tt(t.$slots,"navigation",{},void 0,!0)]),_e("div",qme,[Tt(t.$slots,"picker",{},void 0,!0)]),fe(XD,{name:"fade",mode:"out-in"},{default:ge(()=>[e.disableConfirm?Je("",!0):(j(),ue("div",Yme,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),Xme={style:{flex:"1"}},Jme=_t(rt({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,s=t,o=()=>{s("cancel")},i=()=>{s("confirm")},r=(l=new Date)=>{s("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const u=l.target;u.dataset.index==="today-btn"?r():u.dataset.index==="cancel-btn"?o():u.dataset.index==="save-btn"&&i()}};return(l,u)=>{const c=_o("tooltip");return n.readOnly?Je("",!0):(j(),ue("div",{key:0,class:Q(l.$style["arbo-calendar-actions"])},[_e("div",Xme,[Ke((j(),qe(U(mt),{variant:"secondary",size:"medium",onClick:u[0]||(u[0]=d=>r()),onKeydown:a,"data-index":"today-btn"},{prefix:ge(()=>[fe(U(lt),{src:"CalendarDay"})]),_:1})),[[c,"Today"]])]),fe(U(mt),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:o,"data-index":"cancel-btn"},{default:ge(()=>[nt(wt(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),fe(U(mt),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:i},{default:ge(()=>[nt(wt(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),Qme=_t(rt({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,s=Eo({month:new Date().getMonth()+1,year:new Date().getFullYear()}),o=Y(()=>{if(n.minDate){const h=s.month===1?12:s.month-1,f=s.month===1?s.year-1:s.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),i=Y(()=>{if(n.maxDate){const h=s.month===12?1:s.month+1,f=s.month===12?s.year+1:s.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),r=t,a=()=>{o.value||(n.mode==="month"?s.month=s.month===0?11:s.month-1:n.mode==="year"&&(s.year-=1)),r("prev",{month:s.month,year:s.year})},l=()=>{i.value||(n.mode==="month"?s.month=s.month===11?0:s.month+1:n.mode==="year"&&(s.year+=1)),r("next",{month:s.month,year:s.year})},u=()=>{r("toggle-months")},c=()=>{r("toggle-years")},d=Y(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,C)=>p.format(new Date(Date.UTC(2020,C,1))))});return(h,f)=>(j(),ue("div",{class:Q(h.$style["cal-nav-bar"])},[e.mode!="year"?(j(),qe(U(mt),{key:0,variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:o.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:zn(Pt(a,["prevent","stop"]),["enter"])},{default:ge(({hovered:p})=>[fe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!0),_e("div",{class:Q([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Je("",!0):(j(),qe(U(mt),{key:0,"data-index":"month-btn",variant:"secondary",onClick:u},{default:ge(()=>[nt(wt(d.value[n.month-1]),1)]),_:1})),fe(U(mt),{variant:"secondary",onClick:c,"data-index":"year-btn"},{default:ge(()=>[nt(wt(n.year),1)]),_:1})],2),e.mode!="year"?(j(),qe(U(mt),{key:1,"data-index":"next-btn",variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:i.value,label:"",onClick:l,onKeydownCapture:zn(Pt(l,["prevent","stop"]),["enter"])},{default:ge(({hovered:p})=>[fe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_beyjg_1","cal-nav-bar":"_cal-nav-bar_beyjg_12","cal-nav-btn":"_cal-nav-btn_beyjg_19",prev:"_prev_beyjg_32","year-grid-header":"_year-grid-header_beyjg_36","cal-nav-center":"_cal-nav-center_beyjg_45",single:"_single_beyjg_52","cal-nav-label":"_cal-nav-label_beyjg_56","year-grid":"_year-grid_beyjg_36",months:"_months_beyjg_78","month-cell":"_month-cell_beyjg_85","year-cell":"_year-cell_beyjg_86","pg-btn":"_pg-btn_beyjg_108","year-grid-body":"_year-grid-body_beyjg_121",selected:"_selected_beyjg_125","days-slot":"_days-slot_beyjg_131","range-label":"_range-label_beyjg_135"}}]]),eve=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const tve={class:"wrapper-suffix"},nve=_t(rt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=Jt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=V(i.modelValue),a=n,l=Y(()=>f.value.find(D=>D.id===r.value)||null),u=D=>{r.value=D.id,a("update:modelValue",D.id)},c=Y(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const D=f.value.find(k=>k.id===r.value),F=String((D==null?void 0:D.color)||"white");return{backgroundColor:F,border:Lg(F,"white")?"1px solid #ccc":"1px solid #fff"}}),d=V(null),h=()=>{var D;(D=d.value)==null||D.focus()},f=V([]),p=V(!1),g=V(!1),v=V(null),C=V(o.INITIAL_PAGE),S=V(!0),b=V(0),w=V(""),_=Y(()=>!!(i.id&&i.workspaceId)),R=D=>{const F=f.value.find(k=>k.id===D.value);F&&u(F)},T=D=>({label:D.name,value:D.id,selected:r.value===D.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:D,id:D.id,color:D.color}),I=async(D=o.INITIAL_PAGE,F="",k=!1)=>{var O;if(!_.value){console.error("Missing required props",i);return}k?g.value=!0:p.value=!0,v.value=null;try{const B={workspaceId:String(i.workspaceId),itemIds:i.id,page:D,perPage:o.PER_PAGE,name_like:F.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const Z=await i.getStatusFunc(B);if(!Z){k||(f.value=[]),S.value=!1;return}const J=Z.data.map(T);f.value=k?[...f.value,...J]:J,b.value=((O=Z.meta)==null?void 0:O.total)??Z.data.length,S.value=f.value.length<b.value,C.value=D}catch(B){console.error("Error fetching statuses:",B),v.value="Failed to load statuses",k||(f.value=[]),S.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},x=async()=>{!S.value||g.value||await I(C.value+1,w.value,!0)};tt([()=>i.id,()=>i.workspaceId],()=>{I()},{deep:!0,immediate:!0});const P=async D=>{w.value=D,C.value=o.INITIAL_PAGE,await I(o.INITIAL_PAGE,D,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(D,F)=>(j(),qe(Bme,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:ge(({open:k})=>[fe(Cs,{actived:k,class:Q(D.$style["status-wrapper"])},{suffix:ge(()=>[_e("div",tve,[fe(lt,{src:"ChevronUp",source:"remote",class:Q([[D.$style["dropdown-icon"]],{[D.$style["dropdown-icon-show"]]:!k}])},null,8,["class"])])]),default:ge(()=>{var O;return[_e("div",{class:Q(D.$style.status)},[_e("div",{class:Q(D.$style["color-indicator"]),style:dn(c.value)},null,6),Ke((j(),ue("span",{style:{"max-width":"400px"},class:Q({[D.$style.empty]:!l.value})},[nt(wt(l.value?l.value.label:"Select status"),1)],2)),[[U(s),{content:((O=l.value)==null?void 0:O.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:ge(({closeDropdown:k})=>{var O;return[fe(Jr,{ref_key:"popupRef",ref:d,"selected-id":(O=l.value)==null?void 0:O.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":S.value,error:v.value,onSearch:P,onSelect:B=>{R(B),k()},onLoadMore:x,onCancel:F[0]||(F[0]=B=>a("cancel")),style:{width:"500px"}},null,8,["selected-id","options","loading","loading-more","has-more","error","onSelect"])]}),_:1}))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_1hlgx_1",status:"_status_1hlgx_1","color-indicator":"_color-indicator_1hlgx_12",empty:"_empty_1hlgx_21","dropdown-icon":"_dropdown-icon_1hlgx_25","dropdown-icon-show":"_dropdown-icon-show_1hlgx_30",options:"_options_1hlgx_34"}}]]),qV=e=>({updateCellData:({rowId:n,field:s,value:o})=>{if(!e)return;const i=e.getRowNode(n);i&&i.setDataValue(s,o),e.refreshCells({rowNodes:i?[i]:[],columns:[s],force:!0})}}),sve={key:2},ove=_t(rt({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,s=V(n.value),o=V(!0),i=V(""),r=()=>{var P,D,F;const b=(P=c.value)==null?void 0:P.restricted_type.trim(),w=((F=(D=c.value)==null?void 0:D.restricted_value)==null?void 0:F.split(",").map(Number))||[],[_,R]=w,I={range:`Enter a value between ${_} and ${R}`,not:`These values are not allowed: ${w.join(", ")}`,exact:"Value is not allowed"}[b];return o.value?"":I},a=b=>{if(c.value){if(b===null||b===""){o.value=!0;return}if(u.value!=="number"){o.value=!0;return}o.value=dm(c.value,Number(b)),i.value=r()}};Y(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),u=Y(()=>OF(c.value)),c=Y(()=>{var w,_;return((_=(w=n.params)==null?void 0:w.colDef)==null?void 0:_.context)||null}),{apiServices:d}=ts(!0,n),{updateCellData:h}=qV((S=n.params)==null?void 0:S.api),f=V(!1),p=Ki(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},C=async b=>{var _,R;if(g(),f.value=!0,s.value=b||null,b===n.value){f.value=!1;return}const w={itemIds:[String(p.value)],metricId:((_=c.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?w.clear=1:w.value=b,h({rowId:String(p.value),field:`metric_${w.metricId}`,value:void 0});try{const T=await((R=d.value)==null?void 0:R.bulkUpdateMetric(w));(T==null?void 0:T.message)=="Done"?h({rowId:String(p.value),field:`metric_${w.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${w.metricId}`,value:n.value}),console.error("Failed to update metric value:",T),s.value=n.value)}catch(T){console.error("Error during bulk metric update:",T),h({rowId:String(p.value),field:`metric_${w.metricId}`,value:n.value})}finally{f.value=!1}};return(b,w)=>(j(),ue("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(j(),qe(KA,{key:0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=_=>s.value=_),onChange:C,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(j(),qe(qA,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=_=>s.value=_),style:{width:"100%"},onHandleChange:C,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(j(),ue("div",sve,"Metric type:"+wt(u.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),ive=_t(rt({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."},s=Y(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),o=Y(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),i=V(!1);return nn(()=>{i.value=!0}),(r,a)=>(j(),ue("div",{class:Q(r.$style["no-data-item-table"])},[_e("div",{class:Q(r.$style.visual)},[i.value?(j(),qe(Pm,{key:0,source:"remote",src:s.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):Je("",!0)],2),_e("div",{class:Q(r.$style.description)},wt(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),YV=Ql("sortStore",()=>{const e=V({}),t={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},n={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=Y(()=>{const a=e.value;return Object.values(a).filter(u=>u.sort!=="none"&&!!u.sort).map(u=>{let c;switch(u.colId){case"dateRange":c=n[u.sort];break;default:if(u.colId.includes("metric")){const[d,h]=u.colId.split("_");c={column:d,direction:u.sort,type:h}}else c={column:t[u.colId]||u.colId,direction:u.sort};break}return c})}),o=(a,l)=>{e.value={[a]:{colId:a,sort:l}}},i=()=>{e.value={}},r=V(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:o,clearSorting:i,isSortingRunning:r}}),Ru=rt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=YV(),{sorts:s}=Qs(n),o=Y(()=>{var l,u;return((u=(l=t.params)==null?void 0:l.column)==null?void 0:u.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=Y(()=>t.params.headerType||void 0),a=V("none");return tt(()=>s.value,Di(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},rr),{deep:!0,immediate:!0}),(l,u)=>o.value?(j(),qe(vge,Xt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),onSortChanged:i}),null,16,["header-type","modelValue"])):Je("",!0)}});function rve(){const e=Eo({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const o=e.name.trim();e.status,o.length===0?e.error="Name cannot be empty":o.length>25?e.error="Name cannot exceed 25 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},s=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:s,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const my=Ql("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),ave=["innerHTML"],lve=20,uve=_t(rt({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,{triggerRef:o,popupRef:i,isVisible:r,show:a,hide:l}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=V(null),d=()=>{P.value=[],he.value=!1},h=Y(()=>r.value),f=Y(()=>{var z;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((z=P.value)==null?void 0:z.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=ws(f),g=Jt,v=n,C=Y(()=>{var z;return Math.max(0,(((z=P.value)==null?void 0:z.length)||0)-s.maxVisible)}),S=Y(()=>{var z;return C.value<=0?"":((z=P.value)==null?void 0:z.slice(s.maxVisible).map(pe=>pe.name).join(", "))||""}),b=V(!1),w=V(!1),_=V(null),R=V(1),T=V(!0),I=V(0),x=V(""),P=V([]),D=Y(()=>{var z;return((z=P.value)==null?void 0:z.map(pe=>pe.id))||[]}),{assigneeList:F,mergedOptions:k}=mm({...s,value:[]}),{apiServices:O}=ts(!1,s),B=_n("entityId"),Z=async(z=1,pe="",ie=!1)=>{var G,q,ce,ke,Fe;if(!O.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(ie?w.value=!0:b.value=!0,_.value=null,!((G=O.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const be=En.getInstance().getItem("ws.code");try{const Le=await((q=O.value)==null?void 0:q.getAssignableAssignees(String(be),{entity_ids:(B==null?void 0:B.value)||"",page:z,per_page:lve,display_name_like:pe})),ye=((ce=Ec(Le.data))==null?void 0:ce.map(gm))??[];F.value=ie?uc(F.value,ye,"id"):ye,I.value=Le.meta.total,T.value=(((ke=Le==null?void 0:Le.meta)==null?void 0:ke.current_page)||0)<(((Fe=Le==null?void 0:Le.meta)==null?void 0:Fe.last_page)||0),R.value=z}catch(Le){console.error("Error fetching assignable users:",Le),_.value="Failed to load assignable users"}finally{b.value=!1,w.value=!1}},J=z=>{var pe,ie,be;if((pe=P.value)!=null&&pe.some(G=>G.id===z.data.id)){P.value=(ie=P.value)==null?void 0:ie.filter(G=>G.id!==z.data.id);return}P.value=[...P.value||[],z.data],(be=c.value)==null||be.focus()},ee=()=>{P.value=[]},X=()=>{!w.value&&T.value&&Z(R.value+1,x.value,!0)},ve=Di(async z=>{x.value=z,await Z(1,z,!1)},rr);tt(()=>r.value,z=>{var pe;z?(Z(1,x.value,!1),(pe=c.value)==null||pe.focus(),v("show")):v("hide")});const ne=Y(()=>{var z;return((z=P.value)==null?void 0:z.slice(0,3))||[]}),L=Y(()=>ne.value.map(z=>({id:z.id,name:z.name,initial:z.initial,avatarId:z.id,profile_image:z.profile_image,color:z.color,size:24,user:z}))),H=my(),{user:te}=Qs(H),he=V(!1);t({getData:()=>P.value,clear:d,setData:z=>{P.value=z},focus:()=>{a(),Ct(()=>{var z;(z=c.value)==null||z.focus()})},hide:()=>{l()}}),tt([P,he],()=>{v("updated",P.value)},{deep:!0});const me=z=>{var pe;P.value=(pe=P.value)==null?void 0:pe.filter(ie=>ie.id!==z)},re=z=>{var ie;const pe=En.getInstance().getItem("ws.code");return((ie=O.value)==null?void 0:ie.getUserInformation(pe,z))||Promise.resolve(null)},oe=V();return(z,pe)=>(j(),ue("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:oe},[fe(Cs,Xt(U(p),{style:{"--icon-size":"18px"}}),{prefix:ge(()=>[L.value.length==0?(j(),ue("div",{key:0,class:Q([z.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(u,["stop","prevent"])},[fe(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Je("",!0)]),default:ge(()=>[_e("div",{class:Q([z.$style["assignee-row"],z.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[_e("div",{style:{flex:1},class:Q([z.$style["assignee-row"]])},[(j(!0),ue(xt,null,xn(L.value,ie=>(j(),qe(Zf,{onClear:be=>me(ie.id),key:ie.user.id,"disable-remove":!1},{default:ge(()=>[fe(Oc,{user:ie.user,apiUpdateFunction:re,appendTo:oe.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),C.value>0?Ke((j(),ue("div",{key:0,class:Q(z.$style["extra-avatars"])},[nt(" +"+wt(C.value),1)],2)),[[U(g),S.value]]):Je("",!0)],2)],2)]),_:1},16),_e("div",{ref_key:"popupRef",ref:i},[fe(Jr,Xt({"selected-id":D.value},{...s},{options:U(k),loading:b.value,"loading-more":w.value,"has-more":T.value,ref_key:"searchListRef",ref:c,onTab:pe[0]||(pe[0]=ie=>v("tab",ie)),onSelect:pe[1]||(pe[1]=ie=>{J(ie),v("start-update")}),onSearch:U(ve),onClose:pe[2]||(pe[2]=()=>v("close")),onLoadMore:X}),{"extra-item":ge(()=>[fe(rS,{onClick:ee,label:"Unassign",borderLeft:!0},{icon:ge(()=>[fe(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:ge(({item:ie,selectedIndex:be,isSelected:G,handleSelect:q,handleItemHover:ce,getHighlightedLabel:ke,query:Fe,idx:Le})=>[fe(eu,Xt(ie,{hover:Le===be,selected:G(ie),type:ie.type,onClick:Pt(ye=>q(ie,ye),["stop","prevent"]),onMouseover:ye=>ce(Le),class:z.$style["item-assignee"]}),{prefix:ge(()=>[fe(Oc,{user:ie.data,apiUpdateFunction:re,appendTo:U(i)},null,8,["user","appendTo"])]),label:ge(({})=>[Fe?Ke((j(),ue("span",{key:0,class:Q([z.$style["item-label"],z.$style.match]),style:{flex:"1"},innerHTML:ke(ie.label)},null,10,ave)),[[U(g),{content:ie.label}]]):Ke((j(),ue("span",{key:1,class:Q(z.$style["item-label"]),style:{flex:"1"}},[nt(wt(ie.label),1)],2)),[[U(g),{content:ie.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),cve={key:0},dve={key:1},hve={key:0},fve={key:1},pve={key:0,class:"wrapper-suffix"},gve={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},mve=_t(rt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=Jt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=V([null,null]),d=w=>{const _=cm();return w?bt.fromJSDate(w,{zone:_}).toFormat("MMM dd"):""},h=Y(()=>r.value),f=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=ws(f),g=V(!1),v=w=>{S("tab",w)},C=w=>{"start"in w&&w.start!==void 0&&(c.value[0]=w.start),"end"in w&&w.end!==void 0&&(c.value[1]=w.end)};t({getData:()=>c.value,clear:u,setData:w=>{c.value=w},focus:()=>{l(),Ct(()=>{var w;(w=b.value)==null||w.focus()})},hide:()=>{a()}});const S=n;tt(()=>c.value,w=>{S("updated",w)},{deep:!0});const b=V(null);return tt(()=>r.value,w=>{w?(Ct(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(w,_)=>(j(),ue(xt,null,[fe(Cs,Xt({ref_key:"triggerRef",ref:o},U(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ge(({focused:R})=>[_e("div",{class:Q(w.$style["date-time"])},[_e("div",{class:Q(w.$style.date)},[c.value[0]==null&&(R||U(r))?(j(),ue("span",cve,"MMMDD")):(j(),ue("span",dve,wt(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||R||U(r)?(j(),ue("div",{key:0,class:Q(w.$style.separator)}," → ",2)):Je("",!0),_e("div",{class:Q(w.$style.date)},[c.value[1]==null&&(R||U(r))?(j(),ue("span",hve,"MMMDD")):(j(),ue("span",fve,wt(d(c.value[1])),1))],2)],2)]),suffix:ge(({hovered:R,focused:T})=>[(c.value[0]!==null||c.value[1]!==null)&&(R||T||U(r))?(j(),ue("div",pve,[Ke((j(),qe(mt,{onClick:Pt(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ge(()=>[fe(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[U(s),"Clear"]])])):Je("",!0)]),prefix:ge(()=>[c.value[0]===null&&c.value[1]===null?(j(),ue("div",gve,[fe(lt,{src:"Calendar",color:"#A6A6A6"})])):Je("",!0)]),_:1},16),_e("div",{ref_key:"popupRef",ref:i},[U(r)?(j(),qe(Am,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:C,ref_key:"calendarRef",ref:b,onClosed:U(a),onStartUpdate:_[0]||(_[0]=R=>g.value=!0),onFinishUpdate:_[1]||(_[1]=R=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Je("",!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"}}]]),vve=_t(rt({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,o={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,show:l,hide:u}=Fs({toggleOnClick:!0,appendTo:"parent"}),c=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(o.INITIAL_PAGE),v=V(!0),C=V(0),S=V(""),b=n,w=Y(()=>a.value),_=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:i,active:w,bordered:!0})),R=V(null),{argsMain:T}=ws(_),I=Y(()=>c.value?d.value.filter(ne=>ne.id===c.value):[]),x=Y(()=>!c.value||I.value.length===0?"":I.value[0].label),P=Y(()=>c.value?[c.value]:[]),D=Y(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const ne=I.value[0],L=String((ne==null?void 0:ne.color)||"white");return{backgroundColor:L,border:Lg(L,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),F=ne=>({label:ne.name,value:ne.id,selected:c.value===ne.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:ne,id:ne.id,color:ne.color}),{apiServices:k}=ts(!1,s),O=async(ne=o.INITIAL_PAGE,L="",H=!1)=>{var te,he;H?f.value=!0:h.value=!0,p.value=null;try{const me=En.getInstance().getItem("ws.code"),re=await((te=k.value)==null?void 0:te.getAssignableStatuses(me,{entity_id:s.entityId||"",name_like:L,page:ne,per_page:o.PER_PAGE}));if(!re){H||(d.value=[]),v.value=!1;return}const oe=re.data.map(F);d.value=H?[...d.value,...oe]:oe,C.value=((he=re.meta)==null?void 0:he.total)??re.data.length,v.value=d.value.length<C.value,g.value=ne}catch(me){console.error("Error fetching statuses:",me),p.value="Failed to load statuses",H||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},B=(ne,L)=>{var te;L.stopImmediatePropagation(),L.preventDefault(),L.stopPropagation();const H=ne.id;c.value=H,(te=R.value)==null||te.focus(),b("update:modelValue",c.value),u()},Z=async()=>{!v.value||f.value||await O(g.value+1,S.value,!0)},J=async ne=>{S.value=ne,g.value=o.INITIAL_PAGE,await O(o.INITIAL_PAGE,ne,!1)},ee=()=>{c.value=null,b("update:modelValue",null)},X=()=>{l(),Ct(()=>{var ne;(ne=R.value)==null||ne.focus()})};return tt(()=>a.value,ne=>{var L;ne?(O(1,S.value,!1),(L=R.value)==null||L.focus(),b("show")):b("hide")}),tt(()=>c.value,ne=>{b("updated",ne)}),t({focus:X,clear:ee,getData:()=>c.value,setData:ne=>{c.value=ne},hide:u,autoFillDefault:async()=>{S.value="",await O(1,S.value,!1),d.value.length>0&&(c.value=d.value[0].id,b("update:modelValue",c.value))}}),(ne,L)=>{const H=_o("tooltip");return j(),ue(xt,null,[fe(Cs,Xt({ref_key:"triggerRef",ref:i},U(T),{style:{"--icon-size":"18px"}}),{default:ge(()=>[_e("div",{class:Q(ne.$style.status)},[_e("div",{class:Q(ne.$style["color-indicator"]),style:dn(D.value)},null,6),Ke((j(),ue("span",{class:Q({[ne.$style.empty]:I.value.length===0,[ne.$style["status-text"]]:!0})},[nt(wt(x.value),1)],2)),[[H,{content:x.value}]])],2)]),_:1},16),_e("div",{ref_key:"popupRef",ref:r},[fe(Jr,{style:{width:"200px"},ref_key:"searchListRef",ref:R,"selected-id":P.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:J,onSelect:B,onLoadMore:Z,onCancel:L[0]||(L[0]=te=>b("cancel")),onTab:L[1]||(L[1]=te=>b("tab",te)),onClose:L[2]||(L[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-6fccb209"]]),yve=_t(rt({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const s=["name","assignees","status","date","cancel","create-keep","create"],o=Jt,i=xH("target"),r=_n("workspaceId"),a=_n("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=rve(),{apiServices:p}=ts(!1,u),{openSceneHub:g}=tf(),v=V(!1),C=V(!1),S=V(null),b=V({assignees:!1,status:!1,date:!1}),w={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},_=w.name,R=w.assignees,T=w.status,I=w.date,x=w.cancel,P=w["create-keep"],D=w.create,F=V(new Map),k=Y(()=>!!c.error||!c.name.trim()||C.value),O=(ye,M)=>{ye&&F.value.set(M,ye.$el||ye)},B=(ye,M)=>{if(ye==="date"){const[$,ae]=Array.isArray(M)?M:[void 0,void 0];c.start_date=$,c.due_date=ae}else c[ye]=M},Z=()=>{c.isCreating=!0,S.value="name"},J=()=>{c.isCreating=!1,h()},ee=_n("switchInstance"),{addNotification:X}=Qf(),ve=ye=>{l("focus-on-id",ye)},ne=(ye,M,$)=>{const ae=x7(void 0,"created");X({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${ae}</b>
216
216
  <span>${M} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:$,name:M}),ve(String(ye))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Ge=>{if(Ge.ctrlKey||Ge.metaKey){const we=co({type:"scene_hub",config:{ws_code:r,baseDomain:En.getInstance().getItem("BASE_URL")||"",scene_id:String(ye)}}).url;window.open(we,"_blank");return}else ee("scene_hub",{id:String(ye)},{showLoading:!1})}}],type:"interactive"})},L=ye=>{ye&&Ct(()=>{var $;const M=($=w[ye])==null?void 0:$.value;M&&(typeof M.focus=="function"?M.focus():M.$el&&typeof M.$el.focus=="function"&&M.$el.focus())})},H=ye=>{var M;(M=i.value)==null||M.focus()},te=ye=>{const M=$=>{var ae;return(ae=$==null?void 0:$.hide)==null?void 0:ae.call($)};ye!=="assignees"&&M(R.value),ye!=="status"&&M(T.value),ye!=="date"&&M(I.value)},he=(ye,M)=>{M instanceof KeyboardEvent&&M.key!=="Tab"&&M.preventDefault();const $=S.value?s.indexOf(S.value):-1;if($===-1){L("name");return}let Ge=($+(ye==="next"?1:-1)+s.length)%s.length,we=s[Ge];(we==="create"||we==="create-keep")&&k.value&&(Ge=0,we=s[0]),te(we),L(we)},me=ye=>{b.value[ye]=!0,S.value=ye},re=ye=>{b.value[ye]=!1,H()},oe=ye=>{b.value[ye]||(S.value=null)},z=ye=>{ye.target===i.value&&L("name")},pe=ye=>{var M,$,ae;if(ye.key==="Enter"){if(!S.value)return;switch(ye.preventDefault(),ye.stopPropagation(),S.value){case"create":k.value||ce("clear");break;case"create-keep":k.value||ce("keep");break;case"cancel":f();break;case"assignees":(M=R.value)==null||M.focus();break;case"status":($=T.value)==null||$.focus();break;case"date":(ae=I.value)==null||ae.focus();break}return}if(ye.key==="Tab"){ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation(),S.value!=="name"&&ie(ye);return}if(ye.key==="Escape"){S.value=null,J();return}},ie=ye=>{ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation();const M=ye.shiftKey?"prev":"next";he(M,ye)},be=()=>{var ye;return(ye=R.value)==null?void 0:ye.focus()},G=()=>{var ye;return(ye=T.value)==null?void 0:ye.focus()},q=()=>{var ye;return(ye=I.value)==null?void 0:ye.focus()},ce=async(ye="clear")=>{Ct(async()=>{var $,ae,Ge,we,ze,Ue,Ee,Ve,pt,At,Ut;if(k.value||v.value||C.value)return;C.value=!0,v.value=!0;const M={name:c.name,template_flow_status_id:c.status??void 0,ws_user_role_ids:($=c.assignees)==null?void 0:$.map(Qt=>Qt.id),start_date:c.start_date?pm(c.start_date):void 0,due_date:c.due_date?pm(c.due_date):void 0};if(!((ae=p.value)!=null&&ae.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const Qt=await p.value.addNewItem(r,a,M),zt=c.name;if(ne(Qt.id,Qt.name,Qt.code),!Qt.id)throw new Error("Invalid response from server: missing scene ID");switch(C.value=!1,v.value=!1,ye){case"close":h(),(Ge=R.value)==null||Ge.setData([]),(we=T.value)==null||we.setData(null),(ze=I.value)==null||ze.setData([null,null]),f(),J();break;case"close-open":h(),(Ue=R.value)==null||Ue.setData([]),(Ee=T.value)==null||Ee.setData(null),(Ve=I.value)==null||Ve.setData([null,null]),f(),J(),g(Qt.id);break;case"clear":l("create-new-item",zt),h(),(pt=R.value)==null||pt.setData([]),(At=T.value)==null||At.setData(null),(Ut=I.value)==null||Ut.setData([null,null]),L("name");break;case"keep":l("create-new-item",zt),c.name="",c.error="",L("name");break}}catch(Qt){console.error("Error creating scene:",Qt),ye=="close"&&(f(),J())}finally{v.value=!1,C.value=!1}})},ke=(ye,M)=>{k.value||(M.metaKey||M.ctrlKey?ce("close-open"):M.shiftKey?ce("keep"):ce("clear"))},Fe=(ye=!1)=>{c.isCreating&&(!k.value&&!c.error?ce(ye?"close":"clear"):J())},Le=()=>{f(),c.name="",Ct(()=>{var ye;(ye=_.value)==null||ye.setValue(c.name)})};return sS(i,ye=>{const M=ye.target.closest(".notification-center"),$=ye.target.closest("#people-insight-container");if(M||$)return!1;Fe(!0)}),tt(()=>c.isCreating,ye=>{ye&&L("name")}),t({show:Z,hide:J}),(ye,M)=>Ke((j(),ue("div",{class:Q(ye.$style.newRow),ref_key:"target",ref:i,onKeydown:pe,onClick:z,tabindex:"-1"},[_e("div",{ref:$=>O($,"name"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="name"})},[fe(oS,{ref_key:"nameInputRef",ref:_,disabled:v.value||C.value,modelValue:U(c).name,"onUpdate:modelValue":M[0]||(M[0]=$=>U(c).name=$),onChange:U(d),onEnter:ke,onCancel:Le,onTab:M[1]||(M[1]=($,ae)=>ie(ae)),onFocus:M[2]||(M[2]=$=>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),_e("div",{ref:$=>O($,"assignees"),onEnter:Pt(be,["prevent","stop"]),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="assignees"})},[fe(uve,{ref_key:"assigneeRef",ref:R,onUpdated:M[3]||(M[3]=$=>B("assignees",$)),onTab:M[4]||(M[4]=$=>ie($)),onEnter:be,onFocus:M[5]||(M[5]=$=>S.value="assignees"),onBlur:M[6]||(M[6]=$=>oe("assignees")),onShow:M[7]||(M[7]=$=>me("assignees")),onHide:M[8]||(M[8]=$=>re("assignees"))},null,512)],34),_e("div",{ref:$=>O($,"status"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="status"})},[fe(vve,{ref_key:"statusRef",ref:T,"entity-id":U(a),onUpdated:M[9]||(M[9]=$=>B("status",$)),onTab:M[10]||(M[10]=$=>ie($)),onEnter:G,onFocus:M[11]||(M[11]=$=>S.value="status"),onBlur:M[12]||(M[12]=$=>oe("status")),onShow:M[13]||(M[13]=$=>me("status")),onHide:M[14]||(M[14]=$=>re("status"))},null,8,["entity-id"])],2),_e("div",{ref:$=>O($,"date"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="date"})},[fe(mve,{ref_key:"dateRef",ref:I,onUpdated:M[15]||(M[15]=$=>B("date",$)),onTab:M[16]||(M[16]=$=>ie($)),onEnter:q,onFocus:M[17]||(M[17]=$=>S.value="date"),onBlur:M[18]||(M[18]=$=>oe("date")),onShow:M[19]||(M[19]=$=>me("date")),onHide:M[20]||(M[20]=$=>re("date"))},null,512)],2),_e("div",{class:Q(ye.$style["field-actions"])},[_e("div",{ref:$=>O($,"cancel"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="cancel",[ye.$style["field-button"]]:!0})},[fe(mt,{ref_key:"cancelRef",ref:x,variant:["secondary"],onClick:U(f),onKeydown:[zn(U(f),["enter"]),M[22]||(M[22]=zn($=>ie($),["tab"]))],onFocus:M[21]||(M[21]=$=>S.value="cancel"),tabindex:"0"},{default:ge(()=>[...M[31]||(M[31]=[nt(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),Ke((j(),ue("div",{ref:$=>O($,"create-keep"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style["field-button"]]:!0,[ye.$style.active]:S.value==="create-keep"})},[fe(mt,{ref_key:"createKeepRef",ref:P,onClick:M[23]||(M[23]=()=>ce("keep")),onKeydown:[M[24]||(M[24]=zn($=>!k.value&&ce("keep"),["enter"])),M[26]||(M[26]=zn($=>ie($),["tab"]))],onFocus:M[25]||(M[25]=$=>S.value="create-keep"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0",style:dn([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:ge(()=>[...M[32]||(M[32]=[nt(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[U(o),k.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),Ke((j(),ue("div",{ref:$=>O($,"create"),class:Q({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="create",[ye.$style["field-button"]]:!0})},[fe(mt,{ref_key:"createRef",ref:D,onClick:M[27]||(M[27]=()=>ce("clear")),onKeydown:[M[28]||(M[28]=zn($=>!k.value&&ce("clear"),["enter"])),M[30]||(M[30]=zn($=>ie($),["tab"]))],onFocus:M[29]||(M[29]=$=>S.value="create"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:ge(()=>[...M[33]||(M[33]=[nt(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[U(o),k.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[To,U(c).isCreating]])}}),[["__cssModules",{$style:{newRow:"_newRow_mf32t_1","field-actions":"_field-actions_mf32t_14","field-wrapper":"_field-wrapper_mf32t_43",active:"_active_mf32t_49","field-button":"_field-button_mf32t_52","warning-text":"_warning-text_mf32t_55","has-error":"_has-error_mf32t_60"}}]]),wve=["innerHTML"],Cve=["accept"],ZV=_t(rt({__name:"FileUploader",props:{modelValue:{},acceptTypes:{default:()=>["xlsx","xls","csv"]}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=V(null),o=x=>`<svg xmlns="http://www.w3.org/2000/svg" width="49" height="49" viewBox="0 0 49 49" fill="none">
217
217
  <g clip-path="url(#clip0)">
218
218
  <path d="M9.86719 3.56641C9.86719 2.05448 11.1053 0.816406 12.6172 0.816406H33.5136L45.3672 12.67V45.5664C45.3672 47.0783 44.1291 48.3164 42.6172 48.3164H12.6172C11.1053 48.3164 9.86719 47.0783 9.86719 45.5664V3.56641Z" stroke="#232323" stroke-width="0.5"/>
@@ -234,13 +234,13 @@ If you are trying to annotate ${s} with application data, use the '${s}.context'
234
234
  * message-compiler v9.14.5
235
235
  * (c) 2025 kazuya kawaguchi
236
236
  * Released under the MIT License.
237
- */function tye(e,t,n){return{line:e,column:t,offset:n}}function by(e,t,n){return{start:e,end:t}}const nye=/\{([0-9a-zA-Z]+)\}/g;function r2(e,...t){return t.length===1&&sye(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),e.replace(nye,(n,s)=>t.hasOwnProperty(s)?t[s]:"")}const a2=Object.assign,l2=e=>typeof e=="string",sye=e=>e!==null&&typeof e=="object";function u2(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Sy={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},oye={[Sy.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function iye(e,t,...n){const s=r2(oye[e],...n||[]),o={message:String(s),code:e};return t&&(o.location=t),o}const Lt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},rye={[Lt.EXPECTED_TOKEN]:"Expected token: '{0}'",[Lt.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[Lt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[Lt.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[Lt.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[Lt.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[Lt.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[Lt.EMPTY_PLACEHOLDER]:"Empty placeholder",[Lt.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[Lt.INVALID_LINKED_FORMAT]:"Invalid linked format",[Lt.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[Lt.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[Lt.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[Lt.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[Lt.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[Lt.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function _d(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=r2((o||rye)[e]||"",...i||[]),a=new SyntaxError(String(r));return a.code=e,t&&(a.location=t),a.domain=s,a}function aye(e){throw e}const lye=/<\/?[\w\s="/.':;#-\/]+>/,uye=e=>lye.test(e),ga=" ",cye="\r",no=`
238
- `,dye="\u2028",hye="\u2029";function fye(e){const t=e;let n=0,s=1,o=1,i=0;const r=T=>t[T]===cye&&t[T+1]===no,a=T=>t[T]===no,l=T=>t[T]===hye,u=T=>t[T]===dye,c=T=>r(T)||a(T)||l(T)||u(T),d=()=>n,h=()=>s,f=()=>o,p=()=>i,g=T=>r(T)||l(T)||u(T)?no:t[T],v=()=>g(n),C=()=>g(n+i);function S(){return i=0,c(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function b(){return r(n+i)&&i++,i++,t[n+i]}function w(){n=0,s=1,o=1,i=0}function _(T=0){i=T}function R(){const T=n+i;for(;T!==n;)S();i=0}return{index:d,line:h,column:f,peekOffset:p,charAt:g,currentChar:v,currentPeek:C,next:S,peek:b,reset:w,resetPeek:_,skipToPeek:R}}const dl=void 0,pye=".",c2="'",gye="tokenizer";function mye(e,t={}){const n=t.location!==!1,s=fye(e),o=()=>s.index(),i=()=>tye(s.line(),s.column(),s.index()),r=i(),a=o(),l={currentType:14,offset:a,startLoc:r,endLoc:r,lastType:14,lastOffset:a,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=t;function d(M,$,ae,...Ge){const we=u();if($.column+=ae,$.offset+=ae,c){const ze=n?by(we.startLoc,$):null,Ue=_d(M,ze,{domain:gye,args:Ge});c(Ue)}}function h(M,$,ae){M.endLoc=i(),M.currentType=$;const Ge={type:$};return n&&(Ge.loc=by(M.startLoc,M.endLoc)),ae!=null&&(Ge.value=ae),Ge}const f=M=>h(M,14);function p(M,$){return M.currentChar()===$?(M.next(),$):(d(Lt.EXPECTED_TOKEN,i(),0,$),"")}function g(M){let $="";for(;M.currentPeek()===ga||M.currentPeek()===no;)$+=M.currentPeek(),M.peek();return $}function v(M){const $=g(M);return M.skipToPeek(),$}function C(M){if(M===dl)return!1;const $=M.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$===95}function S(M){if(M===dl)return!1;const $=M.charCodeAt(0);return $>=48&&$<=57}function b(M,$){const{currentType:ae}=$;if(ae!==2)return!1;g(M);const Ge=C(M.currentPeek());return M.resetPeek(),Ge}function w(M,$){const{currentType:ae}=$;if(ae!==2)return!1;g(M);const Ge=M.currentPeek()==="-"?M.peek():M.currentPeek(),we=S(Ge);return M.resetPeek(),we}function _(M,$){const{currentType:ae}=$;if(ae!==2)return!1;g(M);const Ge=M.currentPeek()===c2;return M.resetPeek(),Ge}function R(M,$){const{currentType:ae}=$;if(ae!==8)return!1;g(M);const Ge=M.currentPeek()===".";return M.resetPeek(),Ge}function T(M,$){const{currentType:ae}=$;if(ae!==9)return!1;g(M);const Ge=C(M.currentPeek());return M.resetPeek(),Ge}function I(M,$){const{currentType:ae}=$;if(!(ae===8||ae===12))return!1;g(M);const Ge=M.currentPeek()===":";return M.resetPeek(),Ge}function x(M,$){const{currentType:ae}=$;if(ae!==10)return!1;const Ge=()=>{const ze=M.currentPeek();return ze==="{"?C(M.peek()):ze==="@"||ze==="%"||ze==="|"||ze===":"||ze==="."||ze===ga||!ze?!1:ze===no?(M.peek(),Ge()):F(M,!1)},we=Ge();return M.resetPeek(),we}function P(M){g(M);const $=M.currentPeek()==="|";return M.resetPeek(),$}function D(M){const $=g(M),ae=M.currentPeek()==="%"&&M.peek()==="{";return M.resetPeek(),{isModulo:ae,hasSpace:$.length>0}}function F(M,$=!0){const ae=(we=!1,ze="",Ue=!1)=>{const Ee=M.currentPeek();return Ee==="{"?ze==="%"?!1:we:Ee==="@"||!Ee?ze==="%"?!0:we:Ee==="%"?(M.peek(),ae(we,"%",!0)):Ee==="|"?ze==="%"||Ue?!0:!(ze===ga||ze===no):Ee===ga?(M.peek(),ae(!0,ga,Ue)):Ee===no?(M.peek(),ae(!0,no,Ue)):!0},Ge=ae();return $&&M.resetPeek(),Ge}function k(M,$){const ae=M.currentChar();return ae===dl?dl:$(ae)?(M.next(),ae):null}function O(M){const $=M.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===95||$===36}function B(M){return k(M,O)}function Z(M){const $=M.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===95||$===36||$===45}function J(M){return k(M,Z)}function ee(M){const $=M.charCodeAt(0);return $>=48&&$<=57}function X(M){return k(M,ee)}function ve(M){const $=M.charCodeAt(0);return $>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102}function ne(M){return k(M,ve)}function L(M){let $="",ae="";for(;$=X(M);)ae+=$;return ae}function H(M){v(M);const $=M.currentChar();return $!=="%"&&d(Lt.EXPECTED_TOKEN,i(),0,$),M.next(),"%"}function te(M){let $="";for(;;){const ae=M.currentChar();if(ae==="{"||ae==="}"||ae==="@"||ae==="|"||!ae)break;if(ae==="%")if(F(M))$+=ae,M.next();else break;else if(ae===ga||ae===no)if(F(M))$+=ae,M.next();else{if(P(M))break;$+=ae,M.next()}else $+=ae,M.next()}return $}function he(M){v(M);let $="",ae="";for(;$=J(M);)ae+=$;return M.currentChar()===dl&&d(Lt.UNTERMINATED_CLOSING_BRACE,i(),0),ae}function me(M){v(M);let $="";return M.currentChar()==="-"?(M.next(),$+=`-${L(M)}`):$+=L(M),M.currentChar()===dl&&d(Lt.UNTERMINATED_CLOSING_BRACE,i(),0),$}function re(M){return M!==c2&&M!==no}function oe(M){v(M),p(M,"'");let $="",ae="";for(;$=k(M,re);)$==="\\"?ae+=z(M):ae+=$;const Ge=M.currentChar();return Ge===no||Ge===dl?(d(Lt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ge===no&&(M.next(),p(M,"'")),ae):(p(M,"'"),ae)}function z(M){const $=M.currentChar();switch($){case"\\":case"'":return M.next(),`\\${$}`;case"u":return pe(M,$,4);case"U":return pe(M,$,6);default:return d(Lt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,$),""}}function pe(M,$,ae){p(M,$);let Ge="";for(let we=0;we<ae;we++){const ze=ne(M);if(!ze){d(Lt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${$}${Ge}${M.currentChar()}`);break}Ge+=ze}return`\\${$}${Ge}`}function ie(M){return M!=="{"&&M!=="}"&&M!==ga&&M!==no}function be(M){v(M);let $="",ae="";for(;$=k(M,ie);)ae+=$;return ae}function G(M){let $="",ae="";for(;$=B(M);)ae+=$;return ae}function q(M){const $=ae=>{const Ge=M.currentChar();return Ge==="{"||Ge==="%"||Ge==="@"||Ge==="|"||Ge==="("||Ge===")"||!Ge||Ge===ga?ae:(ae+=Ge,M.next(),$(ae))};return $("")}function ce(M){v(M);const $=p(M,"|");return v(M),$}function ke(M,$){let ae=null;switch(M.currentChar()){case"{":return $.braceNest>=1&&d(Lt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),M.next(),ae=h($,2,"{"),v(M),$.braceNest++,ae;case"}":return $.braceNest>0&&$.currentType===2&&d(Lt.EMPTY_PLACEHOLDER,i(),0),M.next(),ae=h($,3,"}"),$.braceNest--,$.braceNest>0&&v(M),$.inLinked&&$.braceNest===0&&($.inLinked=!1),ae;case"@":return $.braceNest>0&&d(Lt.UNTERMINATED_CLOSING_BRACE,i(),0),ae=Fe(M,$)||f($),$.braceNest=0,ae;default:{let we=!0,ze=!0,Ue=!0;if(P(M))return $.braceNest>0&&d(Lt.UNTERMINATED_CLOSING_BRACE,i(),0),ae=h($,1,ce(M)),$.braceNest=0,$.inLinked=!1,ae;if($.braceNest>0&&($.currentType===5||$.currentType===6||$.currentType===7))return d(Lt.UNTERMINATED_CLOSING_BRACE,i(),0),$.braceNest=0,Le(M,$);if(we=b(M,$))return ae=h($,5,he(M)),v(M),ae;if(ze=w(M,$))return ae=h($,6,me(M)),v(M),ae;if(Ue=_(M,$))return ae=h($,7,oe(M)),v(M),ae;if(!we&&!ze&&!Ue)return ae=h($,13,be(M)),d(Lt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ae.value),v(M),ae;break}}return ae}function Fe(M,$){const{currentType:ae}=$;let Ge=null;const we=M.currentChar();switch((ae===8||ae===9||ae===12||ae===10)&&(we===no||we===ga)&&d(Lt.INVALID_LINKED_FORMAT,i(),0),we){case"@":return M.next(),Ge=h($,8,"@"),$.inLinked=!0,Ge;case".":return v(M),M.next(),h($,9,".");case":":return v(M),M.next(),h($,10,":");default:return P(M)?(Ge=h($,1,ce(M)),$.braceNest=0,$.inLinked=!1,Ge):R(M,$)||I(M,$)?(v(M),Fe(M,$)):T(M,$)?(v(M),h($,12,G(M))):x(M,$)?(v(M),we==="{"?ke(M,$)||Ge:h($,11,q(M))):(ae===8&&d(Lt.INVALID_LINKED_FORMAT,i(),0),$.braceNest=0,$.inLinked=!1,Le(M,$))}}function Le(M,$){let ae={type:14};if($.braceNest>0)return ke(M,$)||f($);if($.inLinked)return Fe(M,$)||f($);switch(M.currentChar()){case"{":return ke(M,$)||f($);case"}":return d(Lt.UNBALANCED_CLOSING_BRACE,i(),0),M.next(),h($,3,"}");case"@":return Fe(M,$)||f($);default:{if(P(M))return ae=h($,1,ce(M)),$.braceNest=0,$.inLinked=!1,ae;const{isModulo:we,hasSpace:ze}=D(M);if(we)return ze?h($,0,te(M)):h($,4,H(M));if(F(M))return h($,0,te(M));break}}return ae}function ye(){const{currentType:M,offset:$,startLoc:ae,endLoc:Ge}=l;return l.lastType=M,l.lastOffset=$,l.lastStartLoc=ae,l.lastEndLoc=Ge,l.offset=o(),l.startLoc=i(),s.currentChar()===dl?h(l,14):Le(s,l)}return{nextToken:ye,currentOffset:o,currentPosition:i,context:u}}const vye="parser",yye=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function wye(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function Cye(e={}){const t=e.location!==!1,{onError:n,onWarn:s}=e;function o(b,w,_,R,...T){const I=b.currentPosition();if(I.offset+=R,I.column+=R,n){const x=t?by(_,I):null,P=_d(w,x,{domain:vye,args:T});n(P)}}function i(b,w,_,R,...T){const I=b.currentPosition();if(I.offset+=R,I.column+=R,s){const x=t?by(_,I):null;s(iye(w,x,T))}}function r(b,w,_){const R={type:b};return t&&(R.start=w,R.end=w,R.loc={start:_,end:_}),R}function a(b,w,_,R){t&&(b.end=w,b.loc&&(b.loc.end=_))}function l(b,w){const _=b.context(),R=r(3,_.offset,_.startLoc);return R.value=w,a(R,b.currentOffset(),b.currentPosition()),R}function u(b,w){const _=b.context(),{lastOffset:R,lastStartLoc:T}=_,I=r(5,R,T);return I.index=parseInt(w,10),b.nextToken(),a(I,b.currentOffset(),b.currentPosition()),I}function c(b,w,_){const R=b.context(),{lastOffset:T,lastStartLoc:I}=R,x=r(4,T,I);return x.key=w,_===!0&&(x.modulo=!0),b.nextToken(),a(x,b.currentOffset(),b.currentPosition()),x}function d(b,w){const _=b.context(),{lastOffset:R,lastStartLoc:T}=_,I=r(9,R,T);return I.value=w.replace(yye,wye),b.nextToken(),a(I,b.currentOffset(),b.currentPosition()),I}function h(b){const w=b.nextToken(),_=b.context(),{lastOffset:R,lastStartLoc:T}=_,I=r(8,R,T);return w.type!==12?(o(b,Lt.UNEXPECTED_EMPTY_LINKED_MODIFIER,_.lastStartLoc,0),I.value="",a(I,R,T),{nextConsumeToken:w,node:I}):(w.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Hi(w)),I.value=w.value||"",a(I,b.currentOffset(),b.currentPosition()),{node:I})}function f(b,w){const _=b.context(),R=r(7,_.offset,_.startLoc);return R.value=w,a(R,b.currentOffset(),b.currentPosition()),R}function p(b){const w=b.context(),_=r(6,w.offset,w.startLoc);let R=b.nextToken();if(R.type===9){const T=h(b);_.modifier=T.node,R=T.nextConsumeToken||b.nextToken()}switch(R.type!==10&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),R=b.nextToken(),R.type===2&&(R=b.nextToken()),R.type){case 11:R.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=f(b,R.value||"");break;case 5:R.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=c(b,R.value||"");break;case 6:R.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=u(b,R.value||"");break;case 7:R.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=d(b,R.value||"");break;default:{o(b,Lt.UNEXPECTED_EMPTY_LINKED_KEY,w.lastStartLoc,0);const T=b.context(),I=r(7,T.offset,T.startLoc);return I.value="",a(I,T.offset,T.startLoc),_.key=I,a(_,T.offset,T.startLoc),{nextConsumeToken:R,node:_}}}return a(_,b.currentOffset(),b.currentPosition()),{node:_}}function g(b){const w=b.context(),_=w.currentType===1?b.currentOffset():w.offset,R=w.currentType===1?w.endLoc:w.startLoc,T=r(2,_,R);T.items=[];let I=null,x=null;do{const F=I||b.nextToken();switch(I=null,F.type){case 0:F.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(l(b,F.value||""));break;case 6:F.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(u(b,F.value||""));break;case 4:x=!0;break;case 5:F.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(c(b,F.value||"",!!x)),x&&(i(b,Sy.USE_MODULO_SYNTAX,w.lastStartLoc,0,Hi(F)),x=null);break;case 7:F.value==null&&o(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(d(b,F.value||""));break;case 8:{const k=p(b);T.items.push(k.node),I=k.nextConsumeToken||null;break}}}while(w.currentType!==14&&w.currentType!==1);const P=w.currentType===1?w.lastOffset:b.currentOffset(),D=w.currentType===1?w.lastEndLoc:b.currentPosition();return a(T,P,D),T}function v(b,w,_,R){const T=b.context();let I=R.items.length===0;const x=r(1,w,_);x.cases=[],x.cases.push(R);do{const P=g(b);I||(I=P.items.length===0),x.cases.push(P)}while(T.currentType!==14);return I&&o(b,Lt.MUST_HAVE_MESSAGES_IN_PLURAL,_,0),a(x,b.currentOffset(),b.currentPosition()),x}function C(b){const w=b.context(),{offset:_,startLoc:R}=w,T=g(b);return w.currentType===14?T:v(b,_,R,T)}function S(b){const w=mye(b,a2({},e)),_=w.context(),R=r(0,_.offset,_.startLoc);return t&&R.loc&&(R.loc.source=b),R.body=C(w),e.onCacheKey&&(R.cacheKey=e.onCacheKey(b)),_.currentType!==14&&o(w,Lt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,b[_.offset]||""),a(R,w.currentOffset(),w.currentPosition()),R}return{parse:S}}function Hi(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function bye(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function d2(e,t){for(let n=0;n<e.length;n++)J0(e[n],t)}function J0(e,t){switch(e.type){case 1:d2(e.cases,t),t.helper("plural");break;case 2:d2(e.items,t);break;case 6:{J0(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function Sye(e,t={}){const n=bye(e);n.helper("normalize"),e.body&&J0(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function Eye(e){const t=e.body;return t.type===2?h2(t):t.cases.forEach(n=>h2(n)),e}function h2(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=u2(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}const _ye="minifier";function Rd(e){switch(e.t=e.type,e.type){case 0:{const t=e;Rd(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Rd(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Rd(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Rd(t.key),t.k=t.key,delete t.key,t.modifier&&(Rd(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}default:throw _d(Lt.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:_ye,args:[e.type]})}delete e.type}const Rye="parser";function Dye(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const a=()=>r;function l(g,v){r.code+=g}function u(g,v=!0){const C=v?s:"";l(o?C+" ".repeat(g):C)}function c(g=!0){const v=++r.indentLevel;g&&u(v)}function d(g=!0){const v=--r.indentLevel;g&&u(v)}function h(){u(r.indentLevel)}return{context:a,push:l,indent:c,deindent:d,newline:h,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function Tye(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Dd(e,t.key),t.modifier?(e.push(", "),Dd(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function Iye(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(Dd(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function xye(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(Dd(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function Fye(e,t){t.body?Dd(e,t.body):e.push("null")}function Dd(e,t){const{helper:n}=e;switch(t.type){case 0:Fye(e,t);break;case 1:xye(e,t);break;case 2:Iye(e,t);break;case 6:Tye(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break;default:throw _d(Lt.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Rye,args:[t.type]})}}const Pye=(e,t={})=>{const n=l2(t.mode)?t.mode:"normal",s=l2(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
237
+ */function tye(e,t,n){return{line:e,column:t,offset:n}}function by(e,t,n){return{start:e,end:t}}const nye=/\{([0-9a-zA-Z]+)\}/g;function r2(e,...t){return t.length===1&&sye(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),e.replace(nye,(n,s)=>t.hasOwnProperty(s)?t[s]:"")}const a2=Object.assign,l2=e=>typeof e=="string",sye=e=>e!==null&&typeof e=="object";function u2(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Sy={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},oye={[Sy.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function iye(e,t,...n){const s=r2(oye[e],...n||[]),o={message:String(s),code:e};return t&&(o.location=t),o}const Vt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},rye={[Vt.EXPECTED_TOKEN]:"Expected token: '{0}'",[Vt.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[Vt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[Vt.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[Vt.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[Vt.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[Vt.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[Vt.EMPTY_PLACEHOLDER]:"Empty placeholder",[Vt.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[Vt.INVALID_LINKED_FORMAT]:"Invalid linked format",[Vt.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[Vt.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[Vt.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[Vt.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[Vt.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[Vt.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function _d(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=r2((o||rye)[e]||"",...i||[]),a=new SyntaxError(String(r));return a.code=e,t&&(a.location=t),a.domain=s,a}function aye(e){throw e}const lye=/<\/?[\w\s="/.':;#-\/]+>/,uye=e=>lye.test(e),ga=" ",cye="\r",no=`
238
+ `,dye="\u2028",hye="\u2029";function fye(e){const t=e;let n=0,s=1,o=1,i=0;const r=T=>t[T]===cye&&t[T+1]===no,a=T=>t[T]===no,l=T=>t[T]===hye,u=T=>t[T]===dye,c=T=>r(T)||a(T)||l(T)||u(T),d=()=>n,h=()=>s,f=()=>o,p=()=>i,g=T=>r(T)||l(T)||u(T)?no:t[T],v=()=>g(n),C=()=>g(n+i);function S(){return i=0,c(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function b(){return r(n+i)&&i++,i++,t[n+i]}function w(){n=0,s=1,o=1,i=0}function _(T=0){i=T}function R(){const T=n+i;for(;T!==n;)S();i=0}return{index:d,line:h,column:f,peekOffset:p,charAt:g,currentChar:v,currentPeek:C,next:S,peek:b,reset:w,resetPeek:_,skipToPeek:R}}const dl=void 0,pye=".",c2="'",gye="tokenizer";function mye(e,t={}){const n=t.location!==!1,s=fye(e),o=()=>s.index(),i=()=>tye(s.line(),s.column(),s.index()),r=i(),a=o(),l={currentType:14,offset:a,startLoc:r,endLoc:r,lastType:14,lastOffset:a,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=t;function d(M,$,ae,...Ge){const we=u();if($.column+=ae,$.offset+=ae,c){const ze=n?by(we.startLoc,$):null,Ue=_d(M,ze,{domain:gye,args:Ge});c(Ue)}}function h(M,$,ae){M.endLoc=i(),M.currentType=$;const Ge={type:$};return n&&(Ge.loc=by(M.startLoc,M.endLoc)),ae!=null&&(Ge.value=ae),Ge}const f=M=>h(M,14);function p(M,$){return M.currentChar()===$?(M.next(),$):(d(Vt.EXPECTED_TOKEN,i(),0,$),"")}function g(M){let $="";for(;M.currentPeek()===ga||M.currentPeek()===no;)$+=M.currentPeek(),M.peek();return $}function v(M){const $=g(M);return M.skipToPeek(),$}function C(M){if(M===dl)return!1;const $=M.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$===95}function S(M){if(M===dl)return!1;const $=M.charCodeAt(0);return $>=48&&$<=57}function b(M,$){const{currentType:ae}=$;if(ae!==2)return!1;g(M);const Ge=C(M.currentPeek());return M.resetPeek(),Ge}function w(M,$){const{currentType:ae}=$;if(ae!==2)return!1;g(M);const Ge=M.currentPeek()==="-"?M.peek():M.currentPeek(),we=S(Ge);return M.resetPeek(),we}function _(M,$){const{currentType:ae}=$;if(ae!==2)return!1;g(M);const Ge=M.currentPeek()===c2;return M.resetPeek(),Ge}function R(M,$){const{currentType:ae}=$;if(ae!==8)return!1;g(M);const Ge=M.currentPeek()===".";return M.resetPeek(),Ge}function T(M,$){const{currentType:ae}=$;if(ae!==9)return!1;g(M);const Ge=C(M.currentPeek());return M.resetPeek(),Ge}function I(M,$){const{currentType:ae}=$;if(!(ae===8||ae===12))return!1;g(M);const Ge=M.currentPeek()===":";return M.resetPeek(),Ge}function x(M,$){const{currentType:ae}=$;if(ae!==10)return!1;const Ge=()=>{const ze=M.currentPeek();return ze==="{"?C(M.peek()):ze==="@"||ze==="%"||ze==="|"||ze===":"||ze==="."||ze===ga||!ze?!1:ze===no?(M.peek(),Ge()):F(M,!1)},we=Ge();return M.resetPeek(),we}function P(M){g(M);const $=M.currentPeek()==="|";return M.resetPeek(),$}function D(M){const $=g(M),ae=M.currentPeek()==="%"&&M.peek()==="{";return M.resetPeek(),{isModulo:ae,hasSpace:$.length>0}}function F(M,$=!0){const ae=(we=!1,ze="",Ue=!1)=>{const Ee=M.currentPeek();return Ee==="{"?ze==="%"?!1:we:Ee==="@"||!Ee?ze==="%"?!0:we:Ee==="%"?(M.peek(),ae(we,"%",!0)):Ee==="|"?ze==="%"||Ue?!0:!(ze===ga||ze===no):Ee===ga?(M.peek(),ae(!0,ga,Ue)):Ee===no?(M.peek(),ae(!0,no,Ue)):!0},Ge=ae();return $&&M.resetPeek(),Ge}function k(M,$){const ae=M.currentChar();return ae===dl?dl:$(ae)?(M.next(),ae):null}function O(M){const $=M.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===95||$===36}function B(M){return k(M,O)}function Z(M){const $=M.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===95||$===36||$===45}function J(M){return k(M,Z)}function ee(M){const $=M.charCodeAt(0);return $>=48&&$<=57}function X(M){return k(M,ee)}function ve(M){const $=M.charCodeAt(0);return $>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102}function ne(M){return k(M,ve)}function L(M){let $="",ae="";for(;$=X(M);)ae+=$;return ae}function H(M){v(M);const $=M.currentChar();return $!=="%"&&d(Vt.EXPECTED_TOKEN,i(),0,$),M.next(),"%"}function te(M){let $="";for(;;){const ae=M.currentChar();if(ae==="{"||ae==="}"||ae==="@"||ae==="|"||!ae)break;if(ae==="%")if(F(M))$+=ae,M.next();else break;else if(ae===ga||ae===no)if(F(M))$+=ae,M.next();else{if(P(M))break;$+=ae,M.next()}else $+=ae,M.next()}return $}function he(M){v(M);let $="",ae="";for(;$=J(M);)ae+=$;return M.currentChar()===dl&&d(Vt.UNTERMINATED_CLOSING_BRACE,i(),0),ae}function me(M){v(M);let $="";return M.currentChar()==="-"?(M.next(),$+=`-${L(M)}`):$+=L(M),M.currentChar()===dl&&d(Vt.UNTERMINATED_CLOSING_BRACE,i(),0),$}function re(M){return M!==c2&&M!==no}function oe(M){v(M),p(M,"'");let $="",ae="";for(;$=k(M,re);)$==="\\"?ae+=z(M):ae+=$;const Ge=M.currentChar();return Ge===no||Ge===dl?(d(Vt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ge===no&&(M.next(),p(M,"'")),ae):(p(M,"'"),ae)}function z(M){const $=M.currentChar();switch($){case"\\":case"'":return M.next(),`\\${$}`;case"u":return pe(M,$,4);case"U":return pe(M,$,6);default:return d(Vt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,$),""}}function pe(M,$,ae){p(M,$);let Ge="";for(let we=0;we<ae;we++){const ze=ne(M);if(!ze){d(Vt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${$}${Ge}${M.currentChar()}`);break}Ge+=ze}return`\\${$}${Ge}`}function ie(M){return M!=="{"&&M!=="}"&&M!==ga&&M!==no}function be(M){v(M);let $="",ae="";for(;$=k(M,ie);)ae+=$;return ae}function G(M){let $="",ae="";for(;$=B(M);)ae+=$;return ae}function q(M){const $=ae=>{const Ge=M.currentChar();return Ge==="{"||Ge==="%"||Ge==="@"||Ge==="|"||Ge==="("||Ge===")"||!Ge||Ge===ga?ae:(ae+=Ge,M.next(),$(ae))};return $("")}function ce(M){v(M);const $=p(M,"|");return v(M),$}function ke(M,$){let ae=null;switch(M.currentChar()){case"{":return $.braceNest>=1&&d(Vt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),M.next(),ae=h($,2,"{"),v(M),$.braceNest++,ae;case"}":return $.braceNest>0&&$.currentType===2&&d(Vt.EMPTY_PLACEHOLDER,i(),0),M.next(),ae=h($,3,"}"),$.braceNest--,$.braceNest>0&&v(M),$.inLinked&&$.braceNest===0&&($.inLinked=!1),ae;case"@":return $.braceNest>0&&d(Vt.UNTERMINATED_CLOSING_BRACE,i(),0),ae=Fe(M,$)||f($),$.braceNest=0,ae;default:{let we=!0,ze=!0,Ue=!0;if(P(M))return $.braceNest>0&&d(Vt.UNTERMINATED_CLOSING_BRACE,i(),0),ae=h($,1,ce(M)),$.braceNest=0,$.inLinked=!1,ae;if($.braceNest>0&&($.currentType===5||$.currentType===6||$.currentType===7))return d(Vt.UNTERMINATED_CLOSING_BRACE,i(),0),$.braceNest=0,Le(M,$);if(we=b(M,$))return ae=h($,5,he(M)),v(M),ae;if(ze=w(M,$))return ae=h($,6,me(M)),v(M),ae;if(Ue=_(M,$))return ae=h($,7,oe(M)),v(M),ae;if(!we&&!ze&&!Ue)return ae=h($,13,be(M)),d(Vt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ae.value),v(M),ae;break}}return ae}function Fe(M,$){const{currentType:ae}=$;let Ge=null;const we=M.currentChar();switch((ae===8||ae===9||ae===12||ae===10)&&(we===no||we===ga)&&d(Vt.INVALID_LINKED_FORMAT,i(),0),we){case"@":return M.next(),Ge=h($,8,"@"),$.inLinked=!0,Ge;case".":return v(M),M.next(),h($,9,".");case":":return v(M),M.next(),h($,10,":");default:return P(M)?(Ge=h($,1,ce(M)),$.braceNest=0,$.inLinked=!1,Ge):R(M,$)||I(M,$)?(v(M),Fe(M,$)):T(M,$)?(v(M),h($,12,G(M))):x(M,$)?(v(M),we==="{"?ke(M,$)||Ge:h($,11,q(M))):(ae===8&&d(Vt.INVALID_LINKED_FORMAT,i(),0),$.braceNest=0,$.inLinked=!1,Le(M,$))}}function Le(M,$){let ae={type:14};if($.braceNest>0)return ke(M,$)||f($);if($.inLinked)return Fe(M,$)||f($);switch(M.currentChar()){case"{":return ke(M,$)||f($);case"}":return d(Vt.UNBALANCED_CLOSING_BRACE,i(),0),M.next(),h($,3,"}");case"@":return Fe(M,$)||f($);default:{if(P(M))return ae=h($,1,ce(M)),$.braceNest=0,$.inLinked=!1,ae;const{isModulo:we,hasSpace:ze}=D(M);if(we)return ze?h($,0,te(M)):h($,4,H(M));if(F(M))return h($,0,te(M));break}}return ae}function ye(){const{currentType:M,offset:$,startLoc:ae,endLoc:Ge}=l;return l.lastType=M,l.lastOffset=$,l.lastStartLoc=ae,l.lastEndLoc=Ge,l.offset=o(),l.startLoc=i(),s.currentChar()===dl?h(l,14):Le(s,l)}return{nextToken:ye,currentOffset:o,currentPosition:i,context:u}}const vye="parser",yye=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function wye(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function Cye(e={}){const t=e.location!==!1,{onError:n,onWarn:s}=e;function o(b,w,_,R,...T){const I=b.currentPosition();if(I.offset+=R,I.column+=R,n){const x=t?by(_,I):null,P=_d(w,x,{domain:vye,args:T});n(P)}}function i(b,w,_,R,...T){const I=b.currentPosition();if(I.offset+=R,I.column+=R,s){const x=t?by(_,I):null;s(iye(w,x,T))}}function r(b,w,_){const R={type:b};return t&&(R.start=w,R.end=w,R.loc={start:_,end:_}),R}function a(b,w,_,R){t&&(b.end=w,b.loc&&(b.loc.end=_))}function l(b,w){const _=b.context(),R=r(3,_.offset,_.startLoc);return R.value=w,a(R,b.currentOffset(),b.currentPosition()),R}function u(b,w){const _=b.context(),{lastOffset:R,lastStartLoc:T}=_,I=r(5,R,T);return I.index=parseInt(w,10),b.nextToken(),a(I,b.currentOffset(),b.currentPosition()),I}function c(b,w,_){const R=b.context(),{lastOffset:T,lastStartLoc:I}=R,x=r(4,T,I);return x.key=w,_===!0&&(x.modulo=!0),b.nextToken(),a(x,b.currentOffset(),b.currentPosition()),x}function d(b,w){const _=b.context(),{lastOffset:R,lastStartLoc:T}=_,I=r(9,R,T);return I.value=w.replace(yye,wye),b.nextToken(),a(I,b.currentOffset(),b.currentPosition()),I}function h(b){const w=b.nextToken(),_=b.context(),{lastOffset:R,lastStartLoc:T}=_,I=r(8,R,T);return w.type!==12?(o(b,Vt.UNEXPECTED_EMPTY_LINKED_MODIFIER,_.lastStartLoc,0),I.value="",a(I,R,T),{nextConsumeToken:w,node:I}):(w.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Hi(w)),I.value=w.value||"",a(I,b.currentOffset(),b.currentPosition()),{node:I})}function f(b,w){const _=b.context(),R=r(7,_.offset,_.startLoc);return R.value=w,a(R,b.currentOffset(),b.currentPosition()),R}function p(b){const w=b.context(),_=r(6,w.offset,w.startLoc);let R=b.nextToken();if(R.type===9){const T=h(b);_.modifier=T.node,R=T.nextConsumeToken||b.nextToken()}switch(R.type!==10&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),R=b.nextToken(),R.type===2&&(R=b.nextToken()),R.type){case 11:R.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=f(b,R.value||"");break;case 5:R.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=c(b,R.value||"");break;case 6:R.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=u(b,R.value||"");break;case 7:R.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(R)),_.key=d(b,R.value||"");break;default:{o(b,Vt.UNEXPECTED_EMPTY_LINKED_KEY,w.lastStartLoc,0);const T=b.context(),I=r(7,T.offset,T.startLoc);return I.value="",a(I,T.offset,T.startLoc),_.key=I,a(_,T.offset,T.startLoc),{nextConsumeToken:R,node:_}}}return a(_,b.currentOffset(),b.currentPosition()),{node:_}}function g(b){const w=b.context(),_=w.currentType===1?b.currentOffset():w.offset,R=w.currentType===1?w.endLoc:w.startLoc,T=r(2,_,R);T.items=[];let I=null,x=null;do{const F=I||b.nextToken();switch(I=null,F.type){case 0:F.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(l(b,F.value||""));break;case 6:F.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(u(b,F.value||""));break;case 4:x=!0;break;case 5:F.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(c(b,F.value||"",!!x)),x&&(i(b,Sy.USE_MODULO_SYNTAX,w.lastStartLoc,0,Hi(F)),x=null);break;case 7:F.value==null&&o(b,Vt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Hi(F)),T.items.push(d(b,F.value||""));break;case 8:{const k=p(b);T.items.push(k.node),I=k.nextConsumeToken||null;break}}}while(w.currentType!==14&&w.currentType!==1);const P=w.currentType===1?w.lastOffset:b.currentOffset(),D=w.currentType===1?w.lastEndLoc:b.currentPosition();return a(T,P,D),T}function v(b,w,_,R){const T=b.context();let I=R.items.length===0;const x=r(1,w,_);x.cases=[],x.cases.push(R);do{const P=g(b);I||(I=P.items.length===0),x.cases.push(P)}while(T.currentType!==14);return I&&o(b,Vt.MUST_HAVE_MESSAGES_IN_PLURAL,_,0),a(x,b.currentOffset(),b.currentPosition()),x}function C(b){const w=b.context(),{offset:_,startLoc:R}=w,T=g(b);return w.currentType===14?T:v(b,_,R,T)}function S(b){const w=mye(b,a2({},e)),_=w.context(),R=r(0,_.offset,_.startLoc);return t&&R.loc&&(R.loc.source=b),R.body=C(w),e.onCacheKey&&(R.cacheKey=e.onCacheKey(b)),_.currentType!==14&&o(w,Vt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,b[_.offset]||""),a(R,w.currentOffset(),w.currentPosition()),R}return{parse:S}}function Hi(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function bye(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function d2(e,t){for(let n=0;n<e.length;n++)J0(e[n],t)}function J0(e,t){switch(e.type){case 1:d2(e.cases,t),t.helper("plural");break;case 2:d2(e.items,t);break;case 6:{J0(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function Sye(e,t={}){const n=bye(e);n.helper("normalize"),e.body&&J0(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function Eye(e){const t=e.body;return t.type===2?h2(t):t.cases.forEach(n=>h2(n)),e}function h2(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=u2(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}const _ye="minifier";function Rd(e){switch(e.t=e.type,e.type){case 0:{const t=e;Rd(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Rd(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Rd(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Rd(t.key),t.k=t.key,delete t.key,t.modifier&&(Rd(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}default:throw _d(Vt.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:_ye,args:[e.type]})}delete e.type}const Rye="parser";function Dye(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const a=()=>r;function l(g,v){r.code+=g}function u(g,v=!0){const C=v?s:"";l(o?C+" ".repeat(g):C)}function c(g=!0){const v=++r.indentLevel;g&&u(v)}function d(g=!0){const v=--r.indentLevel;g&&u(v)}function h(){u(r.indentLevel)}return{context:a,push:l,indent:c,deindent:d,newline:h,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function Tye(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Dd(e,t.key),t.modifier?(e.push(", "),Dd(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function Iye(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(Dd(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function xye(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(Dd(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function Fye(e,t){t.body?Dd(e,t.body):e.push("null")}function Dd(e,t){const{helper:n}=e;switch(t.type){case 0:Fye(e,t);break;case 1:xye(e,t);break;case 2:Iye(e,t);break;case 6:Tye(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break;default:throw _d(Vt.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Rye,args:[t.type]})}}const Pye=(e,t={})=>{const n=l2(t.mode)?t.mode:"normal",s=l2(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
239
239
  `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],a=Dye(e,{filename:s,breakLineCode:o,needIndent:i});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(i),r.length>0&&(a.push(`const { ${u2(r.map(c=>`${c}: _${c}`),", ")} } = ctx`),a.newline()),a.push("return "),Dd(a,e),a.deindent(i),a.push("}"),delete e.helpers;const{code:l,map:u}=a.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function Aye(e,t={}){const n=a2({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,a=Cye(n).parse(e);return s?(i&&Eye(a),o&&Rd(a),{ast:a,code:""}):(Sye(a,n),Pye(a,n))}/*!
240
240
  * core-base v9.14.5
241
241
  * (c) 2025 kazuya kawaguchi
242
242
  * Released under the MIT License.
243
- */function kye(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(pa().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(pa().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(pa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function hi(e){return an(e)&&Q0(e)===0&&($i(e,"b")||$i(e,"body"))}const f2=["b","body"];function Oye(e){return hl(e,f2)}const p2=["c","cases"];function Mye(e){return hl(e,p2,[])}const g2=["s","static"];function Nye(e){return hl(e,g2)}const m2=["i","items"];function Lye(e){return hl(e,m2,[])}const v2=["t","type"];function Q0(e){return hl(e,v2)}const y2=["v","value"];function Ey(e,t){const n=hl(e,y2);if(n!=null)return n;throw dp(t)}const w2=["m","modifier"];function Vye(e){return hl(e,w2)}const C2=["k","key"];function Bye(e){const t=hl(e,C2);if(t)return t;throw dp(6)}function hl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if($i(e,o)&&e[o]!=null)return e[o]}return n}const b2=[...f2,...p2,...g2,...m2,...C2,...w2,...y2,...v2];function dp(e){return new Error(`unhandled node type: ${e}`)}const fl=[];fl[0]={w:[0],i:[3,0],"[":[4],o:[7]},fl[1]={w:[1],".":[2],"[":[4],o:[7]},fl[2]={w:[2],i:[3,0],0:[3,0]},fl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},fl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},fl[5]={"'":[4,0],o:8,l:[5,0]},fl[6]={'"':[4,0],o:8,l:[6,0]};const $ye=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Hye(e){return $ye.test(e)}function Gye(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function Uye(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Wye(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Hye(t)?Gye(t):"*"+t}function zye(e){const t=[];let n=-1,s=0,o=0,i,r,a,l,u,c,d;const h=[];h[0]=()=>{r===void 0?r=a:r+=a},h[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},h[2]=()=>{h[0](),o++},h[3]=()=>{if(o>0)o--,s=4,h[0]();else{if(o=0,r===void 0||(r=Wye(r),r===!1))return!1;h[1]()}};function f(){const p=e[n+1];if(s===5&&p==="'"||s===6&&p==='"')return n++,a="\\"+p,h[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&f())){if(l=Uye(i),d=fl[s],u=d[l]||d.l||8,u===8||(s=u[0],u[1]!==void 0&&(c=h[u[1]],c&&(a=i,c()===!1))))return;if(s===7)return t}}const S2=new Map;function jye(e,t){return an(e)?e[t]:null}function Kye(e,t){if(!an(e))return null;let n=S2.get(t);if(n||(n=zye(t),n&&S2.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(b2.includes(r)&&hi(o))return null;const a=o[r];if(a===void 0||Tn(o))return null;o=a,i++}return o}const qye=e=>e,Yye=e=>"",Zye="text",Xye=e=>e.length===0?"":Qve(e),Jye=Jve;function E2(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Qye(e){const t=rs(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(rs(e.named.count)||rs(e.named.n))?rs(e.named.count)?e.named.count:rs(e.named.n)?e.named.n:t:t}function ewe(e,t){t.count||(t.count=e),t.n||(t.n=e)}function twe(e={}){const t=e.locale,n=Qye(e),s=an(e.pluralRules)&&vt(t)&&Tn(e.pluralRules[t])?e.pluralRules[t]:E2,o=an(e.pluralRules)&&vt(t)&&Tn(e.pluralRules[t])?E2:void 0,i=C=>C[s(n,C.length,o)],r=e.list||[],a=C=>r[C],l=e.named||Dn();rs(e.pluralIndex)&&ewe(n,l);const u=C=>l[C];function c(C){const S=Tn(e.messages)?e.messages(C):an(e.messages)?e.messages[C]:!1;return S||(e.parent?e.parent.message(C):Yye)}const d=C=>e.modifiers?e.modifiers[C]:qye,h=Gt(e.processor)&&Tn(e.processor.normalize)?e.processor.normalize:Xye,f=Gt(e.processor)&&Tn(e.processor.interpolate)?e.processor.interpolate:Jye,p=Gt(e.processor)&&vt(e.processor.type)?e.processor.type:Zye,v={list:a,named:u,plural:i,linked:(C,...S)=>{const[b,w]=S;let _="text",R="";S.length===1?an(b)?(R=b.modifier||R,_=b.type||_):vt(b)&&(R=b||R):S.length===2&&(vt(b)&&(R=b||R),vt(w)&&(_=w||_));const T=c(C)(v),I=_==="vnode"&&An(T)&&R?T[0]:T;return R?d(R)(I,_):I},message:c,type:p,interpolate:f,normalize:h,values:Ms(Dn(),r,l)};return v}let hp=null;function nwe(e){hp=e}function swe(e,t,n){hp&&hp.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const owe=iwe("function:translate");function iwe(e){return t=>hp&&hp.emit(e,t)}const _2=Sy.__EXTEND_POINT__,Tu=yy(_2),so={NOT_FOUND_KEY:_2,FALLBACK_TO_TRANSLATE:Tu(),CANNOT_FORMAT_NUMBER:Tu(),FALLBACK_TO_NUMBER_FORMAT:Tu(),CANNOT_FORMAT_DATE:Tu(),FALLBACK_TO_DATE_FORMAT:Tu(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:Tu(),__EXTEND_POINT__:Tu()},rwe={[so.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[so.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[so.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[so.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[so.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[so.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[so.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Iu(e,...t){return Z0(rwe[e],...t)}const R2=Lt.__EXTEND_POINT__,xu=yy(R2),Ts={INVALID_ARGUMENT:R2,INVALID_DATE_ARGUMENT:xu(),INVALID_ISO_DATE_ARGUMENT:xu(),NOT_SUPPORT_NON_STRING_MESSAGE:xu(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:xu(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:xu(),NOT_SUPPORT_LOCALE_TYPE:xu(),__EXTEND_POINT__:xu()};function Tr(e){return _d(e,null,K.env.NODE_ENV!=="production"?{messages:awe}:void 0)}const awe={[Ts.INVALID_ARGUMENT]:"Invalid arguments",[Ts.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Ts.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Ts.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Ts.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Ts.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Ts.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function e_(e,t){return t.locale!=null?D2(t.locale):D2(e.locale)}let t_;function D2(e){if(vt(e))return e;if(Tn(e)){if(e.resolvedOnce&&t_!=null)return t_;if(e.constructor.name==="Function"){const t=e();if(Xve(t))throw Tr(Ts.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return t_=t}else throw Tr(Ts.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Tr(Ts.NOT_SUPPORT_LOCALE_TYPE)}function lwe(e,t,n){return[...new Set([n,...An(t)?t:an(t)?Object.keys(t):vt(t)?[t]:[n]])]}function T2(e,t,n){const s=vt(n)?n:Td,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;An(r);)r=I2(i,r,t);const a=An(t)||!Gt(t)?t:t.default?t.default:null;r=vt(a)?[a]:a,An(r)&&I2(i,r,!1),o.__localeChainCache.set(s,i)}return i}function I2(e,t,n){let s=!0;for(let o=0;o<t.length&&en(s);o++){const i=t[o];vt(i)&&(s=uwe(e,t[o],n))}return s}function uwe(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=cwe(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function cwe(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(An(n)||Gt(n))&&n[o]&&(s=n[o])}return s}const dwe="9.14.5",_y=-1,Td="en-US",Ry="",x2=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function hwe(){return{upper:(e,t)=>t==="text"&&vt(e)?e.toUpperCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&vt(e)?e.toLowerCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&vt(e)?x2(e):t==="vnode"&&an(e)&&"__v_isVNode"in e?x2(e.children):e}}let F2;function P2(e){F2=e}let A2;function fwe(e){A2=e}let k2;function pwe(e){k2=e}let O2=null;const gwe=e=>{O2=e},mwe=()=>O2;let M2=null;const N2=e=>{M2=e},vwe=()=>M2;let L2=0;function ywe(e={}){const t=Tn(e.onWarn)?e.onWarn:fs,n=vt(e.version)?e.version:dwe,s=vt(e.locale)||Tn(e.locale)?e.locale:Td,o=Tn(s)?Td:s,i=An(e.fallbackLocale)||Gt(e.fallbackLocale)||vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Gt(e.messages)?e.messages:n_(o),a=Gt(e.datetimeFormats)?e.datetimeFormats:n_(o),l=Gt(e.numberFormats)?e.numberFormats:n_(o),u=Ms(Dn(),e.modifiers,hwe()),c=e.pluralRules||Dn(),d=Tn(e.missing)?e.missing:null,h=en(e.missingWarn)||cl(e.missingWarn)?e.missingWarn:!0,f=en(e.fallbackWarn)||cl(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,v=Tn(e.postTranslation)?e.postTranslation:null,C=Gt(e.processor)?e.processor:null,S=en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,w=Tn(e.messageCompiler)?e.messageCompiler:F2;K.env.NODE_ENV!=="production"&&Tn(e.messageCompiler)&&QV(Iu(so.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const _=Tn(e.messageResolver)?e.messageResolver:A2||jye,R=Tn(e.localeFallbacker)?e.localeFallbacker:k2||lwe,T=an(e.fallbackContext)?e.fallbackContext:void 0,I=e,x=an(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,P=an(I.__numberFormatters)?I.__numberFormatters:new Map,D=an(I.__meta)?I.__meta:{};L2++;const F={version:n,cid:L2,locale:s,fallbackLocale:i,messages:r,modifiers:u,pluralRules:c,missing:d,missingWarn:h,fallbackWarn:f,fallbackFormat:p,unresolving:g,postTranslation:v,processor:C,warnHtmlMessage:S,escapeParameter:b,messageCompiler:w,messageResolver:_,localeFallbacker:R,fallbackContext:T,onWarn:t,__meta:D};return F.datetimeFormats=a,F.numberFormats=l,F.__datetimeFormatters=x,F.__numberFormatters=P,K.env.NODE_ENV!=="production"&&(F.__v_emitter=I.__v_emitter!=null?I.__v_emitter:void 0),(K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&swe(F,n,D),F}const n_=e=>({[e]:Dn()});function Dy(e,t){return e instanceof RegExp?e.test(t):e}function V2(e,t){return e instanceof RegExp?e.test(t):e}function s_(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(K.env.NODE_ENV!=="production"){const a=e.__v_emitter;a&&a.emit("missing",{locale:n,key:t,type:o,groupId:`${o}:${t}`})}if(i!==null){const a=i(e,n,t,o);return vt(a)?a:t}else return K.env.NODE_ENV!=="production"&&V2(s,t)&&r(Iu(so.NOT_FOUND_KEY,{key:t,locale:n})),t}function fp(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function B2(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function wwe(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(B2(e,t[s]))return!0;return!1}function o_(e){return n=>Cwe(n,e)}function Cwe(e,t){const n=Oye(t);if(n==null)throw dp(0);if(Q0(n)===1){const i=Mye(n);return e.plural(i.reduce((r,a)=>[...r,$2(e,a)],[]))}else return $2(e,n)}function $2(e,t){const n=Nye(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=Lye(t).reduce((o,i)=>[...o,i_(e,i)],[]);return e.normalize(s)}}function i_(e,t){const n=Q0(t);switch(n){case 3:return Ey(t,n);case 9:return Ey(t,n);case 4:{const s=t;if($i(s,"k")&&s.k)return e.interpolate(e.named(s.k));if($i(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw dp(n)}case 5:{const s=t;if($i(s,"i")&&rs(s.i))return e.interpolate(e.list(s.i));if($i(s,"index")&&rs(s.index))return e.interpolate(e.list(s.index));throw dp(n)}case 6:{const s=t,o=Vye(s),i=Bye(s);return e.linked(i_(e,i),o?i_(e,o):void 0,e.type)}case 7:return Ey(t,n);case 8:return Ey(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const bwe="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function H2(e,t){t&&uye(e)&&fs(Z0(bwe,{source:e}))}const G2=e=>e;let Id=Dn();function U2(e){e.code===Sy.USE_MODULO_SYNTAX&&fs(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
243
+ */function kye(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(pa().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(pa().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(pa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function hi(e){return an(e)&&Q0(e)===0&&($i(e,"b")||$i(e,"body"))}const f2=["b","body"];function Oye(e){return hl(e,f2)}const p2=["c","cases"];function Mye(e){return hl(e,p2,[])}const g2=["s","static"];function Nye(e){return hl(e,g2)}const m2=["i","items"];function Lye(e){return hl(e,m2,[])}const v2=["t","type"];function Q0(e){return hl(e,v2)}const y2=["v","value"];function Ey(e,t){const n=hl(e,y2);if(n!=null)return n;throw dp(t)}const w2=["m","modifier"];function Vye(e){return hl(e,w2)}const C2=["k","key"];function Bye(e){const t=hl(e,C2);if(t)return t;throw dp(6)}function hl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if($i(e,o)&&e[o]!=null)return e[o]}return n}const b2=[...f2,...p2,...g2,...m2,...C2,...w2,...y2,...v2];function dp(e){return new Error(`unhandled node type: ${e}`)}const fl=[];fl[0]={w:[0],i:[3,0],"[":[4],o:[7]},fl[1]={w:[1],".":[2],"[":[4],o:[7]},fl[2]={w:[2],i:[3,0],0:[3,0]},fl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},fl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},fl[5]={"'":[4,0],o:8,l:[5,0]},fl[6]={'"':[4,0],o:8,l:[6,0]};const $ye=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Hye(e){return $ye.test(e)}function Gye(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function Uye(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Wye(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Hye(t)?Gye(t):"*"+t}function zye(e){const t=[];let n=-1,s=0,o=0,i,r,a,l,u,c,d;const h=[];h[0]=()=>{r===void 0?r=a:r+=a},h[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},h[2]=()=>{h[0](),o++},h[3]=()=>{if(o>0)o--,s=4,h[0]();else{if(o=0,r===void 0||(r=Wye(r),r===!1))return!1;h[1]()}};function f(){const p=e[n+1];if(s===5&&p==="'"||s===6&&p==='"')return n++,a="\\"+p,h[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&f())){if(l=Uye(i),d=fl[s],u=d[l]||d.l||8,u===8||(s=u[0],u[1]!==void 0&&(c=h[u[1]],c&&(a=i,c()===!1))))return;if(s===7)return t}}const S2=new Map;function jye(e,t){return an(e)?e[t]:null}function Kye(e,t){if(!an(e))return null;let n=S2.get(t);if(n||(n=zye(t),n&&S2.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(b2.includes(r)&&hi(o))return null;const a=o[r];if(a===void 0||Tn(o))return null;o=a,i++}return o}const qye=e=>e,Yye=e=>"",Zye="text",Xye=e=>e.length===0?"":Qve(e),Jye=Jve;function E2(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Qye(e){const t=rs(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(rs(e.named.count)||rs(e.named.n))?rs(e.named.count)?e.named.count:rs(e.named.n)?e.named.n:t:t}function ewe(e,t){t.count||(t.count=e),t.n||(t.n=e)}function twe(e={}){const t=e.locale,n=Qye(e),s=an(e.pluralRules)&&vt(t)&&Tn(e.pluralRules[t])?e.pluralRules[t]:E2,o=an(e.pluralRules)&&vt(t)&&Tn(e.pluralRules[t])?E2:void 0,i=C=>C[s(n,C.length,o)],r=e.list||[],a=C=>r[C],l=e.named||Dn();rs(e.pluralIndex)&&ewe(n,l);const u=C=>l[C];function c(C){const S=Tn(e.messages)?e.messages(C):an(e.messages)?e.messages[C]:!1;return S||(e.parent?e.parent.message(C):Yye)}const d=C=>e.modifiers?e.modifiers[C]:qye,h=Gt(e.processor)&&Tn(e.processor.normalize)?e.processor.normalize:Xye,f=Gt(e.processor)&&Tn(e.processor.interpolate)?e.processor.interpolate:Jye,p=Gt(e.processor)&&vt(e.processor.type)?e.processor.type:Zye,v={list:a,named:u,plural:i,linked:(C,...S)=>{const[b,w]=S;let _="text",R="";S.length===1?an(b)?(R=b.modifier||R,_=b.type||_):vt(b)&&(R=b||R):S.length===2&&(vt(b)&&(R=b||R),vt(w)&&(_=w||_));const T=c(C)(v),I=_==="vnode"&&An(T)&&R?T[0]:T;return R?d(R)(I,_):I},message:c,type:p,interpolate:f,normalize:h,values:Ms(Dn(),r,l)};return v}let hp=null;function nwe(e){hp=e}function swe(e,t,n){hp&&hp.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const owe=iwe("function:translate");function iwe(e){return t=>hp&&hp.emit(e,t)}const _2=Sy.__EXTEND_POINT__,Tu=yy(_2),so={NOT_FOUND_KEY:_2,FALLBACK_TO_TRANSLATE:Tu(),CANNOT_FORMAT_NUMBER:Tu(),FALLBACK_TO_NUMBER_FORMAT:Tu(),CANNOT_FORMAT_DATE:Tu(),FALLBACK_TO_DATE_FORMAT:Tu(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:Tu(),__EXTEND_POINT__:Tu()},rwe={[so.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[so.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[so.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[so.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[so.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[so.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[so.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Iu(e,...t){return Z0(rwe[e],...t)}const R2=Vt.__EXTEND_POINT__,xu=yy(R2),Ts={INVALID_ARGUMENT:R2,INVALID_DATE_ARGUMENT:xu(),INVALID_ISO_DATE_ARGUMENT:xu(),NOT_SUPPORT_NON_STRING_MESSAGE:xu(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:xu(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:xu(),NOT_SUPPORT_LOCALE_TYPE:xu(),__EXTEND_POINT__:xu()};function Tr(e){return _d(e,null,K.env.NODE_ENV!=="production"?{messages:awe}:void 0)}const awe={[Ts.INVALID_ARGUMENT]:"Invalid arguments",[Ts.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Ts.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Ts.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Ts.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Ts.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Ts.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function e_(e,t){return t.locale!=null?D2(t.locale):D2(e.locale)}let t_;function D2(e){if(vt(e))return e;if(Tn(e)){if(e.resolvedOnce&&t_!=null)return t_;if(e.constructor.name==="Function"){const t=e();if(Xve(t))throw Tr(Ts.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return t_=t}else throw Tr(Ts.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Tr(Ts.NOT_SUPPORT_LOCALE_TYPE)}function lwe(e,t,n){return[...new Set([n,...An(t)?t:an(t)?Object.keys(t):vt(t)?[t]:[n]])]}function T2(e,t,n){const s=vt(n)?n:Td,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;An(r);)r=I2(i,r,t);const a=An(t)||!Gt(t)?t:t.default?t.default:null;r=vt(a)?[a]:a,An(r)&&I2(i,r,!1),o.__localeChainCache.set(s,i)}return i}function I2(e,t,n){let s=!0;for(let o=0;o<t.length&&en(s);o++){const i=t[o];vt(i)&&(s=uwe(e,t[o],n))}return s}function uwe(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=cwe(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function cwe(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(An(n)||Gt(n))&&n[o]&&(s=n[o])}return s}const dwe="9.14.5",_y=-1,Td="en-US",Ry="",x2=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function hwe(){return{upper:(e,t)=>t==="text"&&vt(e)?e.toUpperCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&vt(e)?e.toLowerCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&vt(e)?x2(e):t==="vnode"&&an(e)&&"__v_isVNode"in e?x2(e.children):e}}let F2;function P2(e){F2=e}let A2;function fwe(e){A2=e}let k2;function pwe(e){k2=e}let O2=null;const gwe=e=>{O2=e},mwe=()=>O2;let M2=null;const N2=e=>{M2=e},vwe=()=>M2;let L2=0;function ywe(e={}){const t=Tn(e.onWarn)?e.onWarn:fs,n=vt(e.version)?e.version:dwe,s=vt(e.locale)||Tn(e.locale)?e.locale:Td,o=Tn(s)?Td:s,i=An(e.fallbackLocale)||Gt(e.fallbackLocale)||vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Gt(e.messages)?e.messages:n_(o),a=Gt(e.datetimeFormats)?e.datetimeFormats:n_(o),l=Gt(e.numberFormats)?e.numberFormats:n_(o),u=Ms(Dn(),e.modifiers,hwe()),c=e.pluralRules||Dn(),d=Tn(e.missing)?e.missing:null,h=en(e.missingWarn)||cl(e.missingWarn)?e.missingWarn:!0,f=en(e.fallbackWarn)||cl(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,v=Tn(e.postTranslation)?e.postTranslation:null,C=Gt(e.processor)?e.processor:null,S=en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,w=Tn(e.messageCompiler)?e.messageCompiler:F2;K.env.NODE_ENV!=="production"&&Tn(e.messageCompiler)&&QV(Iu(so.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const _=Tn(e.messageResolver)?e.messageResolver:A2||jye,R=Tn(e.localeFallbacker)?e.localeFallbacker:k2||lwe,T=an(e.fallbackContext)?e.fallbackContext:void 0,I=e,x=an(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,P=an(I.__numberFormatters)?I.__numberFormatters:new Map,D=an(I.__meta)?I.__meta:{};L2++;const F={version:n,cid:L2,locale:s,fallbackLocale:i,messages:r,modifiers:u,pluralRules:c,missing:d,missingWarn:h,fallbackWarn:f,fallbackFormat:p,unresolving:g,postTranslation:v,processor:C,warnHtmlMessage:S,escapeParameter:b,messageCompiler:w,messageResolver:_,localeFallbacker:R,fallbackContext:T,onWarn:t,__meta:D};return F.datetimeFormats=a,F.numberFormats=l,F.__datetimeFormatters=x,F.__numberFormatters=P,K.env.NODE_ENV!=="production"&&(F.__v_emitter=I.__v_emitter!=null?I.__v_emitter:void 0),(K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&swe(F,n,D),F}const n_=e=>({[e]:Dn()});function Dy(e,t){return e instanceof RegExp?e.test(t):e}function V2(e,t){return e instanceof RegExp?e.test(t):e}function s_(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(K.env.NODE_ENV!=="production"){const a=e.__v_emitter;a&&a.emit("missing",{locale:n,key:t,type:o,groupId:`${o}:${t}`})}if(i!==null){const a=i(e,n,t,o);return vt(a)?a:t}else return K.env.NODE_ENV!=="production"&&V2(s,t)&&r(Iu(so.NOT_FOUND_KEY,{key:t,locale:n})),t}function fp(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function B2(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function wwe(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(B2(e,t[s]))return!0;return!1}function o_(e){return n=>Cwe(n,e)}function Cwe(e,t){const n=Oye(t);if(n==null)throw dp(0);if(Q0(n)===1){const i=Mye(n);return e.plural(i.reduce((r,a)=>[...r,$2(e,a)],[]))}else return $2(e,n)}function $2(e,t){const n=Nye(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=Lye(t).reduce((o,i)=>[...o,i_(e,i)],[]);return e.normalize(s)}}function i_(e,t){const n=Q0(t);switch(n){case 3:return Ey(t,n);case 9:return Ey(t,n);case 4:{const s=t;if($i(s,"k")&&s.k)return e.interpolate(e.named(s.k));if($i(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw dp(n)}case 5:{const s=t;if($i(s,"i")&&rs(s.i))return e.interpolate(e.list(s.i));if($i(s,"index")&&rs(s.index))return e.interpolate(e.list(s.index));throw dp(n)}case 6:{const s=t,o=Vye(s),i=Bye(s);return e.linked(i_(e,i),o?i_(e,o):void 0,e.type)}case 7:return Ey(t,n);case 8:return Ey(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const bwe="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function H2(e,t){t&&uye(e)&&fs(Z0(bwe,{source:e}))}const G2=e=>e;let Id=Dn();function U2(e){e.code===Sy.USE_MODULO_SYNTAX&&fs(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
244
244
  reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format
245
245
  (message compiler warning message: ${e.message})`)}function W2(e,t={}){let n=!1;const s=t.onError||aye;return t.onError=o=>{n=!0,s(o)},{...Aye(e,t),detectError:n}}const Swe=(e,t)=>{if(!vt(e))throw Tr(Ts.NOT_SUPPORT_NON_STRING_MESSAGE);K.env.NODE_ENV!=="production"&&(t.onWarn=U2);{const n=en(t.warnHtmlMessage)?t.warnHtmlMessage:!0;K.env.NODE_ENV!=="production"&&H2(e,n);const o=(t.onCacheKey||G2)(e),i=Id[o];if(i)return i;const{code:r,detectError:a}=W2(e,t),l=new Function(`return ${r}`)();return a?l:Id[o]=l}};function Ewe(e,t){if(K.env.NODE_ENV!=="production"&&(t.onWarn=U2),__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&vt(e)){const n=en(t.warnHtmlMessage)?t.warnHtmlMessage:!0;K.env.NODE_ENV!=="production"&&H2(e,n);const o=(t.onCacheKey||G2)(e),i=Id[o];if(i)return i;const{ast:r,detectError:a}=W2(e,{...t,location:K.env.NODE_ENV!=="production",jit:!0}),l=o_(r);return a?l:Id[o]=l}else{if(K.env.NODE_ENV!=="production"&&!hi(e))return fs(`the message that is resolve with key '${t.key}' is not supported for jit compilation`),()=>e;const n=e.cacheKey;if(n){const s=Id[n];return s||(Id[n]=o_(e))}else return o_(e)}}const z2=()=>"",fi=e=>Tn(e);function j2(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:a}=e,[l,u]=r_(...t),c=en(u.missingWarn)?u.missingWarn:e.missingWarn,d=en(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,h=en(u.escapeParameter)?u.escapeParameter:e.escapeParameter,f=!!u.resolvedMessage,p=vt(u.default)||en(u.default)?en(u.default)?i?l:()=>l:u.default:n?i?l:()=>l:"",g=n||p!=="",v=e_(e,u);h&&_we(u);let[C,S,b]=f?[l,v,a[v]||Dn()]:K2(e,l,v,r,d,c),w=C,_=l;if(!f&&!(vt(w)||hi(w)||fi(w))&&g&&(w=p,_=w),!f&&(!(vt(w)||hi(w)||fi(w))||!vt(S)))return o?_y:l;if(K.env.NODE_ENV!=="production"&&vt(w)&&e.messageCompiler==null)return fs(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`),l;let R=!1;const T=()=>{R=!0},I=fi(w)?w:q2(e,l,S,w,_,T);if(R)return w;const x=Iwe(e,S,b,u),P=twe(x),D=Rwe(e,I,P);let F=s?s(D,l):D;if(h&&vt(F)&&(F=Yve(F)),K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const k={timestamp:Date.now(),key:vt(l)?l:fi(w)?w.key:"",locale:S||(fi(w)?w.locale:""),format:vt(w)?w:fi(w)?w.source:"",message:F};k.meta=Ms({},e.__meta,mwe()||{}),owe(k)}return F}function _we(e){An(e.list)?e.list=e.list.map(t=>vt(t)?t2(t):t):an(e.named)&&Object.keys(e.named).forEach(t=>{vt(e.named[t])&&(e.named[t]=t2(e.named[t]))})}function K2(e,t,n,s,o,i){const{messages:r,onWarn:a,messageResolver:l,localeFallbacker:u}=e,c=u(e,s,n);let d=Dn(),h,f=null,p=n,g=null;const v="translate";for(let C=0;C<c.length;C++){if(h=g=c[C],K.env.NODE_ENV!=="production"&&n!==h&&!B2(n,h)&&Dy(o,t)&&a(Iu(so.FALLBACK_TO_TRANSLATE,{key:t,target:h})),K.env.NODE_ENV!=="production"&&n!==h){const _=e.__v_emitter;_&&_.emit("fallback",{type:v,key:t,from:p,to:g,groupId:`${v}:${t}`})}d=r[h]||Dn();let S=null,b,w;if(K.env.NODE_ENV!=="production"&&Bi&&(S=window.performance.now(),b="intlify-message-resolve-start",w="intlify-message-resolve-end",Go&&Go(b)),(f=l(d,t))===null&&(f=d[t]),K.env.NODE_ENV!=="production"&&Bi){const _=window.performance.now(),R=e.__v_emitter;R&&S&&f&&R.emit("message-resolve",{type:"message-resolve",key:t,message:f,time:_-S,groupId:`${v}:${t}`}),b&&w&&Go&&Du&&(Go(w),Du("intlify message resolve",b,w))}if(vt(f)||hi(f)||fi(f))break;if(!wwe(h,c)){const _=s_(e,t,h,i,v);_!==t&&(f=_)}p=g}return[f,h,d]}function q2(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:a}=e;if(fi(s)){const h=s;return h.locale=h.locale||n,h.key=h.key||t,h}if(r==null){const h=()=>s;return h.locale=n,h.key=t,h}let l=null,u,c;K.env.NODE_ENV!=="production"&&Bi&&(l=window.performance.now(),u="intlify-message-compilation-start",c="intlify-message-compilation-end",Go&&Go(u));const d=r(s,Dwe(e,n,o,s,a,i));if(K.env.NODE_ENV!=="production"&&Bi){const h=window.performance.now(),f=e.__v_emitter;f&&l&&f.emit("message-compilation",{type:"message-compilation",message:s,time:h-l,groupId:`translate:${t}`}),u&&c&&Go&&Du&&(Go(c),Du("intlify message compilation",u,c))}return d.locale=n,d.key=t,d.source=s,d}function Rwe(e,t,n){let s=null,o,i;K.env.NODE_ENV!=="production"&&Bi&&(s=window.performance.now(),o="intlify-message-evaluation-start",i="intlify-message-evaluation-end",Go&&Go(o));const r=t(n);if(K.env.NODE_ENV!=="production"&&Bi){const a=window.performance.now(),l=e.__v_emitter;l&&s&&l.emit("message-evaluation",{type:"message-evaluation",value:r,time:a-s,groupId:`translate:${t.key}`}),o&&i&&Go&&Du&&(Go(i),Du("intlify message evaluation",o,i))}return r}function r_(...e){const[t,n,s]=e,o=Dn();if(!vt(t)&&!rs(t)&&!fi(t)&&!hi(t))throw Tr(Ts.INVALID_ARGUMENT);const i=rs(t)?String(t):(fi(t),t);return rs(n)?o.plural=n:vt(n)?o.default=n:Gt(n)&&!vy(n)?o.named=n:An(n)&&(o.list=n),rs(s)?o.plural=s:vt(s)?o.default=s:Gt(s)&&Ms(o,s),[i,o]}function Dwe(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{if(i&&i(r),K.env.NODE_ENV!=="production"){const a=Twe(s),l=`Message compilation error: ${r.message}`,u=r.location&&a&&eye(a,r.location.start.offset,r.location.end.offset),c=e.__v_emitter;c&&a&&c.emit("compile-error",{message:a,error:r.message,start:r.location&&r.location.start.offset,end:r.location&&r.location.end.offset,groupId:`translate:${n}`}),console.error(u?`${l}
246
246
  ${u}`:l)}else throw r},onCacheKey:r=>zve(t,n,r)}}function Twe(e){if(vt(e))return e;if(e.loc&&e.loc.source)return e.loc.source}function Iwe(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:a,fallbackWarn:l,missingWarn:u,fallbackContext:c}=e,h={locale:t,modifiers:o,pluralRules:i,messages:f=>{let p=r(n,f);if(p==null&&c){const[,,g]=K2(c,f,t,a,l,u);p=r(g,f)}if(vt(p)||hi(p)){let g=!1;const C=q2(e,f,t,p,f,()=>{g=!0});return g?z2:C}else return fi(p)?p:z2}};return e.processor&&(h.processor=e.processor),s.list&&(h.list=s.list),s.named&&(h.named=s.named),rs(s.plural)&&(h.pluralIndex=s.plural),h}const Y2=typeof Intl<"u",Z2={dateTimeFormat:Y2&&typeof Intl.DateTimeFormat<"u",numberFormat:Y2&&typeof Intl.NumberFormat<"u"};function X2(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:a}=e;if(K.env.NODE_ENV!=="production"&&!Z2.dateTimeFormat)return i(Iu(so.CANNOT_FORMAT_DATE)),Ry;const[l,u,c,d]=a_(...t),h=en(c.missingWarn)?c.missingWarn:e.missingWarn,f=en(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=!!c.part,g=e_(e,c),v=r(e,o,g);if(!vt(l)||l==="")return new Intl.DateTimeFormat(g,d).format(u);let C={},S,b=null,w=g,_=null;const R="datetime format";for(let x=0;x<v.length;x++){if(S=_=v[x],K.env.NODE_ENV!=="production"&&g!==S&&Dy(f,l)&&i(Iu(so.FALLBACK_TO_DATE_FORMAT,{key:l,target:S})),K.env.NODE_ENV!=="production"&&g!==S){const P=e.__v_emitter;P&&P.emit("fallback",{type:R,key:l,from:w,to:_,groupId:`${R}:${l}`})}if(C=n[S]||{},b=C[l],Gt(b))break;s_(e,l,S,h,R),w=_}if(!Gt(b)||!vt(S))return s?_y:l;let T=`${S}__${l}`;vy(d)||(T=`${T}__${JSON.stringify(d)}`);let I=a.get(T);return I||(I=new Intl.DateTimeFormat(S,Ms({},b,d)),a.set(T,I)),p?I.formatToParts(u):I.format(u)}const J2=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function a_(...e){const[t,n,s,o]=e,i=Dn();let r=Dn(),a;if(vt(t)){const l=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!l)throw Tr(Ts.INVALID_ISO_DATE_ARGUMENT);const u=l[3]?l[3].trim().startsWith("T")?`${l[1].trim()}${l[3].trim()}`:`${l[1].trim()}T${l[3].trim()}`:l[1].trim();a=new Date(u);try{a.toISOString()}catch{throw Tr(Ts.INVALID_ISO_DATE_ARGUMENT)}}else if(Kve(t)){if(isNaN(t.getTime()))throw Tr(Ts.INVALID_DATE_ARGUMENT);a=t}else if(rs(t))a=t;else throw Tr(Ts.INVALID_ARGUMENT);return vt(n)?i.key=n:Gt(n)&&Object.keys(n).forEach(l=>{J2.includes(l)?r[l]=n[l]:i[l]=n[l]}),vt(s)?i.locale=s:Gt(s)&&(r=s),Gt(o)&&(r=o),[i.key||"",a,i,r]}function Q2(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function eB(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:a}=e;if(K.env.NODE_ENV!=="production"&&!Z2.numberFormat)return i(Iu(so.CANNOT_FORMAT_NUMBER)),Ry;const[l,u,c,d]=l_(...t),h=en(c.missingWarn)?c.missingWarn:e.missingWarn,f=en(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=!!c.part,g=e_(e,c),v=r(e,o,g);if(!vt(l)||l==="")return new Intl.NumberFormat(g,d).format(u);let C={},S,b=null,w=g,_=null;const R="number format";for(let x=0;x<v.length;x++){if(S=_=v[x],K.env.NODE_ENV!=="production"&&g!==S&&Dy(f,l)&&i(Iu(so.FALLBACK_TO_NUMBER_FORMAT,{key:l,target:S})),K.env.NODE_ENV!=="production"&&g!==S){const P=e.__v_emitter;P&&P.emit("fallback",{type:R,key:l,from:w,to:_,groupId:`${R}:${l}`})}if(C=n[S]||{},b=C[l],Gt(b))break;s_(e,l,S,h,R),w=_}if(!Gt(b)||!vt(S))return s?_y:l;let T=`${S}__${l}`;vy(d)||(T=`${T}__${JSON.stringify(d)}`);let I=a.get(T);return I||(I=new Intl.NumberFormat(S,Ms({},b,d)),a.set(T,I)),p?I.formatToParts(u):I.format(u)}const tB=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function l_(...e){const[t,n,s,o]=e,i=Dn();let r=Dn();if(!rs(t))throw Tr(Ts.INVALID_ARGUMENT);const a=t;return vt(n)?i.key=n:Gt(n)&&Object.keys(n).forEach(l=>{tB.includes(l)?r[l]=n[l]:i[l]=n[l]}),vt(s)?i.locale=s:Gt(s)&&(r=s),Gt(o)&&(r=o),[i.key||"",a,i,r]}function nB(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}kye();function xwe(){return sB().__VUE_DEVTOOLS_GLOBAL_HOOK__}function sB(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Fwe=typeof Proxy=="function",Pwe="devtools-plugin:setup",Awe="plugin:settings:set";let xd,u_;function kwe(){var e;return xd!==void 0||(typeof window<"u"&&window.performance?(xd=!0,u_=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(xd=!0,u_=globalThis.perf_hooks.performance):xd=!1),xd}function Owe(){return kwe()?u_.now():Date.now()}class Mwe{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const s={};if(t.settings)for(const r in t.settings){const a=t.settings[r];s[r]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let i=Object.assign({},s);try{const r=localStorage.getItem(o),a=JSON.parse(r);Object.assign(i,a)}catch{}this.fallbacks={getSettings(){return i},setSettings(r){try{localStorage.setItem(o,JSON.stringify(r))}catch{}i=r},now(){return Owe()}},n&&n.on(Awe,(r,a)=>{r===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(r,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(r,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(u=>{this.targetQueue.push({method:a,args:l,resolve:u})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Nwe(e,t){const n=e,s=sB(),o=xwe(),i=Fwe&&n.enableEarlyProxy;if(o&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(Pwe,e,t);else{const r=i?new Mwe(n,o):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:r}),r&&t(r.proxiedTarget)}}/*!
@@ -250,4 +250,4 @@ ${u}`:l)}else throw r},onCacheKey:r=>zve(t,n,r)}}function Twe(e){if(vt(e))return
250
250
  */const Lwe="9.14.5";function Vwe(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(pa().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(pa().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(pa().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(pa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(pa().__INTLIFY_PROD_DEVTOOLS__=!1)}const oB=so.__EXTEND_POINT__,ma=yy(oB),Wn={FALLBACK_TO_ROOT:oB,NOT_SUPPORTED_PRESERVE:ma(),NOT_SUPPORTED_FORMATTER:ma(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:ma(),NOT_SUPPORTED_GET_CHOICE_INDEX:ma(),COMPONENT_NAME_LEGACY_COMPATIBLE:ma(),NOT_FOUND_PARENT_SCOPE:ma(),IGNORE_OBJ_FLATTEN:ma(),NOTICE_DROP_ALLOW_COMPOSITION:ma(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:ma()},Bwe={[Wn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Wn.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[Wn.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[Wn.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[Wn.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[Wn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Wn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Wn.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[Wn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function yo(e,...t){return Z0(Bwe[e],...t)}const iB=Ts.__EXTEND_POINT__,wo=yy(iB),cn={UNEXPECTED_RETURN_TYPE:iB,INVALID_ARGUMENT:wo(),MUST_BE_CALL_SETUP_TOP:wo(),NOT_INSTALLED:wo(),NOT_AVAILABLE_IN_LEGACY_MODE:wo(),REQUIRED_VALUE:wo(),INVALID_VALUE:wo(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:wo(),NOT_INSTALLED_WITH_PROVIDE:wo(),UNEXPECTED_ERROR:wo(),NOT_COMPATIBLE_LEGACY_VUE_I18N:wo(),BRIDGE_SUPPORT_VUE_2_ONLY:wo(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:wo(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:wo(),__EXTEND_POINT__:wo()};function Es(e,...t){return _d(e,null,K.env.NODE_ENV!=="production"?{messages:$we,args:t}:void 0)}const $we={[cn.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[cn.INVALID_ARGUMENT]:"Invalid argument",[cn.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[cn.NOT_INSTALLED]:"Need to install with `app.use` function",[cn.UNEXPECTED_ERROR]:"Unexpected error",[cn.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[cn.REQUIRED_VALUE]:"Required in value: {0}",[cn.INVALID_VALUE]:"Invalid value",[cn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[cn.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[cn.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[cn.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[cn.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",[cn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},c_=Dr("__translateVNode"),d_=Dr("__datetimeParts"),h_=Dr("__numberParts"),Fu=Dr("__enableEmitter"),pp=Dr("__disableEmitter"),rB=Dr("__setPluralRules"),aB=Dr("__injectWithOption"),f_=Dr("__dispose");function gp(e){if(!an(e)||hi(e))return e;for(const t in e)if($i(e,t))if(!t.includes("."))an(e[t])&&gp(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Dn()),!an(o[n[r]])){K.env.NODE_ENV!=="production"&&fs(yo(Wn.IGNORE_OBJ_FLATTEN,{key:n[r]})),i=!0;break}o=o[n[r]]}if(i||(hi(o)?b2.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!hi(o)){const r=o[n[s]];an(r)&&gp(r)}}return e}function Ty(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Gt(n)?n:An(s)?Dn():{[e]:Dn()};if(An(s)&&s.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(r[l]=r[l]||Dn(),Cy(u,r[l])):Cy(u,r)}else vt(a)&&Cy(JSON.parse(a),r)}),o==null&&i)for(const a in r)$i(r,a)&&gp(r[a]);return r}function lB(e){return e.type}function uB(e,t,n){let s=an(t.messages)?t.messages:Dn();"__i18nGlobal"in n&&(s=Ty(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(an(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(an(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function cB(e){return fe(Ra,null,e,0)}const dB="__INTLIFY_META__",hB=()=>[],Hwe=()=>!1;let fB=0;function pB(e){return(t,n,s,o)=>e(n,s,Yn()||void 0,o)}const Gwe=()=>{const e=Yn();let t=null;return e&&(t=lB(e)[dB])?{[dB]:t}:null};function p_(e={},t){const{__root:n,__injectWithOption:s}=e,o=n===void 0,i=e.flatJson,r=Bi?V:Gp,a=!!e.translateExistCompatible;K.env.NODE_ENV!=="production"&&a&&QV(yo(Wn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let l=en(e.inheritLocale)?e.inheritLocale:!0;const u=r(n&&l?n.locale.value:vt(e.locale)?e.locale:Td),c=r(n&&l?n.fallbackLocale.value:vt(e.fallbackLocale)||An(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:u.value),d=r(Ty(u.value,e)),h=r(Gt(e.datetimeFormats)?e.datetimeFormats:{[u.value]:{}}),f=r(Gt(e.numberFormats)?e.numberFormats:{[u.value]:{}});let p=n?n.missingWarn:en(e.missingWarn)||cl(e.missingWarn)?e.missingWarn:!0,g=n?n.fallbackWarn:en(e.fallbackWarn)||cl(e.fallbackWarn)?e.fallbackWarn:!0,v=n?n.fallbackRoot:en(e.fallbackRoot)?e.fallbackRoot:!0,C=!!e.fallbackFormat,S=Tn(e.missing)?e.missing:null,b=Tn(e.missing)?pB(e.missing):null,w=Tn(e.postTranslation)?e.postTranslation:null,_=n?n.warnHtmlMessage:en(e.warnHtmlMessage)?e.warnHtmlMessage:!0,R=!!e.escapeParameter;const T=n?n.modifiers:Gt(e.modifiers)?e.modifiers:{};let I=e.pluralRules||n&&n.pluralRules,x;x=(()=>{o&&N2(null);const Ee={version:Lwe,locale:u.value,fallbackLocale:c.value,messages:d.value,modifiers:T,pluralRules:I,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:g,fallbackFormat:C,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:_,escapeParameter:R,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};Ee.datetimeFormats=h.value,Ee.numberFormats=f.value,Ee.__datetimeFormatters=Gt(x)?x.__datetimeFormatters:void 0,Ee.__numberFormatters=Gt(x)?x.__numberFormatters:void 0,K.env.NODE_ENV!=="production"&&(Ee.__v_emitter=Gt(x)?x.__v_emitter:void 0);const Ve=ywe(Ee);return o&&N2(Ve),Ve})(),fp(x,u.value,c.value);function D(){return[u.value,c.value,d.value,h.value,f.value]}const F=Y({get:()=>u.value,set:Ee=>{u.value=Ee,x.locale=u.value}}),k=Y({get:()=>c.value,set:Ee=>{c.value=Ee,x.fallbackLocale=c.value,fp(x,u.value,Ee)}}),O=Y(()=>d.value),B=Y(()=>h.value),Z=Y(()=>f.value);function J(){return Tn(w)?w:null}function ee(Ee){w=Ee,x.postTranslation=Ee}function X(){return S}function ve(Ee){Ee!==null&&(b=pB(Ee)),S=Ee,x.missing=b}function ne(Ee,Ve){return Ee!=="translate"||!Ve.resolvedMessage}const L=(Ee,Ve,pt,At,Ut,Qt)=>{D();let zt;try{K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,o||(x.fallbackContext=n?vwe():void 0),zt=Ee(x)}finally{K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,o||(x.fallbackContext=void 0)}if(pt!=="translate exists"&&rs(zt)&&zt===_y||pt==="translate exists"&&!zt){const[Ne,je]=Ve();if(K.env.NODE_ENV!=="production"&&n&&vt(Ne)&&ne(pt,je)&&(v&&(Dy(g,Ne)||V2(p,Ne))&&fs(yo(Wn.FALLBACK_TO_ROOT,{key:Ne,type:pt})),K.env.NODE_ENV!=="production")){const{__v_emitter:yt}=x;yt&&v&&yt.emit("fallback",{type:pt,key:Ne,to:"global",groupId:`${pt}:${Ne}`})}return n&&v?At(n):Ut(Ne)}else{if(Qt(zt))return zt;throw Es(cn.UNEXPECTED_RETURN_TYPE)}};function H(...Ee){return L(Ve=>Reflect.apply(j2,null,[Ve,...Ee]),()=>r_(...Ee),"translate",Ve=>Reflect.apply(Ve.t,Ve,[...Ee]),Ve=>Ve,Ve=>vt(Ve))}function te(...Ee){const[Ve,pt,At]=Ee;if(At&&!an(At))throw Es(cn.INVALID_ARGUMENT);return H(Ve,pt,Ms({resolvedMessage:!0},At||{}))}function he(...Ee){return L(Ve=>Reflect.apply(X2,null,[Ve,...Ee]),()=>a_(...Ee),"datetime format",Ve=>Reflect.apply(Ve.d,Ve,[...Ee]),()=>Ry,Ve=>vt(Ve))}function me(...Ee){return L(Ve=>Reflect.apply(eB,null,[Ve,...Ee]),()=>l_(...Ee),"number format",Ve=>Reflect.apply(Ve.n,Ve,[...Ee]),()=>Ry,Ve=>vt(Ve))}function re(Ee){return Ee.map(Ve=>vt(Ve)||rs(Ve)||en(Ve)?cB(String(Ve)):Ve)}const z={normalize:re,interpolate:Ee=>Ee,type:"vnode"};function pe(...Ee){return L(Ve=>{let pt;const At=Ve;try{At.processor=z,pt=Reflect.apply(j2,null,[At,...Ee])}finally{At.processor=null}return pt},()=>r_(...Ee),"translate",Ve=>Ve[c_](...Ee),Ve=>[cB(Ve)],Ve=>An(Ve))}function ie(...Ee){return L(Ve=>Reflect.apply(eB,null,[Ve,...Ee]),()=>l_(...Ee),"number format",Ve=>Ve[h_](...Ee),hB,Ve=>vt(Ve)||An(Ve))}function be(...Ee){return L(Ve=>Reflect.apply(X2,null,[Ve,...Ee]),()=>a_(...Ee),"datetime format",Ve=>Ve[d_](...Ee),hB,Ve=>vt(Ve)||An(Ve))}function G(Ee){I=Ee,x.pluralRules=I}function q(Ee,Ve){return L(()=>{if(!Ee)return!1;const pt=vt(Ve)?Ve:u.value,At=Fe(pt),Ut=x.messageResolver(At,Ee);return a?Ut!=null:hi(Ut)||fi(Ut)||vt(Ut)},()=>[Ee],"translate exists",pt=>Reflect.apply(pt.te,pt,[Ee,Ve]),Hwe,pt=>en(pt))}function ce(Ee){let Ve=null;const pt=T2(x,c.value,u.value);for(let At=0;At<pt.length;At++){const Ut=d.value[pt[At]]||{},Qt=x.messageResolver(Ut,Ee);if(Qt!=null){Ve=Qt;break}}return Ve}function ke(Ee){const Ve=ce(Ee);return Ve??(n?n.tm(Ee)||{}:{})}function Fe(Ee){return d.value[Ee]||{}}function Le(Ee,Ve){if(i){const pt={[Ee]:Ve};for(const At in pt)$i(pt,At)&&gp(pt[At]);Ve=pt[Ee]}d.value[Ee]=Ve,x.messages=d.value}function ye(Ee,Ve){d.value[Ee]=d.value[Ee]||{};const pt={[Ee]:Ve};if(i)for(const At in pt)$i(pt,At)&&gp(pt[At]);Ve=pt[Ee],Cy(Ve,d.value[Ee]),x.messages=d.value}function M(Ee){return h.value[Ee]||{}}function $(Ee,Ve){h.value[Ee]=Ve,x.datetimeFormats=h.value,Q2(x,Ee,Ve)}function ae(Ee,Ve){h.value[Ee]=Ms(h.value[Ee]||{},Ve),x.datetimeFormats=h.value,Q2(x,Ee,Ve)}function Ge(Ee){return f.value[Ee]||{}}function we(Ee,Ve){f.value[Ee]=Ve,x.numberFormats=f.value,nB(x,Ee,Ve)}function ze(Ee,Ve){f.value[Ee]=Ms(f.value[Ee]||{},Ve),x.numberFormats=f.value,nB(x,Ee,Ve)}fB++,n&&Bi&&(tt(n.locale,Ee=>{l&&(u.value=Ee,x.locale=Ee,fp(x,u.value,c.value))}),tt(n.fallbackLocale,Ee=>{l&&(c.value=Ee,x.fallbackLocale=Ee,fp(x,u.value,c.value))}));const Ue={id:fB,locale:F,fallbackLocale:k,get inheritLocale(){return l},set inheritLocale(Ee){l=Ee,Ee&&n&&(u.value=n.locale.value,c.value=n.fallbackLocale.value,fp(x,u.value,c.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:O,get modifiers(){return T},get pluralRules(){return I||{}},get isGlobal(){return o},get missingWarn(){return p},set missingWarn(Ee){p=Ee,x.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(Ee){g=Ee,x.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot(Ee){v=Ee},get fallbackFormat(){return C},set fallbackFormat(Ee){C=Ee,x.fallbackFormat=C},get warnHtmlMessage(){return _},set warnHtmlMessage(Ee){_=Ee,x.warnHtmlMessage=Ee},get escapeParameter(){return R},set escapeParameter(Ee){R=Ee,x.escapeParameter=Ee},t:H,getLocaleMessage:Fe,setLocaleMessage:Le,mergeLocaleMessage:ye,getPostTranslationHandler:J,setPostTranslationHandler:ee,getMissingHandler:X,setMissingHandler:ve,[rB]:G};return Ue.datetimeFormats=B,Ue.numberFormats=Z,Ue.rt=te,Ue.te=q,Ue.tm=ke,Ue.d=he,Ue.n=me,Ue.getDateTimeFormat=M,Ue.setDateTimeFormat=$,Ue.mergeDateTimeFormat=ae,Ue.getNumberFormat=Ge,Ue.setNumberFormat=we,Ue.mergeNumberFormat=ze,Ue[aB]=s,Ue[c_]=pe,Ue[d_]=be,Ue[h_]=ie,K.env.NODE_ENV!=="production"&&(Ue[Fu]=Ee=>{x.__v_emitter=Ee},Ue[pp]=()=>{x.__v_emitter=void 0}),Ue}function Uwe(e){const t=vt(e.locale)?e.locale:Td,n=vt(e.fallbackLocale)||An(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Tn(e.missing)?e.missing:void 0,o=en(e.silentTranslationWarn)||cl(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=en(e.silentFallbackWarn)||cl(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=en(e.fallbackRoot)?e.fallbackRoot:!0,a=!!e.formatFallbackMessages,l=Gt(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=Tn(e.postTranslation)?e.postTranslation:void 0,d=vt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,f=en(e.sync)?e.sync:!0;K.env.NODE_ENV!=="production"&&e.formatter&&fs(yo(Wn.NOT_SUPPORTED_FORMATTER)),K.env.NODE_ENV!=="production"&&e.preserveDirectiveContent&&fs(yo(Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE));let p=e.messages;if(Gt(e.sharedMessages)){const R=e.sharedMessages;p=Object.keys(R).reduce((I,x)=>{const P=I[x]||(I[x]={});return Ms(P,R[x]),I},p||{})}const{__i18n:g,__root:v,__injectWithOption:C}=e,S=e.datetimeFormats,b=e.numberFormats,w=e.flatJson,_=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:p,flatJson:w,datetimeFormats:S,numberFormats:b,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:f,translateExistCompatible:_,__i18n:g,__root:v,__injectWithOption:C}}function g_(e={},t){{const n=p_(Uwe(e)),{__extender:s}=e,o={id:n.id,get locale(){return n.locale.value},set locale(i){n.locale.value=i},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(i){n.fallbackLocale.value=i},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 K.env.NODE_ENV!=="production"&&fs(yo(Wn.NOT_SUPPORTED_FORMATTER)),{interpolate(){return[]}}},set formatter(i){K.env.NODE_ENV!=="production"&&fs(yo(Wn.NOT_SUPPORTED_FORMATTER))},get missing(){return n.getMissingHandler()},set missing(i){n.setMissingHandler(i)},get silentTranslationWarn(){return en(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(i){n.missingWarn=en(i)?!i:i},get silentFallbackWarn(){return en(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(i){n.fallbackWarn=en(i)?!i:i},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(i){n.fallbackFormat=i},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(i){n.setPostTranslationHandler(i)},get sync(){return n.inheritLocale},set sync(i){n.inheritLocale=i},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){n.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(i){n.escapeParameter=i},get preserveDirectiveContent(){return K.env.NODE_ENV!=="production"&&fs(yo(Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE)),!0},set preserveDirectiveContent(i){K.env.NODE_ENV!=="production"&&fs(yo(Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE))},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...i){const[r,a,l]=i,u={};let c=null,d=null;if(!vt(r))throw Es(cn.INVALID_ARGUMENT);const h=r;return vt(a)?u.locale=a:An(a)?c=a:Gt(a)&&(d=a),An(l)?c=l:Gt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},rt(...i){return Reflect.apply(n.rt,n,[...i])},tc(...i){const[r,a,l]=i,u={plural:1};let c=null,d=null;if(!vt(r))throw Es(cn.INVALID_ARGUMENT);const h=r;return vt(a)?u.locale=a:rs(a)?u.plural=a:An(a)?c=a:Gt(a)&&(d=a),vt(l)?u.locale=l:An(l)?c=l:Gt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},te(i,r){return n.te(i,r)},tm(i){return n.tm(i)},getLocaleMessage(i){return n.getLocaleMessage(i)},setLocaleMessage(i,r){n.setLocaleMessage(i,r)},mergeLocaleMessage(i,r){n.mergeLocaleMessage(i,r)},d(...i){return Reflect.apply(n.d,n,[...i])},getDateTimeFormat(i){return n.getDateTimeFormat(i)},setDateTimeFormat(i,r){n.setDateTimeFormat(i,r)},mergeDateTimeFormat(i,r){n.mergeDateTimeFormat(i,r)},n(...i){return Reflect.apply(n.n,n,[...i])},getNumberFormat(i){return n.getNumberFormat(i)},setNumberFormat(i,r){n.setNumberFormat(i,r)},mergeNumberFormat(i,r){n.mergeNumberFormat(i,r)},getChoiceIndex(i,r){return K.env.NODE_ENV!=="production"&&fs(yo(Wn.NOT_SUPPORTED_GET_CHOICE_INDEX)),-1}};return o.__extender=s,K.env.NODE_ENV!=="production"&&(o.__enableEmitter=i=>{const r=n;r[Fu]&&r[Fu](i)},o.__disableEmitter=()=>{const i=n;i[pp]&&i[pp]()}),o}}const m_={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Wwe({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===xt?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Dn())}function gB(e){return xt}const v_=rt({name:"i18n-t",props:Ms({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>rs(e)||!isNaN(e)}},m_),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||b_({useScope:e.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter(d=>d!=="_"),r=Dn();e.locale&&(r.locale=e.locale),e.plural!==void 0&&(r.plural=vt(e.plural)?+e.plural:e.plural);const a=Wwe(t,i),l=o[c_](e.keypath,a,r),u=Ms(Dn(),s),c=vt(e.tag)||an(e.tag)?e.tag:gB();return Zu(c,u,l)}}});function zwe(e){return An(e)&&!vt(e[0])}function mB(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r={part:!0};let a=Dn();e.locale&&(r.locale=e.locale),vt(e.format)?r.key=e.format:an(e.format)&&(vt(e.format.key)&&(r.key=e.format.key),a=Object.keys(e.format).reduce((h,f)=>n.includes(f)?Ms(Dn(),h,{[f]:e.format[f]}):h,Dn()));const l=s(e.value,r,a);let u=[r.key];An(l)?u=l.map((h,f)=>{const p=o[h.type],g=p?p({[h.type]:h.value,index:f,parts:l}):[h.value];return zwe(g)&&(g[0].key=`${h.type}-${f}`),g}):vt(l)&&(u=[l]);const c=Ms(Dn(),i),d=vt(e.tag)||an(e.tag)?e.tag:gB();return Zu(d,c,u)}}const vB=rt({name:"i18n-n",props:Ms({value:{type:Number,required:!0},format:{type:[String,Object]}},m_),setup(e,t){const n=e.i18n||b_({useScope:e.scope,__useComponent:!0});return mB(e,t,tB,(...s)=>n[h_](...s))}}),yB=rt({name:"i18n-d",props:Ms({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},m_),setup(e,t){const n=e.i18n||b_({useScope:e.scope,__useComponent:!0});return mB(e,t,J2,(...s)=>n[d_](...s))}});function jwe(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function Kwe(e){const t=r=>{const{instance:a,modifiers:l,value:u}=r;if(!a||!a.$)throw Es(cn.UNEXPECTED_ERROR);const c=jwe(e,a.$);K.env.NODE_ENV!=="production"&&l.preserve&&fs(yo(Wn.NOT_SUPPORTED_PRESERVE));const d=wB(u);return[Reflect.apply(c.t,c,[...CB(d)]),c]};return{created:(r,a)=>{const[l,u]=t(a);Bi&&e.global===u&&(r.__i18nWatcher=tt(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),r.__composer=u,r.textContent=l},unmounted:r=>{Bi&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:a})=>{if(r.__composer){const l=r.__composer,u=wB(a);r.textContent=Reflect.apply(l.t,l,[...CB(u)])}},getSSRProps:r=>{const[a]=t(r);return{textContent:a}}}}function wB(e){if(vt(e))return{path:e};if(Gt(e)){if(!("path"in e))throw Es(cn.REQUIRED_VALUE,"path");return e}else throw Es(cn.INVALID_VALUE)}function CB(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},a=s||{};return vt(n)&&(r.locale=n),rs(o)&&(r.plural=o),rs(i)&&(r.plural=i),[t,a,r]}function qwe(e,t,...n){const s=Gt(n[0])?n[0]:{},o=!!s.useI18nComponentName,i=en(s.globalInstall)?s.globalInstall:!0;K.env.NODE_ENV!=="production"&&i&&o&&fs(yo(Wn.COMPONENT_NAME_LEGACY_COMPATIBLE,{name:v_.name})),i&&([o?"i18n":v_.name,"I18nT"].forEach(r=>e.component(r,v_)),[vB.name,"I18nN"].forEach(r=>e.component(r,vB)),[yB.name,"I18nD"].forEach(r=>e.component(r,yB))),e.directive("t",Kwe(t))}const y_={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},Ywe={"vue-i18n-resource-inspector":"Search for scopes ..."},Zwe={"vue-i18n-timeline":16764185},bB="vue-i18n: composer properties";let w_;async function Xwe(e,t){return new Promise((n,s)=>{try{Nwe({id:"vue-devtools-plugin-vue-i18n",label:y_["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:[bB],app:e},o=>{w_=o,o.on.visitComponentTree(({componentInstance:r,treeNode:a})=>{Jwe(r,a,t)}),o.on.inspectComponent(({componentInstance:r,instanceData:a})=>{r.vnode.el&&r.vnode.el.__VUE_I18N__&&a&&(t.mode==="legacy"?r.vnode.el.__VUE_I18N__!==t.global.__composer&&EB(a,r.vnode.el.__VUE_I18N__):EB(a,r.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:y_["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:Ywe["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(r=>{r.app===e&&r.inspectorId==="vue-i18n-resource-inspector"&&sCe(r,t)});const i=new Map;o.on.getInspectorState(async r=>{if(r.app===e&&r.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),iCe(r,t),r.nodeId==="global"){if(!i.has(r.app)){const[a]=await o.getComponentInstances(r.app);i.set(r.app,a)}o.highlightElement(i.get(r.app))}else{const a=oCe(r.nodeId,t);a&&o.highlightElement(a)}}),o.on.editInspectorState(r=>{r.app===e&&r.inspectorId==="vue-i18n-resource-inspector"&&aCe(r,t)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:y_["vue-i18n-timeline"],color:Zwe["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),s(!1)}})}function SB(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function Jwe(e,t,n){const s=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==s){const o={label:`i18n (${SB(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(o)}}function EB(e,t){const n=bB;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:C_(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 C_(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];Tn(s)&&"source"in s?t[n]=nCe(s):hi(s)&&s.loc&&s.loc.source?t[n]=s.loc.source:an(s)?t[n]=C_(s):t[n]=s}),t}const Qwe={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function eCe(e){return e.replace(/[<>"&]/g,tCe)}function tCe(e){return Qwe[e]||e}function nCe(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${eCe(e.source)}")`:"(?)"}`}}}function sCe(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[s,o]of t.__instances){const i=t.mode==="composition"?o:o.__composer;n!==i&&e.rootNodes.push({id:i.id.toString(),label:`${SB(s)} Scope`})}}function oCe(e,t){let n=null;if(e!=="global"){for(const[s,o]of t.__instances.entries())if(o.id.toString()===e){n=s;break}}return n}function _B(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(s=>s.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function iCe(e,t){const n=_B(e.nodeId,t);return n&&(e.state=rCe(n)),null}function rCe(e){const t={},n="Locale related info",s=[{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]=s;const o="Locale messages info",i=[{type:o,key:"messages",editable:!1,value:C_(e.messages.value)}];t[o]=i;{const r="Datetime formats info",a=[{type:r,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[r]=a;const l="Datetime formats info",u=[{type:l,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[l]=u}return t}function mp(e,t){if(w_){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),w_.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 aCe(e,t){const n=_B(e.nodeId,t);if(n){const[s]=e.path;s==="locale"&&vt(e.state.value)?n.locale.value=e.state.value:s==="fallbackLocale"&&(vt(e.state.value)||An(e.state.value)||an(e.state.value))?n.fallbackLocale.value=e.state.value:s==="inheritLocale"&&en(e.state.value)&&(n.inheritLocale=e.state.value)}}function lCe(e,t,n){return{beforeCreate(){const s=Yn();if(!s)throw Es(cn.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=RB(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=g_(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=RB(e,o);else{this.$i18n=g_({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&uB(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$tc=(...i)=>this.$i18n.tc(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){if(K.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const s=this.$i18n;this.$el.__VUE_I18N__=s.__composer;const o=this.__v_emitter=X0();s.__enableEmitter&&s.__enableEmitter(o),o.on("*",mp)}},unmounted(){const s=Yn();if(!s)throw Es(cn.UNEXPECTED_ERROR);const o=this.$i18n;K.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",mp),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__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,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function RB(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[rB](t.pluralizationRules||e.pluralizationRules);const n=Ty(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const uCe=Dr("global-vue-i18n");function cCe(e={},t){const n=__VUE_I18N_LEGACY_API__&&en(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,s=en(e.globalInjection)?e.globalInjection:!0,o=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,i=new Map,[r,a]=dCe(e,n),l=Dr(K.env.NODE_ENV!=="production"?"vue-i18n":"");K.env.NODE_ENV!=="production"&&n&&o&&fs(yo(Wn.NOTICE_DROP_ALLOW_COMPOSITION));function u(h){return i.get(h)||null}function c(h,f){i.set(h,f)}function d(h){i.delete(h)}{const h={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return o},async install(f,...p){if(K.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=h),f.__VUE_I18N_SYMBOL__=l,f.provide(f.__VUE_I18N_SYMBOL__,h),Gt(p[0])){const C=p[0];h.__composerExtend=C.__composerExtend,h.__vueI18nExtend=C.__vueI18nExtend}let g=null;!n&&s&&(g=CCe(f,h.global)),__VUE_I18N_FULL_INSTALL__&&qwe(f,h,...p),__VUE_I18N_LEGACY_API__&&n&&f.mixin(lCe(a,a.__composer,h));const v=f.unmount;if(f.unmount=()=>{g&&g(),h.dispose(),v()},K.env.NODE_ENV!=="production"){if(!await Xwe(f,h))throw Es(cn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const S=X0();if(n){const b=a;b.__enableEmitter&&b.__enableEmitter(S)}else{const b=a;b[Fu]&&b[Fu](S)}S.on("*",mp)}},get global(){return a},dispose(){r.stop()},__instances:i,__getInstance:u,__setInstance:c,__deleteInstance:d};return h}}function b_(e={}){const t=Yn();if(t==null)throw Es(cn.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Es(cn.NOT_INSTALLED);const n=hCe(t),s=pCe(n),o=lB(t),i=fCe(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Es(cn.NOT_AVAILABLE_IN_LEGACY_MODE);return yCe(t,i,s,e)}if(i==="global")return uB(s,e,o),s;if(i==="parent"){let l=gCe(n,t,e.__useComponent);return l==null&&(K.env.NODE_ENV!=="production"&&fs(yo(Wn.NOT_FOUND_PARENT_SCOPE)),l=s),l}const r=n;let a=r.__getInstance(t);if(a==null){const l=Ms({},e);"__i18n"in o&&(l.__i18n=o.__i18n),s&&(l.__root=s),a=p_(l),r.__composerExtend&&(a[f_]=r.__composerExtend(a)),vCe(r,t,a),r.__setInstance(t,a)}return a}function dCe(e,t,n){const s=ew();{const o=__VUE_I18N_LEGACY_API__&&t?s.run(()=>g_(e)):s.run(()=>p_(e));if(o==null)throw Es(cn.UNEXPECTED_ERROR);return[s,o]}}function hCe(e){{const t=_n(e.isCE?uCe:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Es(e.isCE?cn.NOT_INSTALLED_WITH_PROVIDE:cn.UNEXPECTED_ERROR);return t}}function fCe(e,t){return vy(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function pCe(e){return e.mode==="composition"?e.global:e.global.__composer}function gCe(e,t,n=!1){let s=null;const o=t.root;let i=mCe(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const a=r.__getInstance(i);a!=null&&(s=a.__composer,n&&s&&!s[aB]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function mCe(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function vCe(e,t,n){let s=null;nn(()=>{if(K.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,s=X0();const o=n;o[Fu]&&o[Fu](s),s.on("*",mp)}},t),Il(()=>{const o=n;K.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(s&&s.off("*",mp),o[pp]&&o[pp](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const i=o[f_];i&&(i(),delete o[f_])},t)}function yCe(e,t,n,s={}){const o=t==="local",i=Gp(null);if(o&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Es(cn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const r=en(s.inheritLocale)?s.inheritLocale:!vt(s.locale),a=V(!o||r?n.locale.value:vt(s.locale)?s.locale:Td),l=V(!o||r?n.fallbackLocale.value:vt(s.fallbackLocale)||An(s.fallbackLocale)||Gt(s.fallbackLocale)||s.fallbackLocale===!1?s.fallbackLocale:a.value),u=V(Ty(a.value,s)),c=V(Gt(s.datetimeFormats)?s.datetimeFormats:{[a.value]:{}}),d=V(Gt(s.numberFormats)?s.numberFormats:{[a.value]:{}}),h=o?n.missingWarn:en(s.missingWarn)||cl(s.missingWarn)?s.missingWarn:!0,f=o?n.fallbackWarn:en(s.fallbackWarn)||cl(s.fallbackWarn)?s.fallbackWarn:!0,p=o?n.fallbackRoot:en(s.fallbackRoot)?s.fallbackRoot:!0,g=!!s.fallbackFormat,v=Tn(s.missing)?s.missing:null,C=Tn(s.postTranslation)?s.postTranslation:null,S=o?n.warnHtmlMessage:en(s.warnHtmlMessage)?s.warnHtmlMessage:!0,b=!!s.escapeParameter,w=o?n.modifiers:Gt(s.modifiers)?s.modifiers:{},_=s.pluralRules||o&&n.pluralRules;function R(){return[a.value,l.value,u.value,c.value,d.value]}const T=Y({get:()=>i.value?i.value.locale.value:a.value,set:q=>{i.value&&(i.value.locale.value=q),a.value=q}}),I=Y({get:()=>i.value?i.value.fallbackLocale.value:l.value,set:q=>{i.value&&(i.value.fallbackLocale.value=q),l.value=q}}),x=Y(()=>i.value?i.value.messages.value:u.value),P=Y(()=>c.value),D=Y(()=>d.value);function F(){return i.value?i.value.getPostTranslationHandler():C}function k(q){i.value&&i.value.setPostTranslationHandler(q)}function O(){return i.value?i.value.getMissingHandler():v}function B(q){i.value&&i.value.setMissingHandler(q)}function Z(q){return R(),q()}function J(...q){return i.value?Z(()=>Reflect.apply(i.value.t,null,[...q])):Z(()=>"")}function ee(...q){return i.value?Reflect.apply(i.value.rt,null,[...q]):""}function X(...q){return i.value?Z(()=>Reflect.apply(i.value.d,null,[...q])):Z(()=>"")}function ve(...q){return i.value?Z(()=>Reflect.apply(i.value.n,null,[...q])):Z(()=>"")}function ne(q){return i.value?i.value.tm(q):{}}function L(q,ce){return i.value?i.value.te(q,ce):!1}function H(q){return i.value?i.value.getLocaleMessage(q):{}}function te(q,ce){i.value&&(i.value.setLocaleMessage(q,ce),u.value[q]=ce)}function he(q,ce){i.value&&i.value.mergeLocaleMessage(q,ce)}function me(q){return i.value?i.value.getDateTimeFormat(q):{}}function re(q,ce){i.value&&(i.value.setDateTimeFormat(q,ce),c.value[q]=ce)}function oe(q,ce){i.value&&i.value.mergeDateTimeFormat(q,ce)}function z(q){return i.value?i.value.getNumberFormat(q):{}}function pe(q,ce){i.value&&(i.value.setNumberFormat(q,ce),d.value[q]=ce)}function ie(q,ce){i.value&&i.value.mergeNumberFormat(q,ce)}const be={get id(){return i.value?i.value.id:-1},locale:T,fallbackLocale:I,messages:x,datetimeFormats:P,numberFormats:D,get inheritLocale(){return i.value?i.value.inheritLocale:r},set inheritLocale(q){i.value&&(i.value.inheritLocale=q)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(u.value)},get modifiers(){return i.value?i.value.modifiers:w},get pluralRules(){return i.value?i.value.pluralRules:_},get isGlobal(){return i.value?i.value.isGlobal:!1},get missingWarn(){return i.value?i.value.missingWarn:h},set missingWarn(q){i.value&&(i.value.missingWarn=q)},get fallbackWarn(){return i.value?i.value.fallbackWarn:f},set fallbackWarn(q){i.value&&(i.value.missingWarn=q)},get fallbackRoot(){return i.value?i.value.fallbackRoot:p},set fallbackRoot(q){i.value&&(i.value.fallbackRoot=q)},get fallbackFormat(){return i.value?i.value.fallbackFormat:g},set fallbackFormat(q){i.value&&(i.value.fallbackFormat=q)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:S},set warnHtmlMessage(q){i.value&&(i.value.warnHtmlMessage=q)},get escapeParameter(){return i.value?i.value.escapeParameter:b},set escapeParameter(q){i.value&&(i.value.escapeParameter=q)},t:J,getPostTranslationHandler:F,setPostTranslationHandler:k,getMissingHandler:O,setMissingHandler:B,rt:ee,d:X,n:ve,tm:ne,te:L,getLocaleMessage:H,setLocaleMessage:te,mergeLocaleMessage:he,getDateTimeFormat:me,setDateTimeFormat:re,mergeDateTimeFormat:oe,getNumberFormat:z,setNumberFormat:pe,mergeNumberFormat:ie};function G(q){q.locale.value=a.value,q.fallbackLocale.value=l.value,Object.keys(u.value).forEach(ce=>{q.mergeLocaleMessage(ce,u.value[ce])}),Object.keys(c.value).forEach(ce=>{q.mergeDateTimeFormat(ce,c.value[ce])}),Object.keys(d.value).forEach(ce=>{q.mergeNumberFormat(ce,d.value[ce])}),q.escapeParameter=b,q.fallbackFormat=g,q.fallbackRoot=p,q.fallbackWarn=f,q.missingWarn=h,q.warnHtmlMessage=S}return eh(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Es(cn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const q=i.value=e.proxy.$i18n.__composer;t==="global"?(a.value=q.locale.value,l.value=q.fallbackLocale.value,u.value=q.messages.value,c.value=q.datetimeFormats.value,d.value=q.numberFormats.value):o&&G(q)}),be}const wCe=["locale","fallbackLocale","availableLocales"],DB=["t","rt","d","n","tm","te"];function CCe(e,t){const n=Object.create(null);return wCe.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Es(cn.UNEXPECTED_ERROR);const r=gn(i.value)?{get(){return i.value.value},set(a){i.value.value=a}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,DB.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Es(cn.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,DB.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}if(Vwe(),__INTLIFY_JIT_COMPILATION__?P2(Ewe):P2(Swe),fwe(Kye),pwe(T2),K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=pa();e.__INTLIFY__=!0,nwe(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}K.env.NODE_ENV;async function bCe(){return cCe({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:{errorMessages:Wge}}})}const SCe=async()=>{const e=await bCe();return $ge(e.global),e},ECe={style:{color:"#ff5200"}},TB=_t(rt({__name:"ImportVisual",props:{state:{},errorMessage:{},overwrite:{type:Boolean}},setup(e){return(t,n)=>(j(),ue("div",{class:Q(t.$style["inform-layout"])},[e.state==="importing"?(j(),ue("div",{key:0,class:Q(t.$style["import-error"]),style:{width:"500px"}},[fe(U(Pm),{src:"UploadInProgress","max-height":180,"max-width":180})],2)):e.state==="error"?(j(),ue("div",{key:1,class:Q(t.$style["import-error"]),style:{width:"500px"}},[fe(U(Pm),{src:"Unsuccessful1","max-height":180,"max-width":180}),_e("span",{class:Q(t.$style["step-title"])}," File doesn’t meet requirements. Check file and try again. ",2),_e("div",ECe,[_e("span",{class:Q(t.$style["step-description"])},"Error code",2),_e("span",{class:Q(t.$style["step-description"])},wt(e.errorMessage),3)])],2)):e.state==="success"?(j(),ue(xt,{key:2},[fe(U(Pm),{src:"Successful1","max-height":180,"max-width":180}),_e("span",{class:Q(t.$style["step-title"]),style:{"white-space":"pre-wrap","align-items":"center","text-align":"center"}},wt(e.overwrite?`Existing data will be overwritten in the background.
251
251
  Refresh to see updates.`:`Work will be created in background.
252
252
  Refresh to see updates.`),3)],64)):Je("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_16bpq_1","import-error":"_import-error_16bpq_11","step-title":"_step-title_16bpq_22","step-description":"_step-description_16bpq_27"}}]]),IB=_t(rt({__name:"DateRule",setup(e){const n=(()=>{const o=(h,f,p,g)=>{const v=document.createElement("span");return v.textContent=h,v.style.fontWeight=f,v.style.fontSize=p,v.style.color=g,v},i=document.createElement("div");i.style.display="flex",i.style.flexDirection="column";const r=document.createElement("div"),a=document.createElement("div"),l=o("Valid formats:","normal","14px","#02C39A"),u=o("Invalid formats:","normal","14px","#FF5200"),c=o(" 2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=o(" 12.31.2025, 2025.31.12","normal","14px","");return r.appendChild(l),r.appendChild(c),a.appendChild(u),a.appendChild(d),i.appendChild(r),i.appendChild(a),i.outerHTML})(),s=Jt;return(o,i)=>(j(),ue("div",{class:Q(o.$style["date-format-guide"])},[_e("span",{class:Q(o.$style["step-title-2"])},[i[0]||(i[0]=nt(" Date format guide ",-1)),Ke(fe(U(lt),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[U(s),{content:U(n)}]])],2),_e("div",{class:Q(o.$style["date-rule-section"])},[i[3]||(i[3]=_e("span",null,"Enter dates in one of these formats:",-1)),_e("ul",{class:Q(o.$style["step-description"])},[_e("li",{class:Q(o.$style["date-rule"])},[...i[1]||(i[1]=[_e("b",null,"DD MM YYYY",-1),nt(" (Day-Month-Year) ",-1)])],2),_e("li",{class:Q(o.$style["date-rule"])},[...i[2]||(i[2]=[_e("b",null,"YYYY MM DD",-1),nt(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_1clky_1","step-title-2":"_step-title-2_1clky_13","date-rule-section":"_date-rule-section_1clky_25","step-description":"_step-description_1clky_29","date-rule":"_date-rule_1clky_25"}}]]),_Ce={key:1},RCe=_t(rt({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=V(null),o=e,i=()=>{s.value&&s.value.show()},r=V(""),a=V("idle"),l=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),u=V(null),c=V({file:null,format:null}),{apiServices:d}=ts(!1,o),h=async P=>{var F,k;if(((F=d==null?void 0:d.value)==null?void 0:F.getTemplateFlowStatuses)===void 0){console.error("API services not available",(k=d==null?void 0:d.value)==null?void 0:k.getTemplateFlowStatuses);return}return await d.value.getTemplateFlowStatuses({workspaceId:o.workspaceId,entityId:o.entityId,...P})},f=V(!1),p=async()=>{f.value=!0;const P=o.workspaceId,D=o.entityId;if(!P||!D||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(P,D))throw new Error("No response from downloadTemplate API")}catch(F){console.error("Error downloading template:",F)}f.value=!1},g=async P=>{var k,O,B;const D=new FormData,F=((k=P.name.split(".").pop())==null?void 0:k.toString())||"";if(D.append("file",P),D.append("format",F),D.append("entity_id",o.entityId||""),D.append("template_flow_status_id",_.value||""),!d.value||!o.workspaceId||!o.entityId){console.error("API services not available");return}try{await d.value.addNewSceneViaImportFile(o.workspaceId,o.entityId,D),v()}catch(Z){throw console.error("Error uploading file:",Z),C(((B=(O=Z.response)==null?void 0:O.data)==null?void 0:B.message)||"An unknown error occurred during file upload."),Z}},v=()=>{a.value="success"},C=P=>{r.value=P,a.value="error"},S=n,b=()=>{S("import-success"),x()},w=async()=>{if(!c.value||!c.value.file){console.error("No file to upload");return}a.value="importing",await g(c.value.file)};t({open:i});const _=V(null),R=Y(()=>!c.value.file||!c.value.format||!c.value.isValid||!_.value),T=V(null),I=()=>{var P,D;(P=u.value)==null||P.clear(),r.value="",c.value={file:null,format:null},_.value=null,(D=T==null?void 0:T.value)==null||D.clear(),a.value="idle"},x=()=>{var P;I(),(P=s.value)==null||P.hide()};return(P,D)=>(j(),qe(U(dV),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:I},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),qe(TB,{key:0,state:a.value,"error-message":r.value},null,8,["state","error-message"])):(j(),ue("div",_Ce,[_e("div",{class:Q(P.$style["step-section"])},[_e("span",{class:Q(P.$style["step-title"])},"Step 1: Download sample file",2),_e("span",{class:Q(P.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),fe(U(mt),{class:Q(P.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:f.value,onHandleClick:p},{prefix:ge(()=>[fe(U(lt),{src:"Download"})]),default:ge(()=>[D[2]||(D[2]=nt(" Download sample file ",-1))]),_:1},8,["class","disabled"])],2),_e("div",{class:Q(P.$style["step-section"])},[_e("span",{class:Q(P.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),fe(U(ZV),{modelValue:c.value,"onUpdate:modelValue":D[0]||(D[0]=F=>c.value=F),ref_key:"filUploaderRef",ref:u},null,8,["modelValue"])],2),_e("div",{class:Q(P.$style["step-section"])},[_e("span",{class:Q(P.$style["step-title"])},"Step 3: Select status",2),_e("span",{class:Q(P.$style["step-description"])},"Choose a status for the new work.",2),fe(U(nve),{ref_key:"statusRef",ref:T,modelValue:_.value,"onUpdate:modelValue":D[1]||(D[1]=F=>_.value=F),"get-status-func":h,"workspace-id":o.workspaceId,id:o.entityId},null,8,["modelValue","workspace-id","id"])],2),_e("div",{class:Q(P.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[fe(IB)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[fe(U(mt),{style:{flex:"1"},variant:"secondary",onClick:x},{default:ge(()=>[...D[3]||(D[3]=[nt(" Cancel ",-1)])]),_:1}),fe(U(mt),{disabled:R.value,style:{flex:"1"},variant:"primary",onClick:w},{default:ge(()=>[...D[4]||(D[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[fe(U(mt),{style:{flex:"1"},variant:"primary",onClick:b},{default:ge(()=>[...D[5]||(D[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:ge(()=>[fe(U(mt),{style:{flex:"1"},variant:"primary",onClick:I},{default:ge(()=>[...D[6]||(D[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ml4p_1","step-title":"_step-title_1ml4p_11","step-title-2":"_step-title-2_1ml4p_17","step-description":"_step-description_1ml4p_23","date-format-guide":"_date-format-guide_1ml4p_28","import-error":"_import-error_1ml4p_39","drop-area":"_drop-area_1ml4p_49","is-dragging":"_is-dragging_1ml4p_49","drop-area-content":"_drop-area-content_1ml4p_52",browse:"_browse_1ml4p_61","download-sample-btn":"_download-sample-btn_1ml4p_65"}}]]),xB={text:il,id:void 0,assignees:dge,status:bge,dateRange:hge,isStarted:il,isCompleted:il,lastUpdated:il,completedOn:il,isDeleted:il,isArchived:il,isProcessing:il,name:aV,options:vY,metric:uV,__checkboxSelection:void 0},DCe={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},TCe={text:null,id:void 0,assignees:UA,status:Bk,dateRange:fge,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:aV,options:rV,metric:void 0,__checkboxSelection:void 0},ICe={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]},xCe={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}},FCe=e=>{var t,n,s;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((s=e.metric_type)==null?void 0:s.id)==3)return}},Fd=e=>{if(e)return FCe(e)};function FB(e,t){var o,i,r,a;const n=(o=t==null?void 0:t.data)==null?void 0:o.permissions;let s={disabled:!1,readOnly:!1,type:void 0};if(!t||!e)s={disabled:!1,readOnly:!0,type:void 0};else if(e==="options")s={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_","")}`;s={disabled:!1,readOnly:!((t==null?void 0:t.data)&&t.data[l]&&((i=t.data[l])==null?void 0:i.permission)==2&&!((r=t.colDef)!=null&&r.context.formula)&&!t.data.isLocked&&!t.data.isDeleted),type:Fd((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}[e]??0;s={disabled:u===-1,readOnly:u!==1,type:void 0}}return s}class S_{constructor(){es(this,"eGui");es(this,"params")}init(t){this.params=t}getGui(){var n,s,o,i,r;const t=document.createElement("div");return(n=this.params)!=null&&n.height&&t.style.setProperty("--height",(s=this.params)==null?void 0:s.height),(o=this.params)!=null&&o.width?t.style.setProperty("--width",(i=this.params)==null?void 0:i.width):(r=this.params)!=null&&r.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 PB=new Map;class vp{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 s=t.data||((u=t.node)==null?void 0:u.data),o=(c=t.colDef)==null?void 0:c.field,i=o&&s?s[o]:void 0,r=FB((d=t.colDef)==null?void 0:d.field,t),a=typeof n=="function"?n(t):n??{};return{...t,value:i,disabled:r==null?void 0:r.disabled,readOnly:r==null?void 0:r.readOnly,type:Fd(t.context),...a}}static resolveRendererComponent(t,n){let s;return t.includes("metric")&&xB.metric?Fd(n)==="rating"?s=Uve:s=uV:s=xB[t]??void 0,s}static resolveEditorComponent(t,n){const s=t.includes("metric");let o;const i=Fd(n);return s&&["number","dropdown"].includes(i)?o=ove:o=TCe[t],o}static canEditField(t,n){var i;if(n.data===void 0)return!1;const s=FB((i=n.colDef)==null?void 0:i.field,n),o=DCe[t]??!0;return!(s!=null&&s.disabled)&&!(s!=null&&s.readOnly)&&o&&(s==null?void 0:s.type)!=="rating"}static resolveSize(t){const[n=250,s=300]=ICe[t]??[];return{minWidth:n,maxWidth:s}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){const{wrapVueCellEditor:n}=this.getWrappers(),s=String(t.field??""),o=this.resolveSize(s),i=xCe[s]??{},r=Fd(t.context),a=r==="number"||r==="rating",l=r=="rating"?t.context.range*24+20:o.minWidth;return{...t,headerName:t.headerName,...o,...t,cellEditorSelector:c=>{const d=this.resolveEditorComponent(s,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(s,c),d},minWidth:l,cellRendererSelector:c=>PCe(c,{component:n(this.resolveRendererComponent(s,t.context)),params:this.buildCommonCellParams(c,t.cellRendererParams)}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...i,cellClass:c=>`${r}--${c.colDef.field}`}}}es(vp,"wrappers",null);const PCe=(e,t)=>{var o;const n=(o=e.colDef)==null?void 0:o.field,s=`${n}-${e.node.rowIndex}`;return PB.set(s,(PB.get(s)??0)+1),n!=null&&n.includes("metric")?e.value===void 0?{component:S_,params:{fullwidth:!1}}:t:e.data&&e.value!==void 0?t:!n||n==="options"||n==="__checkboxSelection"?e.data?t:{component:S_,params:{fullwidth:!0,width:"24px",height:"24px"}}:!e.data||e.value===void 0?{component:S_,params:{fullwidth:!1}}:t},ACe=_t(rt({__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,s=V(null),o=Y(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),i=Y(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),r=Y(()=>({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=s.value)!=null&&a.focus?s.value.focus():console.warn(`Component ${o.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=s.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var u;return(u=s.value)==null||u.$emit(a,l),!0}}),(a,l)=>(j(),qe(bw(i.value),Xt(r.value,{ref_key:"componentRef",ref:s}),null,16))}}),[["__cssModules",{$style:{skeleton:"_skeleton_7xde7_1",shimmer:"_shimmer_7xde7_16","skeleton-loading":"_skeleton-loading_7xde7_1"}}]]);function kCe(e){return"stopEditing"in e}const OCe=8,MCe=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 AB(e){return class{constructor(){es(this,"container");es(this,"vNode",null);es(this,"componentInstance",null);es(this,"componsenExposed",null);es(this,"params");es(this,"isEditor",!1);es(this,"_destroyed",!1)}init(n){var l,u,c,d;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const s=performance.now();this.params=n,this.isEditor=kCe(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 o=n.context.apiClass,i=n,r={component:e,params:Object.freeze(n),disabled:!1,readOnly:i.readOnly??!1,value:n.value,maxRating:i.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:o,tooltip:i.tooltip??void 0,isSearching:i.isSearching??!1,isFiltering:i.isFiltering??!1,isNoData:i.isNoData??!1,config:i.config,sceneId:(i==null?void 0:i.sceneId)||void 0};this.vNode=fe(ACe,r),Yw(this.vNode,this.container);const a=performance.now()-s;a>OCe&&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():MCe(this.container)}getValue(){var n,s,o;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((o=(s=this.componentInstance).getValue)==null?void 0:o.call(s))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var r,a,l,u,c;const s=(l=(a=(r=this.params)==null?void 0:r.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),o=((u=this.params)==null?void 0:u.context)&&Fd(this.params.context);return s||(o==="number"||o==="rating")||!this.isEditor?!1:(c=this.componentInstance)!=null&&c.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var s,o,i;return this.isEditor?(s=this.componentInstance)!=null&&s.getPopupPosition?this.componentInstance.getPopupPosition():((i=(o=this.params)==null?void 0:o.colDef)==null?void 0:i.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(o){console.warn("[Vue3CellWrapper] Error during $destroy:",o)}try{typeof n.destroy=="function"&&n.destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during destroy():",o)}}(typeof queueMicrotask=="function"?queueMicrotask:o=>Promise.resolve().then(o))(()=>{try{Yw(null,this.container)}catch(o){console.warn("[Vue3CellWrapper] Error during unmount:",o)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function Iy(e){return AB(e)}function kB(e){return AB(e)}let OB=!1;OB||(jJ.registerModules([ege,eV]),OB=!0);class NCe{constructor(t,n){es(this,"gridApi",null);es(this,"container");es(this,"config");es(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:s,onRowSelected:o,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=Sue(this.container,r),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 s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const LCe=$N.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"),VCe=rt({__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"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=V(null);sS(i,()=>{var v;const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=V(null),a=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:LCe}));function u(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new NCe(i.value,g),r.value.init(),c()}function c(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=r.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=r.value)==null||S.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.value||null}return tt(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),vs(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),nn(()=>{u()}),vs(()=>{h()}),(g,v)=>(j(),ue("div",{ref_key:"gridContainerRef",ref:i,style:dn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Pd(e){return kB(e)}const BCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Pd(Ru),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Pd(Ru)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Pd(Ru)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Pd(Ru)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Pd(Ru),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Pd(Ru),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>vp.fromType(n))],xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},$Ce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},HCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:xy.WIDTH,minWidth:xy.WIDTH,maxWidth:xy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:xy.HEADER_CLASS,headerComponent:Iy(wge),suppressMovable:!0}),GCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},UCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Dh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const c=await s(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=V([]),a=HCe(),l=async c=>{const d=await i(),h=new Map;d==null||d.forEach(F=>{F.width&&h.set(F.field,F.width)});const f=BCe(),p=vp.fromType(GCe),v=((c==null?void 0:c.map(F=>{var k;return{headerName:F.name,field:`metric_${F.id}`,editable:((k=F==null?void 0:F.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Iy(Ru),headerComponentParams:O=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${F.id}`)}}))||[]).map(F=>vp.fromType(F)),C=[a,...f,...v,$Ce,p],S=C.filter(F=>F.pinned==="left"),b=C.filter(F=>F.pinned==="right"||F.field==="blank"),w=C.filter(F=>!F.pinned&&F.field!=="blank");if(!d||d.length===0){r.value=C;return}const _=new Map(d.map(F=>[F.field,F])),R=new Map(w.map(F=>[F.field,F])),T=[];for(const F of d)if(F.field&&R.has(F.field)){const k=R.get(F.field);T.push({...k,hide:F.hide,width:F.width}),R.delete(F.field)}const I=Array.from(R.values()),x=[...T,...I],P=S.map(F=>{const k=_.get(F.field);return k!=null&&k.width?{...F,width:k.width}:F}),D=b.map(F=>{const k=_.get(F.field);return k!=null&&k.width?{...F,width:k.width}:F});r.value=[...P,...x,...D]};tt(e,c=>l(c),{immediate:!0});const u=Di((c,d)=>{var C,S;if(c.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(c.source)===-1){console.warn("Skipping saveColumnConfig for source:",c.source);return}else console.warn("Executing saveColumnConfig for source:",c.source);else console.warn("Executing saveColumnConfig for source:",c);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),r.value=h||r.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},rr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:u}},WCe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},zCe=e=>{var F,k,O;const{showMessage:t,showErrorNetMessage:n}=Qf(),s=Yn(),o={domainApi:WCe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(O=(k=(F=s==null?void 0:s.appContext)==null?void 0:F.config)==null?void 0:k.globalProperties)==null?void 0:O.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Lk(i,o);r.on("call-api",B=>{B.success?t(B.apiCode,"success"):n(B)});const a=Eo({}),l=V([]),u=V(!1),c=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=L7(),v=B=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:B}),C=50,S=async(B,Z,J)=>{if(!B.length)return[];const ee=Z4(B,Z);return(await Promise.all(ee.map(J))).flat()},b=async B=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:B})).data.map(J=>[J==null?void 0:J.id,J.permission])}catch(Z){return console.error("Failed to fetch item permissions chunk:",Z),[]}},w=async(B,Z)=>{try{const J=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length*Z.length,metric_ids:Z}),ee=J.data.map(ve=>{const ne=new Map(ve.item_metrics.map(H=>[H.metric_id,{value:H.value,auth_permission:H==null?void 0:H.auth_permission}])),L=Object.fromEntries(Z.map(H=>[H,ne.get(H)??null]));return[ve==null?void 0:ve.id,L]}),X=new Set(J.data.map(ve=>ve==null?void 0:ve.id));for(const ve of B)if(!X.has(ve)){const ne=Object.fromEntries(Z.map(L=>[L,{value:null,auth_permission:void 0}]));ee.push([ve,ne])}return ee}catch(J){return console.error("Failed to fetch a chunk of metric values:",J),B.map(X=>[X,Object.fromEntries(Z.map(ve=>[ve,void 0]))])}},_=async B=>{try{const Z=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length}),J=Z.data.flatMap(ee=>ee.assignees);return g(J),Z.data.map(ee=>[ee==null?void 0:ee.id,ee==null?void 0:ee.assignees])}catch(Z){return console.error("Failed to fetch a chunk of assigned users:",Z),[]}},R=async B=>{if(!B.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const Z=await S(B,C,b);return Object.fromEntries(Z)}catch(Z){return console.error("Failed to fetch item permissions:",Z),{}}},T=async(B,Z)=>!B.length||!Z.length?{}:(p=p.then(async()=>{try{const X=[];let ve=0;for(let L=0;L<Z.length;L+=5){ve++;const H=Z.slice(L,L+5),te=[];for(let me=0;me<H.length;me++){const re=H[me],oe=await S(B,C,z=>w(z,[re]));te.push(oe),await new Promise(z=>setTimeout(z,500))}X.push(...te);const he=L+5>=Z.length}const ne={};for(const L of X.flat()){const[H,te]=L;ne[H]||(ne[H]={}),Object.assign(ne[H],te)}return ne}catch(J){return console.error("Failed to fetch metric values:",J),{}}}),p),I=async B=>{if(!B.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const Z=await S(B,C,_);return Object.fromEntries(Z)}catch(Z){return console.error("Failed to fetch assigned users:",Z),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async B=>{const{cursor:Z,offset:J,size:ee,searchQuery:X}=B;let ve=[];u.value=!0,c.value=null;try{const ne=await r.getAllItem_cursor({...B,cursor:Z||void 0,offset:J||void 0,pageSize:ee||f.value,...v(X),sortBy:B.sort_by});return l.value=ne.data,d.value=ne.meta,h.value=ne.meta.current_page||0,ve=ne.data.map(L=>L==null?void 0:L.id),ne}catch(ne){throw c.value=ne,console.error("Failed to fetch items (cursor):",ne),ne}finally{const ne=async()=>{try{const[L,H]=await Promise.all([I(ve),R(ve)]);e.value.updateItemData({assignees:L,permission:H},ve);const te=await T(ve,e.value.metricIds);e.value.setMetricValues(te,new Set(ve),e.value.metricIds)}catch(L){console.error("Post-fetch processing failed:",L)}};u.value=!1,setTimeout(ne)}},getAssignableStatus:async B=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:B})}catch(Z){throw console.error("Failed to fetch assignable status:",Z),Z}},getMetricList:async B=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:B})}catch(Z){throw console.error("Failed to fetch metric list:",Z),Z}},getMetricValues:T,getAssignedUsers:I}};function jCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=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);o.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(i.push(c),s.assignees){const h=E7((s.assignees[u]||[]).map(xF));c.data.assignees=h,r.add("assignees")}s.permission&&(c.data.permissions=s.permission[u]),l.forEach(h=>{c.data[h]=c.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(u=>[u,new Map(i.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(s).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=r.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&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(u=>`metric_${u}`),force:!0})}}}function KCe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function qCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=V(!0),a=V(!0),l=V(!1),u=()=>{n.value=!n.value},c=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!i)return console.error("Fetcher function is undefined"),null;const b=KCe(i,e.perPage,()=>s.value,w=>{r.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Di(v=>{d(v)},rr),p=()=>{o.value},g=V(!1);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const YCe={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."]}}},ZCe=e=>{var t;return(t=Object.entries(YCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},XCe={key:1},JCe=_t(rt({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=V(null),o=e,i=()=>{s.value&&s.value.show()},r=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:u}=ts(!1,{}),c=V(!1),d=async()=>{c.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}c.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var P,D,F;const I=new FormData,x=((P=T.name.split(".").pop())==null?void 0:P.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((F=(D=k.response)==null?void 0:D.data)==null?void 0:F.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;R(),(T=s.value)==null||T.hide()};t({close:S,open:i});const b=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=Y(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=V(null),R=()=>{var T;(T=_.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(j(),qe(U(dV),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),qe(TB,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),ue("div",XCe,[_e("div",{class:Q(T.$style["step-section"])},[_e("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),_e("span",{class:Q(T.$style["step-description"])},[...I[1]||(I[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),_e("br",null,null,-1),_e("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(U(mt),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:ge(()=>[fe(U(lt),{src:"Download"})]),default:ge(()=>[I[2]||(I[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),_e("div",{class:Q(T.$style["step-section"])},[_e("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(U(ZV),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),_e("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[fe(IB)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[fe(U(mt),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...I[3]||(I[3]=[nt(" Cancel ",-1)])]),_:1}),fe(U(mt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...I[4]||(I[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[fe(U(mt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...I[5]||(I[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[fe(U(mt),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...I[6]||(I[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),QCe={style:{cursor:"help"}},ebe=_t(rt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Io,s=Qb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Qs(s),a=Jt,l=V(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=V(""),d=Y(()=>{var Ye;const Ae=((Ye=r.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ae},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ae,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ae,id:"overwrite_scenes_option"}]}),h=e;vp.initialize({wrapVueCellRenderer:Iy,wrapVueCellEditor:kB});const f=tf(),{switchInstanceFunc:p}=Qs(f);nn(()=>{const Ae=Yn();p.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");Ct(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=V(null),v=V([]),C=Wm(),{rowCount:S}=Qs(C),b=V(!1),w=V(""),_=V(),R=zA(),{metricList:T}=Qs(R),I=V(""),x=V(!1),P=V(new Set),D=V(new Map),{apiServices:F}=ts(!1,h),{columnDefs:k,checkboxColumn:O,saveColumnConfig:B}=UCe(T,h.entityId,g),Z=V();tt(()=>k,()=>{var Ae;(Ae=Z.value)==null||Ae.updateColumnDefs(k.value)},{deep:!0});const J=(Ae,Ye)=>{B(Ae,Ye)},{updateRowData:ee,setMetricValues:X}=jCe(g),ve=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(ke.value||{}).length==1&&Object.keys(ke.value)[0]=="preflight_status")&&Object.keys(ke.value||{}).length>0})),ne=Y(cm),L=Y(()=>k.value.filter(Ae=>{var Ye;return((Ye=Ae.field)==null?void 0:Ye.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ye;return((Ye=Ae.field)==null?void 0:Ye.replace("metric_",""))||""}));Zi("timezone",ne);const H=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:L.value,updateItemData:ee,setMetricValues:X})),{fetchItems:te,getMetricList:he,cusorMap:me,getMetricValues:re}=zCe(H),oe=Y(()=>{if(!g.value)return!1;const Ae=g.value.getSelectedRows().length;return Ae>0&&Ae>=S.value.total}),z=Y(()=>{var Ae;return((Ae=l.value)==null?void 0:Ae.name)||"Items"}),pe=Ae=>{setTimeout(()=>{Ct(()=>{var Ye,jt;g.value&&(Ae?(Ye=g.value)==null||Ye.showNoRowsOverlay():(jt=g.value)==null||jt.hideOverlay())})},500)},ie=(Ae,Ye)=>{var jt;S.value.total=Ae.meta.total??0,(jt=Ae.meta.next)!=null&&jt.cursor&&(me[Ye+1]=Ae.meta.next.cursor),I.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?pe(!0):pe(!1)},be=YV(),G=V(null),{sortingAPIConfiguration:q,isSortingRunning:ce}=Qs(be),ke=V({preflight_status:"1"}),Fe=Y(()=>({...ke.value,search:w.value}));Zi("filterParams",Fe);const Le=V([]),ye=async({page:Ae,pageSize:Ye,filterText:jt})=>{var ku;(ku=g.value)==null||ku.hideOverlay();const sn=me[Ae],Ui=!sn&&Ae>1?(Ae-1)*Ye:void 0,js=q.value;js.length>0&&(ce.value=!0);try{const bo={cursor:sn,size:Ye,searchQuery:jt,offset:Ui,sort_by:js,...ke.value},Pr=await te(bo);if(!Pr)return{rows:[],total:0};const Kn=(ya=>{const gi=ya.data.map(Ou=>PF(Ou,ne.value));return gi.forEach(Ou=>{P.value.add(String(Ou.id)),D.value.set(String(Ou.id),{})}),gi})(Pr);return ie(Pr,Ae),{rows:Kn,total:S.value.total}}catch(bo){return console.error("Failed to fetch items:",bo),{rows:[],total:0}}finally{ce.value=!1}},{isLoading:M,toggleSidebar:$,onGridReady:ae,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=qCe({selectRowData:V([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:u.ROWS_PER_PAGE,fetcher:ye}),Ee=V([]),Ve=()=>{var Ae;Ee.value=((Ae=g.value)==null?void 0:Ae.getSelectedRows())||[]},pt=Eo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),At=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:Iy(ive),noRowsOverlayComponentParams:()=>ve.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ye=["row-highlight"];return Ae.data.id||Ye.push("row-inactive"),Ae.data.isDeleted&&Ye.push("row-deleted"),Ae.data.disabled&&Ye.push("row-deleted"),Ae.data.isArchived&&Ye.push("row-archived"),Ae.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:F.value,sorting:ce.value},onCellKeyDown:Ae=>{var Ye,jt,sn;if(Ae.data.isDeleted)return!1;if(((Ye=Ae==null?void 0:Ae.event)==null?void 0:Ye.key)==="Enter"){const{api:Ui,node:js,column:ku}=Ae,bo=Ui.getCellRendererInstances({rowNodes:[js],columns:[ku]});if(bo.length>0){const Pr=bo[0];Pr&&typeof((jt=Pr.componsenExposed)==null?void 0:jt.focus)=="function"&&((sn=Pr.componsenExposed)==null||sn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var sn;if((sn=Ae.data)!=null&&sn.isDeleted)return!0;const Ye=Ae.event.key,jt=Ae.editing;return jt&&Ye==="Tab"?!0:jt&&Ye==="Enter"?!1:Ye==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ye=Ae.api.getFirstDisplayedRowIndex(),jt=Ae.api.getLastDisplayedRowIndex();pt.rowsDisplay.fromIndex=Ye,pt.rowsDisplay.toIndex=jt,pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(sn=>sn.getColId())},onViewportChanged:Ae=>{pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ye=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:Ae=>{let Ye=Ae.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const jt=Ae.api.getAllDisplayedColumns(),sn=jt.indexOf(Ye.column),Ui=Ae.backwards?-1:1,js=jt[sn+Ui];if(js)return{rowIndex:Ye.rowIndex,column:js,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let Ae=0;g.value.forEachNode(Ye=>{Ye.data&&Ae++}),S.value.loaded=Math.min(Ae,S.value.total)}tt(()=>q,()=>{g.value&&(I.value="",P.value.clear(),g.value.deselectAll(),Object.keys(me).forEach(Ae=>delete me[Number(Ae)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Qt=V(),zt=V(),Ne=()=>{var Ae;(Ae=zt.value)==null||Ae.open()},je=()=>{var Ae;(Ae=Qt.value)==null||Ae.open()},yt=async()=>{Ue.value=!0,g.value&&(I.value="",P.value.clear(),Object.keys(me).forEach(Ae=>delete me[Number(Ae)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Ot=Y(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=V(),st=Y(()=>{var Ae;return(Ae=ZCe(Ot.value))==null?void 0:Ae.map(Ye=>`<div>• ${Ye}</div>`).join(`
253
- `)});function ps(Ae){var Ye;Ae==="new_scene"?(Ye=Wt.value)==null||Ye.show():Ae==="import_scenes"?je():Ae==="overwrite_scenes"&&Ne()}const Gi=Ae=>{v.value=Ae.api.getSelectedRows().map(Ye=>Ye.id)},pl=Ae=>{const Ye=ae(Ae);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",sn=>J(sn,!0)),Ye.addEventListener("columnResized",sn=>J(sn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},Co=()=>{var Ae;c.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};nn(()=>{Ct(()=>{Co()}),window.addEventListener("resize",Co);function Ae(){requestAnimationFrame(Ae)}Ae()}),vs(()=>{window.removeEventListener("resize",Co)});const va=async({code:Ae,name:Ye})=>{await ze(Ae),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=Ae=>{if(!g.value)return;const Ye=g.value.getRowNode(Ae);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},Ir=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await he(h.entityId);T.value=Ae.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},pi=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Fr=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Au=my(),{setUser:kn}=Au,gs=async()=>{if(F.value)try{const Ae=await F.value.getMe();return kn(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},__=async()=>{var Ae;if(F.value)try{const Ye=await F.value.getWorkspaces(h.workspaceId),jt=(Ae=Ye.data[0])==null?void 0:Ae.ws_user_role_id;return jt&&Au.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};tt(()=>[h.entityId,h.workspaceId],async([Ae,Ye])=>{!Ae||!Ye||(gs(),__(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),tt(L,(Ae,Ye)=>{const jt=Ae.filter(sn=>!(Ye!=null&&Ye.includes(sn)));jt.length>0&&re(Array.from(P.value),jt).then(sn=>{X(sn,P.value,jt)})},{immediate:!0,deep:!0}),tt(I,(Ae,Ye)=>{x.value=!!(Ye&&Ae&&Ye!==Ae)}),t({refreshTable:yt});const Ad=Ae=>{ke.value=Ae,yt()},kd=Ae=>{Le.value=Ae,yt()},Od=Ae=>{k.value=Ae||[],J({},!0)},R_=Y(()=>{var sn;const Ae=En.getInstance().getItem("ws.terminology"),Ye=Ae?JSON.parse(Ae):null;return`New ${((sn=Ye==null?void 0:Ye.find(Ui=>Ui.code==="scene"))==null?void 0:sn.name)||"Scene"}`});return(Ae,Ye)=>{const jt=_o("focusable");return j(),qe(U(pge),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":ge(()=>{var sn;return[((sn=U(r))==null?void 0:sn.has_create_item_permission)==1?(j(),qe(U(_0),{key:0,variant:["primary"],options:d.value,onSelect:ps,onHandleClick:Ye[1]||(Ye[1]=Ui=>ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(U(mt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Ui=>ps("new_scene")),label:R_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),_e("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),Ke((j(),ue("span",QCe,[nt(wt(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":ge(()=>[fe(U(Gve),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(U(iS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=sn=>w.value=sn),onSearch:U(ze),class:Q(Ae.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=sn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U($A),{status:U(M)?"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:ge(()=>[Ke((j(),qe(U(mt),{variant:["secondary","icon"],disabled:U(M),onClick:yt},{default:ge(()=>[fe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(fe(U(Hme),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=sn=>Od(sn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Z,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:sn})=>[fe(U(VCe),Xt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:sn+"px",isSorting:U(ce),onOnGridReady:pl,onSelectionChanged:Gi}),null,16,["height","isSorting"])]),footer:ge(()=>[_e("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[_e("span",null,[Ye[5]||(Ye[5]=nt(" Showing ",-1)),_e("b",null,wt(U(S).loaded)+" of "+wt(U(S).total),1)])],2)]),"new-row":ge(()=>[fe(U(yve),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(rge),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":z.value,"selected-all":oe.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[To,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:ge(()=>[fe(U(Zge))]),popup:ge(()=>[fe(RCe,{ref_key:"popupCreateSceneRef",ref:Qt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"]),fe(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"])]),_: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"}}]]),MB="0.1.97",tbe={key:0},nbe=_t(rt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=Eo({id:"",workspaceId:"",apiConfig:{}}),s=Qf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=V(null),u=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=Yn(),!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)||En.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:En.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 Lk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),vs(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zi("workspaceId",d),Zi("entityId",c),(h,f)=>(j(),ue("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(j(),ue("span",tbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(j(),qe(U(ebe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),E_=async(e={},t={})=>{const n=RT(nbe),s=lY();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.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=i,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${MB}`,"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",Jt),n.directive("focusable",Ur);const r=await SCe();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=E_),On.default=E_,On.initDashboard=E_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
253
+ `)});function ps(Ae){var Ye;Ae==="new_scene"?(Ye=Wt.value)==null||Ye.show():Ae==="import_scenes"?je():Ae==="overwrite_scenes"&&Ne()}const Gi=Ae=>{v.value=Ae.api.getSelectedRows().map(Ye=>Ye.id)},pl=Ae=>{const Ye=ae(Ae);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",sn=>J(sn,!0)),Ye.addEventListener("columnResized",sn=>J(sn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},Co=()=>{var Ae;c.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};nn(()=>{Ct(()=>{Co()}),window.addEventListener("resize",Co);function Ae(){requestAnimationFrame(Ae)}Ae()}),vs(()=>{window.removeEventListener("resize",Co)});const va=async({code:Ae,name:Ye})=>{await ze(Ae),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=Ae=>{if(!g.value)return;const Ye=g.value.getRowNode(Ae);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},Ir=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await he(h.entityId);T.value=Ae.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},pi=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Fr=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Au=my(),{setUser:kn}=Au,gs=async()=>{if(F.value)try{const Ae=await F.value.getMe();return kn(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},__=async()=>{var Ae;if(F.value)try{const Ye=await F.value.getWorkspaces(h.workspaceId),jt=(Ae=Ye.data[0])==null?void 0:Ae.ws_user_role_id;return jt&&Au.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};tt(()=>[h.entityId,h.workspaceId],async([Ae,Ye])=>{!Ae||!Ye||(gs(),__(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),tt(L,(Ae,Ye)=>{const jt=Ae.filter(sn=>!(Ye!=null&&Ye.includes(sn)));jt.length>0&&re(Array.from(P.value),jt).then(sn=>{X(sn,P.value,jt)})},{immediate:!0,deep:!0}),tt(I,(Ae,Ye)=>{x.value=!!(Ye&&Ae&&Ye!==Ae)}),t({refreshTable:yt});const Ad=Ae=>{ke.value=Ae,yt()},kd=Ae=>{Le.value=Ae,yt()},Od=Ae=>{k.value=Ae||[],J({},!0)},R_=Y(()=>{var sn;const Ae=En.getInstance().getItem("ws.terminology"),Ye=Ae?JSON.parse(Ae):null;return`New ${((sn=Ye==null?void 0:Ye.find(Ui=>Ui.code==="scene"))==null?void 0:sn.name)||"Scene"}`});return(Ae,Ye)=>{const jt=_o("focusable");return j(),qe(U(pge),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":ge(()=>{var sn;return[((sn=U(r))==null?void 0:sn.has_create_item_permission)==1?(j(),qe(U(_0),{key:0,variant:["primary"],options:d.value,onSelect:ps,onHandleClick:Ye[1]||(Ye[1]=Ui=>ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(U(mt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Ui=>ps("new_scene")),label:R_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),_e("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),Ke((j(),ue("span",QCe,[nt(wt(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":ge(()=>[fe(U(Gve),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(U(iS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=sn=>w.value=sn),onSearch:U(ze),class:Q(Ae.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=sn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U($A),{status:U(M)?"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:ge(()=>[Ke((j(),qe(U(mt),{variant:["secondary","icon"],disabled:U(M),onClick:yt},{default:ge(()=>[fe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(fe(U(Hme),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=sn=>Od(sn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Z,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:sn})=>[fe(U(VCe),Xt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:sn+"px",isSorting:U(ce),onOnGridReady:pl,onSelectionChanged:Gi}),null,16,["height","isSorting"])]),footer:ge(()=>[_e("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[_e("span",null,[Ye[5]||(Ye[5]=nt(" Showing ",-1)),_e("b",null,wt(U(S).loaded)+" of "+wt(U(S).total),1)])],2)]),"new-row":ge(()=>[fe(U(yve),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(rge),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":z.value,"selected-all":oe.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[To,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:ge(()=>[fe(U(Zge))]),popup:ge(()=>[fe(RCe,{ref_key:"popupCreateSceneRef",ref:Qt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"]),fe(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"])]),_: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"}}]]),MB="0.1.98",tbe={key:0},nbe=_t(rt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=Eo({id:"",workspaceId:"",apiConfig:{}}),s=Qf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=V(null),u=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=Yn(),!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)||En.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:En.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 Lk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),vs(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zi("workspaceId",d),Zi("entityId",c),(h,f)=>(j(),ue("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(j(),ue("span",tbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(j(),qe(U(ebe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),E_=async(e={},t={})=>{const n=RT(nbe),s=lY();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.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=i,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${MB}`,"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",Jt),n.directive("focusable",Ur);const r=await SCe();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=E_),On.default=E_,On.initDashboard=E_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});