@arbocollab/arbo-plugin-item-table 0.1.178 → 0.1.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es/index.es.js +11 -12
- package/lib/umd/index.umd.js +5 -5
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -133,7 +133,7 @@ Expected function or array of functions, received type ${typeof e}.`),mo)}functi
|
|
|
133
133
|
transform: translate(-50%, -50%);
|
|
134
134
|
z-index: ${i};
|
|
135
135
|
display: block;
|
|
136
|
-
`},c=()=>{const p=Mm(n),g=e.zIndex?e.zIndex-1:998;if(console.log("overlayZIndex:",g),t.centered&&p){if(r.value=!0,l(p),t.showOverlay){const v=()=>{t.closeOnOverlayClick&&u()};a=gP(t.overlayOpacity,g,v)}}else if(s.value&&(s.value.show(),r.value=!0,t.showOverlay)){const v=()=>{t.closeOnOverlayClick&&u()};a=gP(t.overlayOpacity,g,v)}},u=()=>{const p=Mm(n);t.centered&&p?(r.value=!1,p.style.display="none",t.showOverlay&&(Gb(a||void 0),a=null)):s.value&&(s.value.hide(),r.value=!1,t.showOverlay&&(Gb(a||void 0),a=null))},d=()=>{r.value?u():c()},h=()=>{s.value&&(s.value.destroy(),s.value=null),t.showOverlay&&a&&(Gb(a),a=null)},f=()=>{var v;const p=Mm(n);if(!p)return;if(p.style.display="none",t.centered){t.showOnInit&&c();return}const g={content:p,placement:t.placement,theme:t.theme,trigger:t.trigger,interactive:t.interactive,appendTo:t.appendTo,arrow:t.showArrow,allowHTML:!0,hideOnClick:!1,popperOptions:{...t.popperOptions,modifiers:[...((v=t.popperOptions)==null?void 0:v.modifiers)||[],{name:"computeStyles",options:{adaptive:!1}}]},onShow(){r.value=!0,p.style.display="block"},onHide(){r.value=!1}};if(t.useTrigger){const w=Mm(o);if(!w)return;s.value=Na(w,g)}else{const w=document.createElement("div");w.style.display="none",document.body.appendChild(w),s.value=Na(w,g)}t.showOnInit&&c()};return Qt(()=>{f()}),qn(()=>{h()}),tt(()=>t.alwaysShow,p=>{p?c():u()},{immediate:!0}),{popupRef:n,triggerRef:o,instance:s,isVisible:r,show:c,hide:u,toggle:d,destroy:h}}var z7=Object.create,mP=Object.defineProperty,j7=Object.getOwnPropertyDescriptor,Ub=Object.getOwnPropertyNames,K7=Object.getPrototypeOf,q7=Object.prototype.hasOwnProperty,Y7=(e,t)=>function(){return e&&(t=(0,e[Ub(e)[0]])(e=0)),t},Z7=(e,t)=>function(){return t||(0,e[Ub(e)[0]])((t={exports:{}}).exports,t),t.exports},X7=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ub(t))!q7.call(e,s)&&s!==n&&mP(e,s,{get:()=>t[s],enumerable:!(o=j7(t,s))||o.enumerable});return e},J7=(e,t,n)=>(n=e!=null?z7(K7(e)):{},X7(mP(n,"default",{value:e,enumerable:!0}),e)),lf=Y7({"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),Q7=Z7({"../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(e,t){lf(),t.exports=o;function n(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function o(r){if(r=r||{},r.circles)return s(r);const i=new Map;if(i.set(Date,d=>new Date(d)),i.set(Map,(d,h)=>new Map(l(Array.from(d),h))),i.set(Set,(d,h)=>new Set(l(Array.from(d),h))),r.constructorHandlers)for(const d of r.constructorHandlers)i.set(d[0],d[1]);let a=null;return r.proto?u:c;function l(d,h){const f=Object.keys(d),p=new Array(f.length);for(let g=0;g<f.length;g++){const v=f[g],w=d[v];typeof w!="object"||w===null?p[v]=w:w.constructor!==Object&&(a=i.get(w.constructor))?p[v]=a(w,h):ArrayBuffer.isView(w)?p[v]=n(w):p[v]=h(w)}return p}function c(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,c);if(d.constructor!==Object&&(a=i.get(d.constructor)))return a(d,c);const h={};for(const f in d){if(Object.hasOwnProperty.call(d,f)===!1)continue;const p=d[f];typeof p!="object"||p===null?h[f]=p:p.constructor!==Object&&(a=i.get(p.constructor))?h[f]=a(p,c):ArrayBuffer.isView(p)?h[f]=n(p):h[f]=c(p)}return h}function u(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,u);if(d.constructor!==Object&&(a=i.get(d.constructor)))return a(d,u);const h={};for(const f in d){const p=d[f];typeof p!="object"||p===null?h[f]=p:p.constructor!==Object&&(a=i.get(p.constructor))?h[f]=a(p,u):ArrayBuffer.isView(p)?h[f]=n(p):h[f]=u(p)}return h}}function s(r){const i=[],a=[],l=new Map;if(l.set(Date,f=>new Date(f)),l.set(Map,(f,p)=>new Map(u(Array.from(f),p))),l.set(Set,(f,p)=>new Set(u(Array.from(f),p))),r.constructorHandlers)for(const f of r.constructorHandlers)l.set(f[0],f[1]);let c=null;return r.proto?h:d;function u(f,p){const g=Object.keys(f),v=new Array(g.length);for(let w=0;w<g.length;w++){const S=g[w],b=f[S];if(typeof b!="object"||b===null)v[S]=b;else if(b.constructor!==Object&&(c=l.get(b.constructor)))v[S]=c(b,p);else if(ArrayBuffer.isView(b))v[S]=n(b);else{const C=i.indexOf(b);C!==-1?v[S]=a[C]:v[S]=p(b)}}return v}function d(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return u(f,d);if(f.constructor!==Object&&(c=l.get(f.constructor)))return c(f,d);const p={};i.push(f),a.push(p);for(const g in f){if(Object.hasOwnProperty.call(f,g)===!1)continue;const v=f[g];if(typeof v!="object"||v===null)p[g]=v;else if(v.constructor!==Object&&(c=l.get(v.constructor)))p[g]=c(v,d);else if(ArrayBuffer.isView(v))p[g]=n(v);else{const w=i.indexOf(v);w!==-1?p[g]=a[w]:p[g]=d(v)}}return i.pop(),a.pop(),p}function h(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return u(f,h);if(f.constructor!==Object&&(c=l.get(f.constructor)))return c(f,h);const p={};i.push(f),a.push(p);for(const g in f){const v=f[g];if(typeof v!="object"||v===null)p[g]=v;else if(v.constructor!==Object&&(c=l.get(v.constructor)))p[g]=c(v,h);else if(ArrayBuffer.isView(v))p[g]=n(v);else{const w=i.indexOf(v);w!==-1?p[g]=a[w]:p[g]=h(v)}}return i.pop(),a.pop(),p}}}});lf(),lf(),lf();var vP=typeof navigator<"u",Tt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof global<"u"?global:{};typeof Tt.chrome<"u"&&Tt.chrome.devtools,vP&&(Tt.self,Tt.top);var yP;typeof navigator<"u"&&((yP=navigator.userAgent)==null||yP.toLowerCase().includes("electron")),lf();var eq=J7(Q7()),tq=/(?:^|[-_/])(\w)/g;function nq(e,t){return t?t.toUpperCase():""}function oq(e){return e&&`${e}`.replace(tq,nq)}function sq(e,t){let n=e.replace(/^[a-z]:/i,"").replace(/\\/g,"/");n.endsWith(`index${t}`)&&(n=n.replace(`/index${t}`,t));const o=n.lastIndexOf("/"),s=n.substring(o+1);{const r=s.lastIndexOf(t);return s.substring(0,r)}}var wP=(0,eq.default)({circles:!0});const rq={trailing:!0};function ku(e,t=25,n={}){if(n={...rq,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let o,s,r=[],i,a;const l=(c,u)=>(i=iq(e,c,u),i.finally(()=>{if(i=null,n.trailing&&a&&!s){const d=l(c,a);return a=null,d}}),i);return function(...c){return i?(n.trailing&&(a=c),i):new Promise(u=>{const d=!s&&n.leading;clearTimeout(s),s=setTimeout(()=>{s=null;const h=n.leading?o:l(this,c);for(const f of r)f(h);r=[]},t),d?(o=l(this,c),u(o)):r.push(u)})}}async function iq(e,t,n){return await e.apply(t,n)}function Wb(e,t={},n){for(const o in e){const s=e[o],r=n?`${n}:${o}`:o;typeof s=="object"&&s!==null?Wb(s,t,r):typeof s=="function"&&(t[r]=s)}return t}const aq={run:e=>e()},lq=()=>aq,CP=typeof console.createTask<"u"?console.createTask:lq;function cq(e,t){const n=t.shift(),o=CP(n);return e.reduce((s,r)=>s.then(()=>o.run(()=>r(...t))),Promise.resolve())}function uq(e,t){const n=t.shift(),o=CP(n);return Promise.all(e.map(s=>o.run(()=>s(...t))))}function zb(e,t){for(const n of[...e])n(t)}class dq{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,n,o={}){if(!t||typeof n!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(n),()=>{n&&(this.removeHook(t,n),n=void 0)}}hookOnce(t,n){let o,s=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,n(...r));return o=this.hook(t,s),o}removeHook(t,n){if(this._hooks[t]){const o=this._hooks[t].indexOf(n);o!==-1&&this._hooks[t].splice(o,1),this._hooks[t].length===0&&delete this._hooks[t]}}deprecateHook(t,n){this._deprecatedHooks[t]=typeof n=="string"?{to:n}:n;const o=this._hooks[t]||[];delete this._hooks[t];for(const s of o)this.hook(t,s)}deprecateHooks(t){Object.assign(this._deprecatedHooks,t);for(const n in t)this.deprecateHook(n,t[n])}addHooks(t){const n=Wb(t),o=Object.keys(n).map(s=>this.hook(s,n[s]));return()=>{for(const s of o.splice(0,o.length))s()}}removeHooks(t){const n=Wb(t);for(const o in n)this.removeHook(o,n[o])}removeAllHooks(){for(const t in this._hooks)delete this._hooks[t]}callHook(t,...n){return n.unshift(t),this.callHookWith(cq,t,...n)}callHookParallel(t,...n){return n.unshift(t),this.callHookWith(uq,t,...n)}callHookWith(t,n,...o){const s=this._before||this._after?{name:n,args:o,context:{}}:void 0;this._before&&zb(this._before,s);const r=t(n in this._hooks?[...this._hooks[n]]:[],o);return r instanceof Promise?r.finally(()=>{this._after&&s&&zb(this._after,s)}):(this._after&&s&&zb(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const n=this._before.indexOf(t);n!==-1&&this._before.splice(n,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const n=this._after.indexOf(t);n!==-1&&this._after.splice(n,1)}}}}function bP(){return new dq}var hq=Object.create,SP=Object.defineProperty,fq=Object.getOwnPropertyDescriptor,jb=Object.getOwnPropertyNames,pq=Object.getPrototypeOf,gq=Object.prototype.hasOwnProperty,mq=(e,t)=>function(){return e&&(t=(0,e[jb(e)[0]])(e=0)),t},EP=(e,t)=>function(){return t||(0,e[jb(e)[0]])((t={exports:{}}).exports,t),t.exports},vq=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of jb(t))!gq.call(e,s)&&s!==n&&SP(e,s,{get:()=>t[s],enumerable:!(o=fq(t,s))||o.enumerable});return e},yq=(e,t,n)=>(n=e!=null?hq(pq(e)):{},vq(SP(n,"default",{value:e,enumerable:!0}),e)),et=mq({"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),wq=EP({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(e,t){et(),function(n){var o={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"Ae",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"Oe",Ő:"O",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"Ue",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"ae",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",ő:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",ا:"a",أ:"a",إ:"i",آ:"aa",ؤ:"u",ئ:"e",ء:"a",ب:"b",ت:"t",ث:"th",ج:"j",ح:"h",خ:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",ش:"sh",ص:"s",ض:"dh",ط:"t",ظ:"z",ع:"a",غ:"gh",ف:"f",ق:"q",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"w",ي:"y",ى:"a",ة:"h",ﻻ:"la",ﻷ:"laa",ﻹ:"lai",ﻵ:"laa",گ:"g",چ:"ch",پ:"p",ژ:"zh",ک:"k",ی:"y","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9",က:"k",ခ:"kh",ဂ:"g",ဃ:"ga",င:"ng",စ:"s",ဆ:"sa",ဇ:"z","စျ":"za",ည:"ny",ဋ:"t",ဌ:"ta",ဍ:"d",ဎ:"da",ဏ:"na",တ:"t",ထ:"ta",ဒ:"d",ဓ:"da",န:"n",ပ:"p",ဖ:"pa",ဗ:"b",ဘ:"ba",မ:"m",ယ:"y",ရ:"ya",လ:"l",ဝ:"w",သ:"th",ဟ:"h",ဠ:"la",အ:"a","ြ":"y","ျ":"ya","ွ":"w","ြွ":"yw","ျွ":"ywa","ှ":"h",ဧ:"e","၏":"-e",ဣ:"i",ဤ:"-i",ဉ:"u",ဦ:"-u",ဩ:"aw","သြော":"aw",ဪ:"aw","၀":"0","၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","္":"","့":"","း":"",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z",ހ:"h",ށ:"sh",ނ:"n",ރ:"r",ބ:"b",ޅ:"lh",ކ:"k",އ:"a",ވ:"v",މ:"m",ފ:"f",ދ:"dh",ތ:"th",ލ:"l",ގ:"g",ޏ:"gn",ސ:"s",ޑ:"d",ޒ:"z",ޓ:"t",ޔ:"y",ޕ:"p",ޖ:"j",ޗ:"ch",ޘ:"tt",ޙ:"hh",ޚ:"kh",ޛ:"th",ޜ:"z",ޝ:"sh",ޞ:"s",ޟ:"d",ޠ:"t",ޡ:"z",ޢ:"a",ޣ:"gh",ޤ:"q",ޥ:"w","ަ":"a","ާ":"aa","ި":"i","ީ":"ee","ު":"u","ޫ":"oo","ެ":"e","ޭ":"ey","ޮ":"o","ޯ":"oa","ް":"",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"o",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"i",ώ:"o",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"I",Θ:"TH",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"KS",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Υ:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"I",Ώ:"O",Ϊ:"I",Ϋ:"Y",ā:"a",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",ū:"u",Ā:"A",Ē:"E",Ģ:"G",Ī:"I",Ķ:"k",Ļ:"L",Ņ:"N",Ū:"U",Ќ:"Kj",ќ:"kj",Љ:"Lj",љ:"lj",Њ:"Nj",њ:"nj",Тс:"Ts",тс:"ts",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Ż:"Z",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",ă:"a",Ă:"A",ș:"s",Ș:"S",ț:"t",Ț:"T",ţ:"t",Ţ:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"I",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",ђ:"dj",ј:"j",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Ћ:"C",Џ:"Dz",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",ả:"a",Ả:"A",ẳ:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",đ:"d",Đ:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",ề:"e",Ề:"E",ệ:"e",Ệ:"E",ễ:"e",Ễ:"E",ể:"e",Ể:"E",ỏ:"o",ọ:"o",Ọ:"o",ố:"o",Ố:"O",ồ:"o",Ồ:"O",ổ:"o",Ổ:"O",ộ:"o",Ộ:"O",ỗ:"o",Ỗ:"O",ơ:"o",Ơ:"O",ớ:"o",Ớ:"O",ờ:"o",Ờ:"O",ợ:"o",Ợ:"O",ỡ:"o",Ỡ:"O",Ở:"o",ở:"o",ị:"i",Ị:"I",ĩ:"i",Ĩ:"I",ỉ:"i",Ỉ:"i",ủ:"u",Ủ:"U",ụ:"u",Ụ:"U",ũ:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",ự:"u",Ự:"U",ữ:"u",Ữ:"U",ử:"u",Ử:"ư",ỷ:"y",Ỷ:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",Ỵ:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",ấ:"a",Ấ:"A",ầ:"a",Ầ:"A",ậ:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","⓪":"0","①":"1","②":"2","③":"3","④":"4","⑤":"5","⑥":"6","⑦":"7","⑧":"8","⑨":"9","⑩":"10","⑪":"11","⑫":"12","⑬":"13","⑭":"14","⑮":"15","⑯":"16","⑰":"17","⑱":"18","⑲":"18","⑳":"18","⓵":"1","⓶":"2","⓷":"3","⓸":"4","⓹":"5","⓺":"6","⓻":"7","⓼":"8","⓽":"9","⓾":"10","⓿":"0","⓫":"11","⓬":"12","⓭":"13","⓮":"14","⓯":"15","⓰":"16","⓱":"17","⓲":"18","⓳":"19","⓴":"20","Ⓐ":"A","Ⓑ":"B","Ⓒ":"C","Ⓓ":"D","Ⓔ":"E","Ⓕ":"F","Ⓖ":"G","Ⓗ":"H","Ⓘ":"I","Ⓙ":"J","Ⓚ":"K","Ⓛ":"L","Ⓜ":"M","Ⓝ":"N","Ⓞ":"O","Ⓟ":"P","Ⓠ":"Q","Ⓡ":"R","Ⓢ":"S","Ⓣ":"T","Ⓤ":"U","Ⓥ":"V","Ⓦ":"W","Ⓧ":"X","Ⓨ":"Y","Ⓩ":"Z","ⓐ":"a","ⓑ":"b","ⓒ":"c","ⓓ":"d","ⓔ":"e","ⓕ":"f","ⓖ":"g","ⓗ":"h","ⓘ":"i","ⓙ":"j","ⓚ":"k","ⓛ":"l","ⓜ":"m","ⓝ":"n","ⓞ":"o","ⓟ":"p","ⓠ":"q","ⓡ":"r","ⓢ":"s","ⓣ":"t","ⓤ":"u","ⓦ":"v","ⓥ":"w","ⓧ":"x","ⓨ":"y","ⓩ":"z","“":'"',"”":'"',"‘":"'","’":"'","∂":"d",ƒ:"f","™":"(TM)","©":"(C)",œ:"oe",Œ:"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o",º:"o",ª:"a","•":"*","၊":",","။":".",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY",元:"CNY",円:"YEN","﷼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","₺":"TRY","؋":"AFN","₼":"AZN",лв:"BGN","៛":"KHR","₡":"CRC","₸":"KZT",ден:"MKD",zł:"PLN","₽":"RUB","₾":"GEL"},s=["်","ް"],r={"ာ":"a","ါ":"a","ေ":"e","ဲ":"e","ိ":"i","ီ":"i","ို":"o","ု":"u","ူ":"u","ေါင်":"aung","ော":"aw","ော်":"aw","ေါ":"aw","ေါ်":"aw","်":"်","က်":"et","ိုက်":"aik","ောက်":"auk","င်":"in","ိုင်":"aing","ောင်":"aung","စ်":"it","ည်":"i","တ်":"at","ိတ်":"eik","ုတ်":"ok","ွတ်":"ut","ေတ်":"it","ဒ်":"d","ိုဒ်":"ok","ုဒ်":"ait","န်":"an","ာန်":"an","ိန်":"ein","ုန်":"on","ွန်":"un","ပ်":"at","ိပ်":"eik","ုပ်":"ok","ွပ်":"ut","န်ုပ်":"nub","မ်":"an","ိမ်":"ein","ုမ်":"on","ွမ်":"un","ယ်":"e","ိုလ်":"ol","ဉ်":"in","ံ":"an","ိံ":"ein","ုံ":"on","ައް":"ah","ަށް":"ah"},i={en:{},az:{ç:"c",ə:"e",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"C",Ə:"E",Ğ:"G",İ:"I",Ö:"O",Ş:"S",Ü:"U"},cs:{č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z"},fi:{ä:"a",Ä:"A",ö:"o",Ö:"O"},hu:{ä:"a",Ä:"A",ö:"o",Ö:"O",ü:"u",Ü:"U",ű:"u",Ű:"U"},lt:{ą:"a",č:"c",ę:"e",ė:"e",į:"i",š:"s",ų:"u",ū:"u",ž:"z",Ą:"A",Č:"C",Ę:"E",Ė:"E",Į:"I",Š:"S",Ų:"U",Ū:"U"},lv:{ā:"a",č:"c",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",š:"s",ū:"u",ž:"z",Ā:"A",Č:"C",Ē:"E",Ģ:"G",Ī:"i",Ķ:"k",Ļ:"L",Ņ:"N",Š:"S",Ū:"u",Ž:"Z"},pl:{ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ó:"o",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"e",Ł:"L",Ń:"N",Ó:"O",Ś:"S",Ź:"Z",Ż:"Z"},sv:{ä:"a",Ä:"A",ö:"o",Ö:"O"},sk:{ä:"a",Ä:"A"},sr:{љ:"lj",њ:"nj",Љ:"Lj",Њ:"Nj",đ:"dj",Đ:"Dj"},tr:{Ü:"U",Ö:"O",ü:"u",ö:"o"}},a={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},l=[";","?",":","@","&","=","+","$",",","/"].join(""),c=[";","?",":","@","&","=","+","$",","].join(""),u=[".","!","~","*","'","(",")"].join(""),d=function(v,w){var S="-",b="",C="",_=!0,E={},I,T,P,M,D,F,O,k,x,$,W,Q,ae,ee,X="";if(typeof v!="string")return"";if(typeof w=="string"&&(S=w),O=a.en,k=i.en,typeof w=="object"){I=w.maintainCase||!1,E=w.custom&&typeof w.custom=="object"?w.custom:E,P=+w.truncate>1&&w.truncate||!1,M=w.uric||!1,D=w.uricNoSlash||!1,F=w.mark||!1,_=!(w.symbols===!1||w.lang===!1),S=w.separator||S,M&&(X+=l),D&&(X+=c),F&&(X+=u),O=w.lang&&a[w.lang]&&_?a[w.lang]:_?a.en:{},k=w.lang&&i[w.lang]?i[w.lang]:w.lang===!1||w.lang===!0?{}:i.en,w.titleCase&&typeof w.titleCase.length=="number"&&Array.prototype.toString.call(w.titleCase)?(w.titleCase.forEach(function(N){E[N+""]=N+""}),T=!0):T=!!w.titleCase,w.custom&&typeof w.custom.length=="number"&&Array.prototype.toString.call(w.custom)&&w.custom.forEach(function(N){E[N+""]=N+""}),Object.keys(E).forEach(function(N){var z;N.length>1?z=new RegExp("\\b"+f(N)+"\\b","gi"):z=new RegExp(f(N),"gi"),v=v.replace(z,E[N])});for(W in E)X+=W}for(X+=S,X=f(X),v=v.replace(/(^\s+|\s+$)/g,""),ae=!1,ee=!1,$=0,Q=v.length;$<Q;$++)W=v[$],p(W,E)?ae=!1:k[W]?(W=ae&&k[W].match(/[A-Za-z0-9]/)?" "+k[W]:k[W],ae=!1):W in o?($+1<Q&&s.indexOf(v[$+1])>=0?(C+=W,W=""):ee===!0?(W=r[C]+o[W],C=""):W=ae&&o[W].match(/[A-Za-z0-9]/)?" "+o[W]:o[W],ae=!1,ee=!1):W in r?(C+=W,W="",$===Q-1&&(W=r[C]),ee=!0):O[W]&&!(M&&l.indexOf(W)!==-1)&&!(D&&c.indexOf(W)!==-1)?(W=ae||b.substr(-1).match(/[A-Za-z0-9]/)?S+O[W]:O[W],W+=v[$+1]!==void 0&&v[$+1].match(/[A-Za-z0-9]/)?S:"",ae=!0):(ee===!0?(W=r[C]+W,C="",ee=!1):ae&&(/[A-Za-z0-9]/.test(W)||b.substr(-1).match(/A-Za-z0-9]/))&&(W=" "+W),ae=!1),b+=W.replace(new RegExp("[^\\w\\s"+X+"_-]","g"),S);return T&&(b=b.replace(/(\w)(\S*)/g,function(N,z,ne){var pe=z.toUpperCase()+(ne!==null?ne:"");return Object.keys(E).indexOf(pe.toLowerCase())<0?pe:pe.toLowerCase()})),b=b.replace(/\s+/g,S).replace(new RegExp("\\"+S+"+","g"),S).replace(new RegExp("(^\\"+S+"+|\\"+S+"+$)","g"),""),P&&b.length>P&&(x=b.charAt(P)===S,b=b.slice(0,P),x||(b=b.slice(0,b.lastIndexOf(S)))),!I&&!T&&(b=b.toLowerCase()),b},h=function(v){return function(S){return d(S,v)}},f=function(v){return v.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},p=function(g,v){for(var w in v)if(v[w]===g)return!0};if(typeof t<"u"&&t.exports)t.exports=d,t.exports.createSlug=h;else if(typeof define<"u"&&define.amd)define([],function(){return d});else try{if(n.getSlug||n.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";n.getSlug=d,n.createSlug=h}catch{}}(e)}}),Cq=EP({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(e,t){et(),t.exports=wq()}});et(),et(),et(),et(),et(),et(),et(),et();function bq(e){var t;const n=e.name||e._componentTag||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||e.__name;return n==="index"&&((t=e.__file)!=null&&t.endsWith("index.vue"))?"":n}function Sq(e){const t=e.__file;if(t)return oq(sq(t,".vue"))}function _P(e,t){return e.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=t,t}function Kb(e){if(e.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(e.root)return e.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function RP(e){var t,n;const o=(t=e.subTree)==null?void 0:t.type,s=Kb(e);return s?((n=s==null?void 0:s.types)==null?void 0:n.Fragment)===o:!1}function Nm(e){var t,n,o;const s=bq((e==null?void 0:e.type)||{});if(s)return s;if((e==null?void 0:e.root)===e)return"Root";for(const i in(n=(t=e.parent)==null?void 0:t.type)==null?void 0:n.components)if(e.parent.type.components[i]===(e==null?void 0:e.type))return _P(e,i);for(const i in(o=e.appContext)==null?void 0:o.components)if(e.appContext.components[i]===(e==null?void 0:e.type))return _P(e,i);const r=Sq((e==null?void 0:e.type)||{});return r||"Anonymous Component"}function Eq(e){var t,n,o;const s=(o=(n=(t=e==null?void 0:e.appContext)==null?void 0:t.app)==null?void 0:n.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__)!=null?o:0,r=e===(e==null?void 0:e.root)?"root":e.uid;return`${s}:${r}`}function qb(e,t){return t=t||`${e.id}:root`,e.instanceMap.get(t)||e.instanceMap.get(":root")}function _q(){const e={top:0,bottom:0,left:0,right:0,get width(){return e.right-e.left},get height(){return e.bottom-e.top}};return e}var Lm;function Rq(e){return Lm||(Lm=document.createRange()),Lm.selectNode(e),Lm.getBoundingClientRect()}function Dq(e){const t=_q();if(!e.children)return t;for(let n=0,o=e.children.length;n<o;n++){const s=e.children[n];let r;if(s.component)r=ec(s.component);else if(s.el){const i=s.el;i.nodeType===1||i.getBoundingClientRect?r=i.getBoundingClientRect():i.nodeType===3&&i.data.trim()&&(r=Rq(i))}r&&Tq(t,r)}return t}function Tq(e,t){return(!e.top||t.top<e.top)&&(e.top=t.top),(!e.bottom||t.bottom>e.bottom)&&(e.bottom=t.bottom),(!e.left||t.left<e.left)&&(e.left=t.left),(!e.right||t.right>e.right)&&(e.right=t.right),e}var DP={top:0,left:0,right:0,bottom:0,width:0,height:0};function ec(e){const t=e.subTree.el;return typeof window>"u"?DP:RP(e)?Dq(e.subTree):(t==null?void 0:t.nodeType)===1?t==null?void 0:t.getBoundingClientRect():e.subTree.component?ec(e.subTree.component):DP}et();function Yb(e){return RP(e)?Iq(e.subTree):e.subTree?[e.subTree.el]:[]}function Iq(e){if(!e.children)return[];const t=[];return e.children.forEach(n=>{n.component?t.push(...Yb(n.component)):n!=null&&n.el&&t.push(n.el)}),t}var TP="__vue-devtools-component-inspector__",IP="__vue-devtools-component-inspector__card__",xP="__vue-devtools-component-inspector__name__",FP="__vue-devtools-component-inspector__indicator__",PP={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},xq={fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 8px",borderRadius:"4px",textAlign:"left",position:"absolute",left:0,color:"#e9e9e9",fontSize:"14px",fontWeight:600,lineHeight:"24px",backgroundColor:"#42b883",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},Fq={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function Au(){return document.getElementById(TP)}function Pq(){return document.getElementById(IP)}function kq(){return document.getElementById(FP)}function Aq(){return document.getElementById(xP)}function Zb(e){return{left:`${Math.round(e.left*100)/100}px`,top:`${Math.round(e.top*100)/100}px`,width:`${Math.round(e.width*100)/100}px`,height:`${Math.round(e.height*100)/100}px`}}function Xb(e){var t;const n=document.createElement("div");n.id=(t=e.elementId)!=null?t:TP,Object.assign(n.style,{...PP,...Zb(e.bounds),...e.style});const o=document.createElement("span");o.id=IP,Object.assign(o.style,{...xq,top:e.bounds.top<35?0:"-35px"});const s=document.createElement("span");s.id=xP,s.innerHTML=`<${e.name}> `;const r=document.createElement("i");return r.id=FP,r.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`,Object.assign(r.style,Fq),o.appendChild(s),o.appendChild(r),n.appendChild(o),document.body.appendChild(n),n}function Jb(e){const t=Au(),n=Pq(),o=Aq(),s=kq();t&&(Object.assign(t.style,{...PP,...Zb(e.bounds)}),Object.assign(n.style,{top:e.bounds.top<35?0:"-35px"}),o.innerHTML=`<${e.name}> `,s.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`)}function Oq(e){const t=ec(e);if(!t.width&&!t.height)return;const n=Nm(e);Au()?Jb({bounds:t,name:n}):Xb({bounds:t,name:n})}function kP(){const e=Au();e&&(e.style.display="none")}var Qb=null;function eS(e){const t=e.target;if(t){const n=t.__vueParentComponent;if(n&&(Qb=n,n.vnode.el)){const s=ec(n),r=Nm(n);Au()?Jb({bounds:s,name:r}):Xb({bounds:s,name:r})}}}function Mq(e,t){if(e.preventDefault(),e.stopPropagation(),Qb){const n=Eq(Qb);t(n)}}var Vm=null;function Nq(){kP(),window.removeEventListener("mouseover",eS),window.removeEventListener("click",Vm,!0),Vm=null}function Lq(){return window.addEventListener("mouseover",eS),new Promise(e=>{function t(n){n.preventDefault(),n.stopPropagation(),Mq(n,o=>{window.removeEventListener("click",t,!0),Vm=null,window.removeEventListener("mouseover",eS);const s=Au();s&&(s.style.display="none"),e(JSON.stringify({id:o}))})}Vm=t,window.addEventListener("click",t,!0)})}function Vq(e){const t=qb(ts.value,e.id);if(t){const[n]=Yb(t);if(typeof n.scrollIntoView=="function")n.scrollIntoView({behavior:"smooth"});else{const o=ec(t),s=document.createElement("div"),r={...Zb(o),position:"absolute"};Object.assign(s.style,r),document.body.appendChild(s),s.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(s)},2e3)}setTimeout(()=>{const o=ec(t);if(o.width||o.height){const s=Nm(t),r=Au();r?Jb({...e,name:s,bounds:o}):Xb({...e,name:s,bounds:o}),setTimeout(()=>{r&&(r.style.display="none")},1500)}},1200)}}et();var AP,OP;(OP=(AP=Tt).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__)!=null||(AP.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function Bq(e){let t=0;const n=setInterval(()=>{Tt.__VUE_INSPECTOR__&&(clearInterval(n),t+=30,e()),t>=5e3&&clearInterval(n)},30)}function $q(){const e=Tt.__VUE_INSPECTOR__,t=e.openInEditor;e.openInEditor=async(...n)=>{e.disable(),t(...n)}}function Hq(){return new Promise(e=>{function t(){$q(),e(Tt.__VUE_INSPECTOR__)}Tt.__VUE_INSPECTOR__?t():Bq(()=>{t()})})}et(),et();function Gq(e){return!!(e&&e.__v_isReadonly)}function MP(e){return Gq(e)?MP(e.__v_raw):!!(e&&e.__v_isReactive)}function tS(e){return!!(e&&e.__v_isRef===!0)}function cf(e){const t=e&&e.__v_raw;return t?cf(t):e}var Uq=class{constructor(){this.refEditor=new Wq}set(e,t,n,o){const s=Array.isArray(t)?t:t.split(".");for(;s.length>1;){const a=s.shift();e instanceof Map?e=e.get(a):e instanceof Set?e=Array.from(e.values())[a]:e=e[a],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}const r=s[0],i=this.refEditor.get(e)[r];o?o(e,r,n):this.refEditor.isRef(i)?this.refEditor.set(i,n):e[r]=n}get(e,t){const n=Array.isArray(t)?t:t.split(".");for(let o=0;o<n.length;o++)if(e instanceof Map?e=e.get(n[o]):e=e[n[o]],this.refEditor.isRef(e)&&(e=this.refEditor.get(e)),!e)return;return e}has(e,t,n=!1){if(typeof e>"u")return!1;const o=Array.isArray(t)?t.slice():t.split("."),s=n?2:1;for(;e&&o.length>s;){const r=o.shift();e=e[r],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}return e!=null&&Object.prototype.hasOwnProperty.call(e,o[0])}createDefaultSetCallback(e){return(t,n,o)=>{if((e.remove||e.newKey)&&(Array.isArray(t)?t.splice(n,1):cf(t)instanceof Map?t.delete(n):cf(t)instanceof Set?t.delete(Array.from(t.values())[n]):Reflect.deleteProperty(t,n)),!e.remove){const s=t[e.newKey||n];this.refEditor.isRef(s)?this.refEditor.set(s,o):cf(t)instanceof Map?t.set(e.newKey||n,o):cf(t)instanceof Set?t.add(o):t[e.newKey||n]=o}}}},Wq=class{set(e,t){if(tS(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(s=>e.add(s));return}const n=Object.keys(t);if(e instanceof Map){const s=new Set(e.keys());n.forEach(r=>{e.set(r,Reflect.get(t,r)),s.delete(r)}),s.forEach(r=>e.delete(r));return}const o=new Set(Object.keys(e));n.forEach(s=>{Reflect.set(e,s,Reflect.get(t,s)),o.delete(s)}),o.forEach(s=>Reflect.deleteProperty(e,s))}}get(e){return tS(e)?e.value:e}isRef(e){return tS(e)||MP(e)}};et(),et(),et();var zq="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function jq(){if(typeof window>"u"||!vP||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const e=typeof localStorage.getItem<"u"?localStorage.getItem(zq):null;return e?JSON.parse(e):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}et(),et(),et();var NP,LP;(LP=(NP=Tt).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS)!=null||(NP.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var Kq=new Proxy(Tt.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(e,t,n){return Reflect.get(e,t,n)}});function qq(e,t){wo.timelineLayersState[t.id]=!1,Kq.push({...e,descriptorId:t.id,appRecord:Kb(t.app)})}var VP,BP;(BP=(VP=Tt).__VUE_DEVTOOLS_KIT_INSPECTOR__)!=null||(VP.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var nS=new Proxy(Tt.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(e,t,n){return Reflect.get(e,t,n)}}),$P=ku(()=>{Mu.hooks.callHook("sendInspectorToClient",HP())});function Yq(e,t){var n,o;nS.push({options:e,descriptor:t,treeFilterPlaceholder:(n=e.treeFilterPlaceholder)!=null?n:"Search tree...",stateFilterPlaceholder:(o=e.stateFilterPlaceholder)!=null?o:"Search state...",treeFilter:"",selectedNodeId:"",appRecord:Kb(t.app)}),$P()}function HP(){return nS.filter(e=>e.descriptor.app===ts.value.app).filter(e=>e.descriptor.id!=="components").map(e=>{var t;const n=e.descriptor,o=e.options;return{id:o.id,label:o.label,logo:n.logo,icon:`custom-ic-baseline-${(t=o==null?void 0:o.icon)==null?void 0:t.replace(/_/g,"-")}`,packageName:n.packageName,homepage:n.homepage,pluginId:n.id}})}function Bm(e,t){return nS.find(n=>n.options.id===e&&(t?n.descriptor.app===t:!0))}function Zq(){const e=bP();e.hook("addInspector",({inspector:o,plugin:s})=>{Yq(o,s.descriptor)});const t=ku(async({inspectorId:o,plugin:s})=>{var r;if(!o||!((r=s==null?void 0:s.descriptor)!=null&&r.app)||wo.highPerfModeEnabled)return;const i=Bm(o,s.descriptor.app),a={app:s.descriptor.app,inspectorId:o,filter:(i==null?void 0:i.treeFilter)||"",rootNodes:[]};await new Promise(l=>{e.callHookWith(async c=>{await Promise.all(c.map(u=>u(a))),l()},"getInspectorTree")}),e.callHookWith(async l=>{await Promise.all(l.map(c=>c({inspectorId:o,rootNodes:a.rootNodes})))},"sendInspectorTreeToClient")},120);e.hook("sendInspectorTree",t);const n=ku(async({inspectorId:o,plugin:s})=>{var r;if(!o||!((r=s==null?void 0:s.descriptor)!=null&&r.app)||wo.highPerfModeEnabled)return;const i=Bm(o,s.descriptor.app),a={app:s.descriptor.app,inspectorId:o,nodeId:(i==null?void 0:i.selectedNodeId)||"",state:null},l={currentTab:`custom-inspector:${o}`};a.nodeId&&await new Promise(c=>{e.callHookWith(async u=>{await Promise.all(u.map(d=>d(a,l))),c()},"getInspectorState")}),e.callHookWith(async c=>{await Promise.all(c.map(u=>u({inspectorId:o,nodeId:a.nodeId,state:a.state})))},"sendInspectorStateToClient")},120);return e.hook("sendInspectorState",n),e.hook("customInspectorSelectNode",({inspectorId:o,nodeId:s,plugin:r})=>{const i=Bm(o,r.descriptor.app);i&&(i.selectedNodeId=s)}),e.hook("timelineLayerAdded",({options:o,plugin:s})=>{qq(o,s.descriptor)}),e.hook("timelineEventAdded",({options:o,plugin:s})=>{var r;const i=["performance","component-event","keyboard","mouse"];wo.highPerfModeEnabled||!((r=wo.timelineLayersState)!=null&&r[s.descriptor.id])&&!i.includes(o.layerId)||e.callHookWith(async a=>{await Promise.all(a.map(l=>l(o)))},"sendTimelineEventToClient")}),e.hook("getComponentInstances",async({app:o})=>{const s=o.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!s)return null;const r=s.id.toString();return[...s.instanceMap].filter(([a])=>a.split(":")[0]===r).map(([,a])=>a)}),e.hook("getComponentBounds",async({instance:o})=>ec(o)),e.hook("getComponentName",({instance:o})=>Nm(o)),e.hook("componentHighlight",({uid:o})=>{const s=ts.value.instanceMap.get(o);s&&Oq(s)}),e.hook("componentUnhighlight",()=>{kP()}),e}var GP,UP;(UP=(GP=Tt).__VUE_DEVTOOLS_KIT_APP_RECORDS__)!=null||(GP.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var WP,zP;(zP=(WP=Tt).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__)!=null||(WP.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var jP,KP;(KP=(jP=Tt).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__)!=null||(jP.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__="");var qP,YP;(YP=(qP=Tt).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__)!=null||(qP.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var ZP,XP;(XP=(ZP=Tt).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__)!=null||(ZP.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var tc="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function Xq(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:jq()}}var JP,QP;(QP=(JP=Tt)[tc])!=null||(JP[tc]=Xq());var Jq=ku(e=>{Mu.hooks.callHook("devtoolsStateUpdated",{state:e})});ku((e,t)=>{Mu.hooks.callHook("devtoolsConnectedUpdated",{state:e,oldState:t})});var $m=new Proxy(Tt.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(e,t,n){return t==="value"?Tt.__VUE_DEVTOOLS_KIT_APP_RECORDS__:Tt.__VUE_DEVTOOLS_KIT_APP_RECORDS__[t]}}),ts=new Proxy(Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(e,t,n){return t==="value"?Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:t==="id"?Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[t]}});function ek(){Jq({...Tt[tc],appRecords:$m.value,activeAppRecordId:ts.id,tabs:Tt.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:Tt.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function Qq(e){Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=e,ek()}function eY(e){Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=e,ek()}var wo=new Proxy(Tt[tc],{get(e,t){return t==="appRecords"?$m:t==="activeAppRecordId"?ts.id:t==="tabs"?Tt.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:t==="commands"?Tt.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:Tt[tc][t]},deleteProperty(e,t){return delete e[t],!0},set(e,t,n){return{...Tt[tc]},e[t]=n,Tt[tc][t]=n,!0}});function tY(e={}){var t,n,o;const{file:s,host:r,baseUrl:i=window.location.origin,line:a=0,column:l=0}=e;if(s){if(r==="chrome-extension"){const c=s.replace(/\\/g,"\\\\"),u=(n=(t=window.VUE_DEVTOOLS_CONFIG)==null?void 0:t.openInEditorHost)!=null?n:"/";fetch(`${u}__open-in-editor?file=${encodeURI(s)}`).then(d=>{if(!d.ok){const h=`Opening component ${c} failed`;console.log(`%c${h}`,"color:red")}})}else if(wo.vitePluginDetected){const c=(o=Tt.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__)!=null?o:i;Tt.__VUE_INSPECTOR__.openInEditor(c,s,a,l)}}}et(),et(),et(),et(),et();var tk,nk;(nk=(tk=Tt).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__)!=null||(tk.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var oS=new Proxy(Tt.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(e,t,n){return Reflect.get(e,t,n)}});function sS(e){const t={};return Object.keys(e).forEach(n=>{t[n]=e[n].defaultValue}),t}function rS(e){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${e}__`}function nY(e){var t,n,o;const s=(n=(t=oS.find(r=>{var i;return r[0].id===e&&!!((i=r[0])!=null&&i.settings)}))==null?void 0:t[0])!=null?n:null;return(o=s==null?void 0:s.settings)!=null?o:null}function ok(e,t){var n,o,s;const r=rS(e);if(r){const i=localStorage.getItem(r);if(i)return JSON.parse(i)}if(e){const i=(o=(n=oS.find(a=>a[0].id===e))==null?void 0:n[0])!=null?o:null;return sS((s=i==null?void 0:i.settings)!=null?s:{})}return sS(t)}function oY(e,t){const n=rS(e);localStorage.getItem(n)||localStorage.setItem(n,JSON.stringify(sS(t)))}function sY(e,t,n){const o=rS(e),s=localStorage.getItem(o),r=JSON.parse(s||"{}"),i={...r,[t]:n};localStorage.setItem(o,JSON.stringify(i)),Mu.hooks.callHookWith(a=>{a.forEach(l=>l({pluginId:e,key:t,oldValue:r[t],newValue:n,settings:i}))},"setPluginSettings")}et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et();var sk,rk,Os=(rk=(sk=Tt).__VUE_DEVTOOLS_HOOK)!=null?rk:sk.__VUE_DEVTOOLS_HOOK=bP(),rY={vueAppInit(e){Os.hook("app:init",e)},vueAppUnmount(e){Os.hook("app:unmount",e)},vueAppConnected(e){Os.hook("app:connected",e)},componentAdded(e){return Os.hook("component:added",e)},componentEmit(e){return Os.hook("component:emit",e)},componentUpdated(e){return Os.hook("component:updated",e)},componentRemoved(e){return Os.hook("component:removed",e)},setupDevtoolsPlugin(e){Os.hook("devtools-plugin:setup",e)},perfStart(e){return Os.hook("perf:start",e)},perfEnd(e){return Os.hook("perf:end",e)}},ik={on:rY,setupDevToolsPlugin(e,t){return Os.callHook("devtools-plugin:setup",e,t)}},iY=class{constructor({plugin:e,ctx:t}){this.hooks=t.hooks,this.plugin=e}get on(){return{visitComponentTree:e=>{this.hooks.hook("visitComponentTree",e)},inspectComponent:e=>{this.hooks.hook("inspectComponent",e)},editComponentState:e=>{this.hooks.hook("editComponentState",e)},getInspectorTree:e=>{this.hooks.hook("getInspectorTree",e)},getInspectorState:e=>{this.hooks.hook("getInspectorState",e)},editInspectorState:e=>{this.hooks.hook("editInspectorState",e)},inspectTimelineEvent:e=>{this.hooks.hook("inspectTimelineEvent",e)},timelineCleared:e=>{this.hooks.hook("timelineCleared",e)},setPluginSettings:e=>{this.hooks.hook("setPluginSettings",e)}}}notifyComponentUpdate(e){var t;if(wo.highPerfModeEnabled)return;const n=HP().find(o=>o.packageName===this.plugin.descriptor.packageName);if(n!=null&&n.id){if(e){const o=[e.appContext.app,e.uid,(t=e.parent)==null?void 0:t.uid,e];Os.callHook("component:updated",...o)}else Os.callHook("component:updated");this.hooks.callHook("sendInspectorState",{inspectorId:n.id,plugin:this.plugin})}}addInspector(e){this.hooks.callHook("addInspector",{inspector:e,plugin:this.plugin}),this.plugin.descriptor.settings&&oY(e.id,this.plugin.descriptor.settings)}sendInspectorTree(e){wo.highPerfModeEnabled||this.hooks.callHook("sendInspectorTree",{inspectorId:e,plugin:this.plugin})}sendInspectorState(e){wo.highPerfModeEnabled||this.hooks.callHook("sendInspectorState",{inspectorId:e,plugin:this.plugin})}selectInspectorNode(e,t){this.hooks.callHook("customInspectorSelectNode",{inspectorId:e,nodeId:t,plugin:this.plugin})}visitComponentTree(e){return this.hooks.callHook("visitComponentTree",e)}now(){return wo.highPerfModeEnabled?0:Date.now()}addTimelineLayer(e){this.hooks.callHook("timelineLayerAdded",{options:e,plugin:this.plugin})}addTimelineEvent(e){wo.highPerfModeEnabled||this.hooks.callHook("timelineEventAdded",{options:e,plugin:this.plugin})}getSettings(e){return ok(e??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(e){return this.hooks.callHook("getComponentInstances",{app:e})}getComponentBounds(e){return this.hooks.callHook("getComponentBounds",{instance:e})}getComponentName(e){return this.hooks.callHook("getComponentName",{instance:e})}highlightElement(e){const t=e.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook("componentHighlight",{uid:t})}unhighlightElement(){return this.hooks.callHook("componentUnhighlight")}},aY=iY;et(),et(),et(),et();var lY="__vue_devtool_undefined__",cY="__vue_devtool_infinity__",uY="__vue_devtool_negative_infinity__",dY="__vue_devtool_nan__";et(),et();var hY={[lY]:"undefined",[dY]:"NaN",[cY]:"Infinity",[uY]:"-Infinity"};Object.entries(hY).reduce((e,[t,n])=>(e[n]=t,e),{}),et(),et(),et(),et(),et();var ak,lk;(lk=(ak=Tt).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__)!=null||(ak.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function ck(e,t){return ik.setupDevToolsPlugin(e,t)}function fY(e,t){const[n,o]=e;if(n.app!==t)return;const s=new aY({plugin:{setupFn:o,descriptor:n},ctx:Mu});n.packageName==="vuex"&&s.on.editInspectorState(r=>{s.sendInspectorState(r.inspectorId)}),o(s)}function uk(e,t){Tt.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(e)||wo.highPerfModeEnabled&&!(t!=null&&t.inspectingComponent)||(Tt.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(e),oS.forEach(n=>{fY(n,e)}))}et(),et();var uf="__VUE_DEVTOOLS_ROUTER__",Ou="__VUE_DEVTOOLS_ROUTER_INFO__",dk,hk;(hk=(dk=Tt)[Ou])!=null||(dk[Ou]={currentRoute:null,routes:[]});var fk,pk;(pk=(fk=Tt)[uf])!=null||(fk[uf]={}),new Proxy(Tt[Ou],{get(e,t){return Tt[Ou][t]}}),new Proxy(Tt[uf],{get(e,t){if(t==="value")return Tt[uf]}});function pY(e){const t=new Map;return((e==null?void 0:e.getRoutes())||[]).filter(n=>!t.has(n.path)&&t.set(n.path,1))}function iS(e){return e.map(t=>{let{path:n,name:o,children:s,meta:r}=t;return s!=null&&s.length&&(s=iS(s)),{path:n,name:o,children:s,meta:r}})}function gY(e){if(e){const{fullPath:t,hash:n,href:o,path:s,name:r,matched:i,params:a,query:l}=e;return{fullPath:t,hash:n,href:o,path:s,name:r,params:a,query:l,matched:iS(i)}}return e}function mY(e,t){function n(){var o;const s=(o=e.app)==null?void 0:o.config.globalProperties.$router,r=gY(s==null?void 0:s.currentRoute.value),i=iS(pY(s)),a=console.warn;console.warn=()=>{},Tt[Ou]={currentRoute:r?wP(r):{},routes:wP(i)},Tt[uf]=s,console.warn=a}n(),ik.on.componentUpdated(ku(()=>{var o;((o=t.value)==null?void 0:o.app)===e.app&&(n(),!wo.highPerfModeEnabled&&Mu.hooks.callHook("routerInfoUpdated",{state:Tt[Ou]}))},200))}function vY(e){return{async getInspectorTree(t){const n={...t,app:ts.value.app,rootNodes:[]};return await new Promise(o=>{e.callHookWith(async s=>{await Promise.all(s.map(r=>r(n))),o()},"getInspectorTree")}),n.rootNodes},async getInspectorState(t){const n={...t,app:ts.value.app,state:null},o={currentTab:`custom-inspector:${t.inspectorId}`};return await new Promise(s=>{e.callHookWith(async r=>{await Promise.all(r.map(i=>i(n,o))),s()},"getInspectorState")}),n.state},editInspectorState(t){const n=new Uq,o={...t,app:ts.value.app,set:(s,r=t.path,i=t.state.value,a)=>{n.set(s,r,i,a||n.createDefaultSetCallback(t.state))}};e.callHookWith(s=>{s.forEach(r=>r(o))},"editInspectorState")},sendInspectorState(t){const n=Bm(t);e.callHook("sendInspectorState",{inspectorId:t,plugin:{descriptor:n.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return Lq()},cancelInspectComponentInspector(){return Nq()},getComponentRenderCode(t){const n=qb(ts.value,t);if(n)return typeof(n==null?void 0:n.type)!="function"?n.render.toString():n.type.toString()},scrollToComponent(t){return Vq({id:t})},openInEditor:tY,getVueInspector:Hq,toggleApp(t,n){const o=$m.value.find(s=>s.id===t);o&&(eY(t),Qq(o),mY(o,ts),$P(),uk(o.app,n))},inspectDOM(t){const n=qb(ts.value,t);if(n){const[o]=Yb(n);o&&(Tt.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=o)}},updatePluginSettings(t,n,o){sY(t,n,o)},getPluginSettings(t){return{options:nY(t),values:ok(t)}}}}et();var gk,mk;(mk=(gk=Tt).__VUE_DEVTOOLS_ENV__)!=null||(gk.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var vk=Zq(),yk,wk;(wk=(yk=Tt).__VUE_DEVTOOLS_KIT_CONTEXT__)!=null||(yk.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:vk,get state(){return{...wo,activeAppRecordId:ts.id,activeAppRecord:ts.value,appRecords:$m.value}},api:vY(vk)});var Mu=Tt.__VUE_DEVTOOLS_KIT_CONTEXT__;et(),yq(Cq());var Ck,bk;(bk=(Ck=Tt).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__)!=null||(Ck.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set}),et(),et();function yY(e){wo.highPerfModeEnabled=e??!wo.highPerfModeEnabled,!e&&ts.value&&uk(ts.value.app)}et(),et(),et();function wY(e){wo.devtoolsClientDetected={...wo.devtoolsClientDetected,...e};const t=Object.values(wo.devtoolsClientDetected).some(Boolean);yY(!t)}var Sk,Ek;(Ek=(Sk=Tt).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__)!=null||(Sk.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=wY),et(),et(),et(),et(),et(),et(),et();var CY=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},_k=class{constructor(t){this.generateIdentifier=t,this.kv=new CY}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},bY=class extends _k{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};et(),et();function SY(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function EY(e,t){const n=SY(e);if("find"in n)return n.find(t);const o=n;for(let s=0;s<o.length;s++){const r=o[s];if(t(r))return r}}function Nu(e,t){Object.entries(e).forEach(([n,o])=>t(o,n))}function Hm(e,t){return e.indexOf(t)!==-1}function Rk(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(t(o))return o}}var _Y=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return EY(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}};et(),et();var RY=e=>Object.prototype.toString.call(e).slice(8,-1),Dk=e=>typeof e>"u",DY=e=>e===null,df=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,aS=e=>df(e)&&Object.keys(e).length===0,za=e=>Array.isArray(e),TY=e=>typeof e=="string",IY=e=>typeof e=="number"&&!isNaN(e),xY=e=>typeof e=="boolean",FY=e=>e instanceof RegExp,hf=e=>e instanceof Map,ff=e=>e instanceof Set,Tk=e=>RY(e)==="Symbol",PY=e=>e instanceof Date&&!isNaN(e.valueOf()),kY=e=>e instanceof Error,Ik=e=>typeof e=="number"&&isNaN(e),AY=e=>xY(e)||DY(e)||Dk(e)||IY(e)||TY(e)||Tk(e),OY=e=>typeof e=="bigint",MY=e=>e===1/0||e===-1/0,NY=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),LY=e=>e instanceof URL;et();var xk=e=>e.replace(/\./g,"\\."),lS=e=>e.map(String).map(xk).join("."),pf=e=>{const t=[];let n="";for(let s=0;s<e.length;s++){let r=e.charAt(s);if(r==="\\"&&e.charAt(s+1)==="."){n+=".",s++;continue}if(r==="."){t.push(n),n="";continue}n+=r}const o=n;return t.push(o),t};et();function ci(e,t,n,o){return{isApplicable:e,annotation:t,transform:n,untransform:o}}var Fk=[ci(Dk,"undefined",()=>null,()=>{}),ci(OY,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ci(PY,"Date",e=>e.toISOString(),e=>new Date(e)),ci(kY,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(o=>{n[o]=e[o]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(o=>{n[o]=e[o]}),n}),ci(FY,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ci(ff,"set",e=>[...e.values()],e=>new Set(e)),ci(hf,"map",e=>[...e.entries()],e=>new Map(e)),ci(e=>Ik(e)||MY(e),"number",e=>Ik(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ci(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ci(LY,"URL",e=>e.toString(),e=>new URL(e))];function Gm(e,t,n,o){return{isApplicable:e,annotation:t,transform:n,untransform:o}}var Pk=Gm((e,t)=>Tk(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const o=n.symbolRegistry.getValue(t[1]);if(!o)throw new Error("Trying to deserialize unknown symbol");return o}),VY=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),kk=Gm(NY,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=VY[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Ak(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var Ok=Gm(Ak,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const o={};return n.forEach(s=>{o[s]=e[s]}),o},(e,t,n)=>{const o=n.classRegistry.getValue(t[1]);if(!o)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(o.prototype),e)}),Mk=Gm((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const o=n.customTransformerRegistry.findByName(t[1]);if(!o)throw new Error("Trying to deserialize unknown custom value");return o.deserialize(e)}),BY=[Ok,Pk,Mk,kk],Nk=(e,t)=>{const n=Rk(BY,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const o=Rk(Fk,s=>s.isApplicable(e,t));if(o)return{value:o.transform(e,t),type:o.annotation}},Lk={};Fk.forEach(e=>{Lk[e.annotation]=e});var $Y=(e,t,n)=>{if(za(t))switch(t[0]){case"symbol":return Pk.untransform(e,t,n);case"class":return Ok.untransform(e,t,n);case"custom":return Mk.untransform(e,t,n);case"typed-array":return kk.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const o=Lk[t];if(!o)throw new Error("Unknown transformation: "+t);return o.untransform(e,n)}};et();var Lu=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Vk(e){if(Hm(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Hm(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Hm(e,"constructor"))throw new Error("constructor is not allowed as a property")}var HY=(e,t)=>{Vk(t);for(let n=0;n<t.length;n++){const o=t[n];if(ff(e))e=Lu(e,+o);else if(hf(e)){const s=+o,r=+t[++n]==0?"key":"value",i=Lu(e,s);switch(r){case"key":e=i;break;case"value":e=e.get(i);break}}else e=e[o]}return e},cS=(e,t,n)=>{if(Vk(t),t.length===0)return n(e);let o=e;for(let r=0;r<t.length-1;r++){const i=t[r];if(za(o)){const a=+i;o=o[a]}else if(df(o))o=o[i];else if(ff(o)){const a=+i;o=Lu(o,a)}else if(hf(o)){if(r===t.length-2)break;const l=+i,c=+t[++r]==0?"key":"value",u=Lu(o,l);switch(c){case"key":o=u;break;case"value":o=o.get(u);break}}}const s=t[t.length-1];if(za(o)?o[+s]=n(o[+s]):df(o)&&(o[s]=n(o[s])),ff(o)){const r=Lu(o,+s),i=n(r);r!==i&&(o.delete(r),o.add(i))}if(hf(o)){const r=+t[t.length-2],i=Lu(o,r);switch(+s==0?"key":"value"){case"key":{const l=n(i);o.set(l,o.get(i)),l!==i&&o.delete(i);break}case"value":{o.set(i,n(o.get(i)));break}}}return e};function uS(e,t,n=[]){if(!e)return;if(!za(e)){Nu(e,(r,i)=>uS(r,t,[...n,...pf(i)]));return}const[o,s]=e;s&&Nu(s,(r,i)=>{uS(r,t,[...n,...pf(i)])}),t(o,n)}function GY(e,t,n){return uS(t,(o,s)=>{e=cS(e,s,r=>$Y(r,o,n))}),e}function UY(e,t){function n(o,s){const r=HY(e,pf(s));o.map(pf).forEach(i=>{e=cS(e,i,()=>r)})}if(za(t)){const[o,s]=t;o.forEach(r=>{e=cS(e,pf(r),()=>e)}),s&&Nu(s,n)}else Nu(t,n);return e}var WY=(e,t)=>df(e)||za(e)||hf(e)||ff(e)||Ak(e,t);function zY(e,t,n){const o=n.get(e);o?o.push(t):n.set(e,[t])}function jY(e,t){const n={};let o;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[r,...i]=s;r.length===0?o=i.map(lS):n[lS(r)]=i.map(lS)}),o?aS(n)?[o]:[o,n]:aS(n)?void 0:n}var Bk=(e,t,n,o,s=[],r=[],i=new Map)=>{var a;const l=AY(e);if(!l){zY(e,s,t);const p=i.get(e);if(p)return o?{transformedValue:null}:p}if(!WY(e,n)){const p=Nk(e,n),g=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:e};return l||i.set(e,g),g}if(Hm(r,e))return{transformedValue:null};const c=Nk(e,n),u=(a=c==null?void 0:c.value)!=null?a:e,d=za(u)?[]:{},h={};Nu(u,(p,g)=>{if(g==="__proto__"||g==="constructor"||g==="prototype")throw new Error(`Detected property ${g}. This is a prototype pollution risk, please remove it from your object.`);const v=Bk(p,t,n,o,[...s,g],[...r,e],i);d[g]=v.transformedValue,za(v.annotations)?h[g]=v.annotations:df(v.annotations)&&Nu(v.annotations,(w,S)=>{h[xk(g)+"."+S]=w})});const f=aS(h)?{transformedValue:d,annotations:c?[c.type]:void 0}:{transformedValue:d,annotations:c?[c.type,h]:h};return l||i.set(e,f),f};et(),et();function $k(e){return Object.prototype.toString.call(e).slice(8,-1)}function Hk(e){return $k(e)==="Array"}function KY(e){if($k(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function qY(e,t,n,o,s){const r={}.propertyIsEnumerable.call(o,t)?"enumerable":"nonenumerable";r==="enumerable"&&(e[t]=n),s&&r==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function dS(e,t={}){if(Hk(e))return e.map(s=>dS(s,t));if(!KY(e))return e;const n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e);return[...n,...o].reduce((s,r)=>{if(Hk(t.props)&&!t.props.includes(r))return s;const i=e[r],a=dS(i,t);return qY(s,r,a,e,t.nonenumerable),s},{})}var An=class{constructor({dedupe:e=!1}={}){this.classRegistry=new bY,this.symbolRegistry=new _k(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new _Y,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=Bk(e,t,this,this.dedupe),o={json:n.transformedValue};n.annotations&&(o.meta={...o.meta,values:n.annotations});const s=jY(t,this.dedupe);return s&&(o.meta={...o.meta,referentialEqualities:s}),o}deserialize(e){const{json:t,meta:n}=e;let o=dS(t);return n!=null&&n.values&&(o=GY(o,n.values,this)),n!=null&&n.referentialEqualities&&(o=UY(o,n.referentialEqualities)),o}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};An.defaultInstance=new An,An.serialize=An.defaultInstance.serialize.bind(An.defaultInstance),An.deserialize=An.defaultInstance.deserialize.bind(An.defaultInstance),An.stringify=An.defaultInstance.stringify.bind(An.defaultInstance),An.parse=An.defaultInstance.parse.bind(An.defaultInstance),An.registerClass=An.defaultInstance.registerClass.bind(An.defaultInstance),An.registerSymbol=An.defaultInstance.registerSymbol.bind(An.defaultInstance),An.registerCustom=An.defaultInstance.registerCustom.bind(An.defaultInstance),An.allowErrorProps=An.defaultInstance.allowErrorProps.bind(An.defaultInstance),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et();var Gk,Uk;(Uk=(Gk=Tt).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__)!=null||(Gk.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var Wk,zk;(zk=(Wk=Tt).__VUE_DEVTOOLS_KIT_RPC_CLIENT__)!=null||(Wk.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var jk,Kk;(Kk=(jk=Tt).__VUE_DEVTOOLS_KIT_RPC_SERVER__)!=null||(jk.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var qk,Yk;(Yk=(qk=Tt).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__)!=null||(qk.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var Zk,Xk;(Xk=(Zk=Tt).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__)!=null||(Zk.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var Jk,Qk;(Qk=(Jk=Tt).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__)!=null||(Jk.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null),et(),et(),et(),et(),et(),et(),et();/*!
|
|
136
|
+
`},c=()=>{const p=Mm(n),g=e.zIndex?e.zIndex-1:998;if(t.centered&&p){if(r.value=!0,l(p),t.showOverlay){const v=()=>{t.closeOnOverlayClick&&u()};a=gP(t.overlayOpacity,g,v)}}else if(s.value&&(s.value.show(),r.value=!0,t.showOverlay)){const v=()=>{t.closeOnOverlayClick&&u()};a=gP(t.overlayOpacity,g,v)}},u=()=>{const p=Mm(n);t.centered&&p?(r.value=!1,p.style.display="none",t.showOverlay&&(Gb(a||void 0),a=null)):s.value&&(s.value.hide(),r.value=!1,t.showOverlay&&(Gb(a||void 0),a=null))},d=()=>{r.value?u():c()},h=()=>{s.value&&(s.value.destroy(),s.value=null),t.showOverlay&&a&&(Gb(a),a=null)},f=()=>{var v;const p=Mm(n);if(!p)return;if(p.style.display="none",t.centered){t.showOnInit&&c();return}const g={content:p,placement:t.placement,theme:t.theme,trigger:t.trigger,interactive:t.interactive,appendTo:t.appendTo,arrow:t.showArrow,allowHTML:!0,hideOnClick:!1,popperOptions:{...t.popperOptions,modifiers:[...((v=t.popperOptions)==null?void 0:v.modifiers)||[],{name:"computeStyles",options:{adaptive:!1}}]},onShow(){r.value=!0,p.style.display="block"},onHide(){r.value=!1}};if(t.useTrigger){const w=Mm(o);if(!w)return;s.value=Na(w,g)}else{const w=document.createElement("div");w.style.display="none",document.body.appendChild(w),s.value=Na(w,g)}t.showOnInit&&c()};return Qt(()=>{f()}),qn(()=>{h()}),tt(()=>t.alwaysShow,p=>{p?c():u()},{immediate:!0}),{popupRef:n,triggerRef:o,instance:s,isVisible:r,show:c,hide:u,toggle:d,destroy:h}}var z7=Object.create,mP=Object.defineProperty,j7=Object.getOwnPropertyDescriptor,Ub=Object.getOwnPropertyNames,K7=Object.getPrototypeOf,q7=Object.prototype.hasOwnProperty,Y7=(e,t)=>function(){return e&&(t=(0,e[Ub(e)[0]])(e=0)),t},Z7=(e,t)=>function(){return t||(0,e[Ub(e)[0]])((t={exports:{}}).exports,t),t.exports},X7=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ub(t))!q7.call(e,s)&&s!==n&&mP(e,s,{get:()=>t[s],enumerable:!(o=j7(t,s))||o.enumerable});return e},J7=(e,t,n)=>(n=e!=null?z7(K7(e)):{},X7(mP(n,"default",{value:e,enumerable:!0}),e)),lf=Y7({"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),Q7=Z7({"../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(e,t){lf(),t.exports=o;function n(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function o(r){if(r=r||{},r.circles)return s(r);const i=new Map;if(i.set(Date,d=>new Date(d)),i.set(Map,(d,h)=>new Map(l(Array.from(d),h))),i.set(Set,(d,h)=>new Set(l(Array.from(d),h))),r.constructorHandlers)for(const d of r.constructorHandlers)i.set(d[0],d[1]);let a=null;return r.proto?u:c;function l(d,h){const f=Object.keys(d),p=new Array(f.length);for(let g=0;g<f.length;g++){const v=f[g],w=d[v];typeof w!="object"||w===null?p[v]=w:w.constructor!==Object&&(a=i.get(w.constructor))?p[v]=a(w,h):ArrayBuffer.isView(w)?p[v]=n(w):p[v]=h(w)}return p}function c(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,c);if(d.constructor!==Object&&(a=i.get(d.constructor)))return a(d,c);const h={};for(const f in d){if(Object.hasOwnProperty.call(d,f)===!1)continue;const p=d[f];typeof p!="object"||p===null?h[f]=p:p.constructor!==Object&&(a=i.get(p.constructor))?h[f]=a(p,c):ArrayBuffer.isView(p)?h[f]=n(p):h[f]=c(p)}return h}function u(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,u);if(d.constructor!==Object&&(a=i.get(d.constructor)))return a(d,u);const h={};for(const f in d){const p=d[f];typeof p!="object"||p===null?h[f]=p:p.constructor!==Object&&(a=i.get(p.constructor))?h[f]=a(p,u):ArrayBuffer.isView(p)?h[f]=n(p):h[f]=u(p)}return h}}function s(r){const i=[],a=[],l=new Map;if(l.set(Date,f=>new Date(f)),l.set(Map,(f,p)=>new Map(u(Array.from(f),p))),l.set(Set,(f,p)=>new Set(u(Array.from(f),p))),r.constructorHandlers)for(const f of r.constructorHandlers)l.set(f[0],f[1]);let c=null;return r.proto?h:d;function u(f,p){const g=Object.keys(f),v=new Array(g.length);for(let w=0;w<g.length;w++){const S=g[w],b=f[S];if(typeof b!="object"||b===null)v[S]=b;else if(b.constructor!==Object&&(c=l.get(b.constructor)))v[S]=c(b,p);else if(ArrayBuffer.isView(b))v[S]=n(b);else{const C=i.indexOf(b);C!==-1?v[S]=a[C]:v[S]=p(b)}}return v}function d(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return u(f,d);if(f.constructor!==Object&&(c=l.get(f.constructor)))return c(f,d);const p={};i.push(f),a.push(p);for(const g in f){if(Object.hasOwnProperty.call(f,g)===!1)continue;const v=f[g];if(typeof v!="object"||v===null)p[g]=v;else if(v.constructor!==Object&&(c=l.get(v.constructor)))p[g]=c(v,d);else if(ArrayBuffer.isView(v))p[g]=n(v);else{const w=i.indexOf(v);w!==-1?p[g]=a[w]:p[g]=d(v)}}return i.pop(),a.pop(),p}function h(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return u(f,h);if(f.constructor!==Object&&(c=l.get(f.constructor)))return c(f,h);const p={};i.push(f),a.push(p);for(const g in f){const v=f[g];if(typeof v!="object"||v===null)p[g]=v;else if(v.constructor!==Object&&(c=l.get(v.constructor)))p[g]=c(v,h);else if(ArrayBuffer.isView(v))p[g]=n(v);else{const w=i.indexOf(v);w!==-1?p[g]=a[w]:p[g]=h(v)}}return i.pop(),a.pop(),p}}}});lf(),lf(),lf();var vP=typeof navigator<"u",Tt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof global<"u"?global:{};typeof Tt.chrome<"u"&&Tt.chrome.devtools,vP&&(Tt.self,Tt.top);var yP;typeof navigator<"u"&&((yP=navigator.userAgent)==null||yP.toLowerCase().includes("electron")),lf();var eq=J7(Q7()),tq=/(?:^|[-_/])(\w)/g;function nq(e,t){return t?t.toUpperCase():""}function oq(e){return e&&`${e}`.replace(tq,nq)}function sq(e,t){let n=e.replace(/^[a-z]:/i,"").replace(/\\/g,"/");n.endsWith(`index${t}`)&&(n=n.replace(`/index${t}`,t));const o=n.lastIndexOf("/"),s=n.substring(o+1);{const r=s.lastIndexOf(t);return s.substring(0,r)}}var wP=(0,eq.default)({circles:!0});const rq={trailing:!0};function ku(e,t=25,n={}){if(n={...rq,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let o,s,r=[],i,a;const l=(c,u)=>(i=iq(e,c,u),i.finally(()=>{if(i=null,n.trailing&&a&&!s){const d=l(c,a);return a=null,d}}),i);return function(...c){return i?(n.trailing&&(a=c),i):new Promise(u=>{const d=!s&&n.leading;clearTimeout(s),s=setTimeout(()=>{s=null;const h=n.leading?o:l(this,c);for(const f of r)f(h);r=[]},t),d?(o=l(this,c),u(o)):r.push(u)})}}async function iq(e,t,n){return await e.apply(t,n)}function Wb(e,t={},n){for(const o in e){const s=e[o],r=n?`${n}:${o}`:o;typeof s=="object"&&s!==null?Wb(s,t,r):typeof s=="function"&&(t[r]=s)}return t}const aq={run:e=>e()},lq=()=>aq,CP=typeof console.createTask<"u"?console.createTask:lq;function cq(e,t){const n=t.shift(),o=CP(n);return e.reduce((s,r)=>s.then(()=>o.run(()=>r(...t))),Promise.resolve())}function uq(e,t){const n=t.shift(),o=CP(n);return Promise.all(e.map(s=>o.run(()=>s(...t))))}function zb(e,t){for(const n of[...e])n(t)}class dq{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,n,o={}){if(!t||typeof n!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(n),()=>{n&&(this.removeHook(t,n),n=void 0)}}hookOnce(t,n){let o,s=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,n(...r));return o=this.hook(t,s),o}removeHook(t,n){if(this._hooks[t]){const o=this._hooks[t].indexOf(n);o!==-1&&this._hooks[t].splice(o,1),this._hooks[t].length===0&&delete this._hooks[t]}}deprecateHook(t,n){this._deprecatedHooks[t]=typeof n=="string"?{to:n}:n;const o=this._hooks[t]||[];delete this._hooks[t];for(const s of o)this.hook(t,s)}deprecateHooks(t){Object.assign(this._deprecatedHooks,t);for(const n in t)this.deprecateHook(n,t[n])}addHooks(t){const n=Wb(t),o=Object.keys(n).map(s=>this.hook(s,n[s]));return()=>{for(const s of o.splice(0,o.length))s()}}removeHooks(t){const n=Wb(t);for(const o in n)this.removeHook(o,n[o])}removeAllHooks(){for(const t in this._hooks)delete this._hooks[t]}callHook(t,...n){return n.unshift(t),this.callHookWith(cq,t,...n)}callHookParallel(t,...n){return n.unshift(t),this.callHookWith(uq,t,...n)}callHookWith(t,n,...o){const s=this._before||this._after?{name:n,args:o,context:{}}:void 0;this._before&&zb(this._before,s);const r=t(n in this._hooks?[...this._hooks[n]]:[],o);return r instanceof Promise?r.finally(()=>{this._after&&s&&zb(this._after,s)}):(this._after&&s&&zb(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const n=this._before.indexOf(t);n!==-1&&this._before.splice(n,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const n=this._after.indexOf(t);n!==-1&&this._after.splice(n,1)}}}}function bP(){return new dq}var hq=Object.create,SP=Object.defineProperty,fq=Object.getOwnPropertyDescriptor,jb=Object.getOwnPropertyNames,pq=Object.getPrototypeOf,gq=Object.prototype.hasOwnProperty,mq=(e,t)=>function(){return e&&(t=(0,e[jb(e)[0]])(e=0)),t},EP=(e,t)=>function(){return t||(0,e[jb(e)[0]])((t={exports:{}}).exports,t),t.exports},vq=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of jb(t))!gq.call(e,s)&&s!==n&&SP(e,s,{get:()=>t[s],enumerable:!(o=fq(t,s))||o.enumerable});return e},yq=(e,t,n)=>(n=e!=null?hq(pq(e)):{},vq(SP(n,"default",{value:e,enumerable:!0}),e)),et=mq({"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),wq=EP({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(e,t){et(),function(n){var o={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"Ae",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"Oe",Ő:"O",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"Ue",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"ae",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",ő:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",ا:"a",أ:"a",إ:"i",آ:"aa",ؤ:"u",ئ:"e",ء:"a",ب:"b",ت:"t",ث:"th",ج:"j",ح:"h",خ:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",ش:"sh",ص:"s",ض:"dh",ط:"t",ظ:"z",ع:"a",غ:"gh",ف:"f",ق:"q",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"w",ي:"y",ى:"a",ة:"h",ﻻ:"la",ﻷ:"laa",ﻹ:"lai",ﻵ:"laa",گ:"g",چ:"ch",پ:"p",ژ:"zh",ک:"k",ی:"y","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9",က:"k",ခ:"kh",ဂ:"g",ဃ:"ga",င:"ng",စ:"s",ဆ:"sa",ဇ:"z","စျ":"za",ည:"ny",ဋ:"t",ဌ:"ta",ဍ:"d",ဎ:"da",ဏ:"na",တ:"t",ထ:"ta",ဒ:"d",ဓ:"da",န:"n",ပ:"p",ဖ:"pa",ဗ:"b",ဘ:"ba",မ:"m",ယ:"y",ရ:"ya",လ:"l",ဝ:"w",သ:"th",ဟ:"h",ဠ:"la",အ:"a","ြ":"y","ျ":"ya","ွ":"w","ြွ":"yw","ျွ":"ywa","ှ":"h",ဧ:"e","၏":"-e",ဣ:"i",ဤ:"-i",ဉ:"u",ဦ:"-u",ဩ:"aw","သြော":"aw",ဪ:"aw","၀":"0","၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","္":"","့":"","း":"",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z",ހ:"h",ށ:"sh",ނ:"n",ރ:"r",ބ:"b",ޅ:"lh",ކ:"k",އ:"a",ވ:"v",މ:"m",ފ:"f",ދ:"dh",ތ:"th",ލ:"l",ގ:"g",ޏ:"gn",ސ:"s",ޑ:"d",ޒ:"z",ޓ:"t",ޔ:"y",ޕ:"p",ޖ:"j",ޗ:"ch",ޘ:"tt",ޙ:"hh",ޚ:"kh",ޛ:"th",ޜ:"z",ޝ:"sh",ޞ:"s",ޟ:"d",ޠ:"t",ޡ:"z",ޢ:"a",ޣ:"gh",ޤ:"q",ޥ:"w","ަ":"a","ާ":"aa","ި":"i","ީ":"ee","ު":"u","ޫ":"oo","ެ":"e","ޭ":"ey","ޮ":"o","ޯ":"oa","ް":"",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"o",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"i",ώ:"o",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"I",Θ:"TH",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"KS",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Υ:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"I",Ώ:"O",Ϊ:"I",Ϋ:"Y",ā:"a",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",ū:"u",Ā:"A",Ē:"E",Ģ:"G",Ī:"I",Ķ:"k",Ļ:"L",Ņ:"N",Ū:"U",Ќ:"Kj",ќ:"kj",Љ:"Lj",љ:"lj",Њ:"Nj",њ:"nj",Тс:"Ts",тс:"ts",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Ż:"Z",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",ă:"a",Ă:"A",ș:"s",Ș:"S",ț:"t",Ț:"T",ţ:"t",Ţ:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"I",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",ђ:"dj",ј:"j",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Ћ:"C",Џ:"Dz",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",ả:"a",Ả:"A",ẳ:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",đ:"d",Đ:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",ề:"e",Ề:"E",ệ:"e",Ệ:"E",ễ:"e",Ễ:"E",ể:"e",Ể:"E",ỏ:"o",ọ:"o",Ọ:"o",ố:"o",Ố:"O",ồ:"o",Ồ:"O",ổ:"o",Ổ:"O",ộ:"o",Ộ:"O",ỗ:"o",Ỗ:"O",ơ:"o",Ơ:"O",ớ:"o",Ớ:"O",ờ:"o",Ờ:"O",ợ:"o",Ợ:"O",ỡ:"o",Ỡ:"O",Ở:"o",ở:"o",ị:"i",Ị:"I",ĩ:"i",Ĩ:"I",ỉ:"i",Ỉ:"i",ủ:"u",Ủ:"U",ụ:"u",Ụ:"U",ũ:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",ự:"u",Ự:"U",ữ:"u",Ữ:"U",ử:"u",Ử:"ư",ỷ:"y",Ỷ:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",Ỵ:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",ấ:"a",Ấ:"A",ầ:"a",Ầ:"A",ậ:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","⓪":"0","①":"1","②":"2","③":"3","④":"4","⑤":"5","⑥":"6","⑦":"7","⑧":"8","⑨":"9","⑩":"10","⑪":"11","⑫":"12","⑬":"13","⑭":"14","⑮":"15","⑯":"16","⑰":"17","⑱":"18","⑲":"18","⑳":"18","⓵":"1","⓶":"2","⓷":"3","⓸":"4","⓹":"5","⓺":"6","⓻":"7","⓼":"8","⓽":"9","⓾":"10","⓿":"0","⓫":"11","⓬":"12","⓭":"13","⓮":"14","⓯":"15","⓰":"16","⓱":"17","⓲":"18","⓳":"19","⓴":"20","Ⓐ":"A","Ⓑ":"B","Ⓒ":"C","Ⓓ":"D","Ⓔ":"E","Ⓕ":"F","Ⓖ":"G","Ⓗ":"H","Ⓘ":"I","Ⓙ":"J","Ⓚ":"K","Ⓛ":"L","Ⓜ":"M","Ⓝ":"N","Ⓞ":"O","Ⓟ":"P","Ⓠ":"Q","Ⓡ":"R","Ⓢ":"S","Ⓣ":"T","Ⓤ":"U","Ⓥ":"V","Ⓦ":"W","Ⓧ":"X","Ⓨ":"Y","Ⓩ":"Z","ⓐ":"a","ⓑ":"b","ⓒ":"c","ⓓ":"d","ⓔ":"e","ⓕ":"f","ⓖ":"g","ⓗ":"h","ⓘ":"i","ⓙ":"j","ⓚ":"k","ⓛ":"l","ⓜ":"m","ⓝ":"n","ⓞ":"o","ⓟ":"p","ⓠ":"q","ⓡ":"r","ⓢ":"s","ⓣ":"t","ⓤ":"u","ⓦ":"v","ⓥ":"w","ⓧ":"x","ⓨ":"y","ⓩ":"z","“":'"',"”":'"',"‘":"'","’":"'","∂":"d",ƒ:"f","™":"(TM)","©":"(C)",œ:"oe",Œ:"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o",º:"o",ª:"a","•":"*","၊":",","။":".",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY",元:"CNY",円:"YEN","﷼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","₺":"TRY","؋":"AFN","₼":"AZN",лв:"BGN","៛":"KHR","₡":"CRC","₸":"KZT",ден:"MKD",zł:"PLN","₽":"RUB","₾":"GEL"},s=["်","ް"],r={"ာ":"a","ါ":"a","ေ":"e","ဲ":"e","ိ":"i","ီ":"i","ို":"o","ု":"u","ူ":"u","ေါင်":"aung","ော":"aw","ော်":"aw","ေါ":"aw","ေါ်":"aw","်":"်","က်":"et","ိုက်":"aik","ောက်":"auk","င်":"in","ိုင်":"aing","ောင်":"aung","စ်":"it","ည်":"i","တ်":"at","ိတ်":"eik","ုတ်":"ok","ွတ်":"ut","ေတ်":"it","ဒ်":"d","ိုဒ်":"ok","ုဒ်":"ait","န်":"an","ာန်":"an","ိန်":"ein","ုန်":"on","ွန်":"un","ပ်":"at","ိပ်":"eik","ုပ်":"ok","ွပ်":"ut","န်ုပ်":"nub","မ်":"an","ိမ်":"ein","ုမ်":"on","ွမ်":"un","ယ်":"e","ိုလ်":"ol","ဉ်":"in","ံ":"an","ိံ":"ein","ုံ":"on","ައް":"ah","ަށް":"ah"},i={en:{},az:{ç:"c",ə:"e",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"C",Ə:"E",Ğ:"G",İ:"I",Ö:"O",Ş:"S",Ü:"U"},cs:{č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z"},fi:{ä:"a",Ä:"A",ö:"o",Ö:"O"},hu:{ä:"a",Ä:"A",ö:"o",Ö:"O",ü:"u",Ü:"U",ű:"u",Ű:"U"},lt:{ą:"a",č:"c",ę:"e",ė:"e",į:"i",š:"s",ų:"u",ū:"u",ž:"z",Ą:"A",Č:"C",Ę:"E",Ė:"E",Į:"I",Š:"S",Ų:"U",Ū:"U"},lv:{ā:"a",č:"c",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",š:"s",ū:"u",ž:"z",Ā:"A",Č:"C",Ē:"E",Ģ:"G",Ī:"i",Ķ:"k",Ļ:"L",Ņ:"N",Š:"S",Ū:"u",Ž:"Z"},pl:{ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ó:"o",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"e",Ł:"L",Ń:"N",Ó:"O",Ś:"S",Ź:"Z",Ż:"Z"},sv:{ä:"a",Ä:"A",ö:"o",Ö:"O"},sk:{ä:"a",Ä:"A"},sr:{љ:"lj",њ:"nj",Љ:"Lj",Њ:"Nj",đ:"dj",Đ:"Dj"},tr:{Ü:"U",Ö:"O",ü:"u",ö:"o"}},a={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},l=[";","?",":","@","&","=","+","$",",","/"].join(""),c=[";","?",":","@","&","=","+","$",","].join(""),u=[".","!","~","*","'","(",")"].join(""),d=function(v,w){var S="-",b="",C="",_=!0,E={},I,T,P,M,D,F,O,k,x,$,W,Q,ae,ee,X="";if(typeof v!="string")return"";if(typeof w=="string"&&(S=w),O=a.en,k=i.en,typeof w=="object"){I=w.maintainCase||!1,E=w.custom&&typeof w.custom=="object"?w.custom:E,P=+w.truncate>1&&w.truncate||!1,M=w.uric||!1,D=w.uricNoSlash||!1,F=w.mark||!1,_=!(w.symbols===!1||w.lang===!1),S=w.separator||S,M&&(X+=l),D&&(X+=c),F&&(X+=u),O=w.lang&&a[w.lang]&&_?a[w.lang]:_?a.en:{},k=w.lang&&i[w.lang]?i[w.lang]:w.lang===!1||w.lang===!0?{}:i.en,w.titleCase&&typeof w.titleCase.length=="number"&&Array.prototype.toString.call(w.titleCase)?(w.titleCase.forEach(function(N){E[N+""]=N+""}),T=!0):T=!!w.titleCase,w.custom&&typeof w.custom.length=="number"&&Array.prototype.toString.call(w.custom)&&w.custom.forEach(function(N){E[N+""]=N+""}),Object.keys(E).forEach(function(N){var z;N.length>1?z=new RegExp("\\b"+f(N)+"\\b","gi"):z=new RegExp(f(N),"gi"),v=v.replace(z,E[N])});for(W in E)X+=W}for(X+=S,X=f(X),v=v.replace(/(^\s+|\s+$)/g,""),ae=!1,ee=!1,$=0,Q=v.length;$<Q;$++)W=v[$],p(W,E)?ae=!1:k[W]?(W=ae&&k[W].match(/[A-Za-z0-9]/)?" "+k[W]:k[W],ae=!1):W in o?($+1<Q&&s.indexOf(v[$+1])>=0?(C+=W,W=""):ee===!0?(W=r[C]+o[W],C=""):W=ae&&o[W].match(/[A-Za-z0-9]/)?" "+o[W]:o[W],ae=!1,ee=!1):W in r?(C+=W,W="",$===Q-1&&(W=r[C]),ee=!0):O[W]&&!(M&&l.indexOf(W)!==-1)&&!(D&&c.indexOf(W)!==-1)?(W=ae||b.substr(-1).match(/[A-Za-z0-9]/)?S+O[W]:O[W],W+=v[$+1]!==void 0&&v[$+1].match(/[A-Za-z0-9]/)?S:"",ae=!0):(ee===!0?(W=r[C]+W,C="",ee=!1):ae&&(/[A-Za-z0-9]/.test(W)||b.substr(-1).match(/A-Za-z0-9]/))&&(W=" "+W),ae=!1),b+=W.replace(new RegExp("[^\\w\\s"+X+"_-]","g"),S);return T&&(b=b.replace(/(\w)(\S*)/g,function(N,z,ne){var pe=z.toUpperCase()+(ne!==null?ne:"");return Object.keys(E).indexOf(pe.toLowerCase())<0?pe:pe.toLowerCase()})),b=b.replace(/\s+/g,S).replace(new RegExp("\\"+S+"+","g"),S).replace(new RegExp("(^\\"+S+"+|\\"+S+"+$)","g"),""),P&&b.length>P&&(x=b.charAt(P)===S,b=b.slice(0,P),x||(b=b.slice(0,b.lastIndexOf(S)))),!I&&!T&&(b=b.toLowerCase()),b},h=function(v){return function(S){return d(S,v)}},f=function(v){return v.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},p=function(g,v){for(var w in v)if(v[w]===g)return!0};if(typeof t<"u"&&t.exports)t.exports=d,t.exports.createSlug=h;else if(typeof define<"u"&&define.amd)define([],function(){return d});else try{if(n.getSlug||n.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";n.getSlug=d,n.createSlug=h}catch{}}(e)}}),Cq=EP({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(e,t){et(),t.exports=wq()}});et(),et(),et(),et(),et(),et(),et(),et();function bq(e){var t;const n=e.name||e._componentTag||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||e.__name;return n==="index"&&((t=e.__file)!=null&&t.endsWith("index.vue"))?"":n}function Sq(e){const t=e.__file;if(t)return oq(sq(t,".vue"))}function _P(e,t){return e.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=t,t}function Kb(e){if(e.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(e.root)return e.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function RP(e){var t,n;const o=(t=e.subTree)==null?void 0:t.type,s=Kb(e);return s?((n=s==null?void 0:s.types)==null?void 0:n.Fragment)===o:!1}function Nm(e){var t,n,o;const s=bq((e==null?void 0:e.type)||{});if(s)return s;if((e==null?void 0:e.root)===e)return"Root";for(const i in(n=(t=e.parent)==null?void 0:t.type)==null?void 0:n.components)if(e.parent.type.components[i]===(e==null?void 0:e.type))return _P(e,i);for(const i in(o=e.appContext)==null?void 0:o.components)if(e.appContext.components[i]===(e==null?void 0:e.type))return _P(e,i);const r=Sq((e==null?void 0:e.type)||{});return r||"Anonymous Component"}function Eq(e){var t,n,o;const s=(o=(n=(t=e==null?void 0:e.appContext)==null?void 0:t.app)==null?void 0:n.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__)!=null?o:0,r=e===(e==null?void 0:e.root)?"root":e.uid;return`${s}:${r}`}function qb(e,t){return t=t||`${e.id}:root`,e.instanceMap.get(t)||e.instanceMap.get(":root")}function _q(){const e={top:0,bottom:0,left:0,right:0,get width(){return e.right-e.left},get height(){return e.bottom-e.top}};return e}var Lm;function Rq(e){return Lm||(Lm=document.createRange()),Lm.selectNode(e),Lm.getBoundingClientRect()}function Dq(e){const t=_q();if(!e.children)return t;for(let n=0,o=e.children.length;n<o;n++){const s=e.children[n];let r;if(s.component)r=ec(s.component);else if(s.el){const i=s.el;i.nodeType===1||i.getBoundingClientRect?r=i.getBoundingClientRect():i.nodeType===3&&i.data.trim()&&(r=Rq(i))}r&&Tq(t,r)}return t}function Tq(e,t){return(!e.top||t.top<e.top)&&(e.top=t.top),(!e.bottom||t.bottom>e.bottom)&&(e.bottom=t.bottom),(!e.left||t.left<e.left)&&(e.left=t.left),(!e.right||t.right>e.right)&&(e.right=t.right),e}var DP={top:0,left:0,right:0,bottom:0,width:0,height:0};function ec(e){const t=e.subTree.el;return typeof window>"u"?DP:RP(e)?Dq(e.subTree):(t==null?void 0:t.nodeType)===1?t==null?void 0:t.getBoundingClientRect():e.subTree.component?ec(e.subTree.component):DP}et();function Yb(e){return RP(e)?Iq(e.subTree):e.subTree?[e.subTree.el]:[]}function Iq(e){if(!e.children)return[];const t=[];return e.children.forEach(n=>{n.component?t.push(...Yb(n.component)):n!=null&&n.el&&t.push(n.el)}),t}var TP="__vue-devtools-component-inspector__",IP="__vue-devtools-component-inspector__card__",xP="__vue-devtools-component-inspector__name__",FP="__vue-devtools-component-inspector__indicator__",PP={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},xq={fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 8px",borderRadius:"4px",textAlign:"left",position:"absolute",left:0,color:"#e9e9e9",fontSize:"14px",fontWeight:600,lineHeight:"24px",backgroundColor:"#42b883",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},Fq={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function Au(){return document.getElementById(TP)}function Pq(){return document.getElementById(IP)}function kq(){return document.getElementById(FP)}function Aq(){return document.getElementById(xP)}function Zb(e){return{left:`${Math.round(e.left*100)/100}px`,top:`${Math.round(e.top*100)/100}px`,width:`${Math.round(e.width*100)/100}px`,height:`${Math.round(e.height*100)/100}px`}}function Xb(e){var t;const n=document.createElement("div");n.id=(t=e.elementId)!=null?t:TP,Object.assign(n.style,{...PP,...Zb(e.bounds),...e.style});const o=document.createElement("span");o.id=IP,Object.assign(o.style,{...xq,top:e.bounds.top<35?0:"-35px"});const s=document.createElement("span");s.id=xP,s.innerHTML=`<${e.name}> `;const r=document.createElement("i");return r.id=FP,r.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`,Object.assign(r.style,Fq),o.appendChild(s),o.appendChild(r),n.appendChild(o),document.body.appendChild(n),n}function Jb(e){const t=Au(),n=Pq(),o=Aq(),s=kq();t&&(Object.assign(t.style,{...PP,...Zb(e.bounds)}),Object.assign(n.style,{top:e.bounds.top<35?0:"-35px"}),o.innerHTML=`<${e.name}> `,s.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`)}function Oq(e){const t=ec(e);if(!t.width&&!t.height)return;const n=Nm(e);Au()?Jb({bounds:t,name:n}):Xb({bounds:t,name:n})}function kP(){const e=Au();e&&(e.style.display="none")}var Qb=null;function eS(e){const t=e.target;if(t){const n=t.__vueParentComponent;if(n&&(Qb=n,n.vnode.el)){const s=ec(n),r=Nm(n);Au()?Jb({bounds:s,name:r}):Xb({bounds:s,name:r})}}}function Mq(e,t){if(e.preventDefault(),e.stopPropagation(),Qb){const n=Eq(Qb);t(n)}}var Vm=null;function Nq(){kP(),window.removeEventListener("mouseover",eS),window.removeEventListener("click",Vm,!0),Vm=null}function Lq(){return window.addEventListener("mouseover",eS),new Promise(e=>{function t(n){n.preventDefault(),n.stopPropagation(),Mq(n,o=>{window.removeEventListener("click",t,!0),Vm=null,window.removeEventListener("mouseover",eS);const s=Au();s&&(s.style.display="none"),e(JSON.stringify({id:o}))})}Vm=t,window.addEventListener("click",t,!0)})}function Vq(e){const t=qb(ts.value,e.id);if(t){const[n]=Yb(t);if(typeof n.scrollIntoView=="function")n.scrollIntoView({behavior:"smooth"});else{const o=ec(t),s=document.createElement("div"),r={...Zb(o),position:"absolute"};Object.assign(s.style,r),document.body.appendChild(s),s.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(s)},2e3)}setTimeout(()=>{const o=ec(t);if(o.width||o.height){const s=Nm(t),r=Au();r?Jb({...e,name:s,bounds:o}):Xb({...e,name:s,bounds:o}),setTimeout(()=>{r&&(r.style.display="none")},1500)}},1200)}}et();var AP,OP;(OP=(AP=Tt).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__)!=null||(AP.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function Bq(e){let t=0;const n=setInterval(()=>{Tt.__VUE_INSPECTOR__&&(clearInterval(n),t+=30,e()),t>=5e3&&clearInterval(n)},30)}function $q(){const e=Tt.__VUE_INSPECTOR__,t=e.openInEditor;e.openInEditor=async(...n)=>{e.disable(),t(...n)}}function Hq(){return new Promise(e=>{function t(){$q(),e(Tt.__VUE_INSPECTOR__)}Tt.__VUE_INSPECTOR__?t():Bq(()=>{t()})})}et(),et();function Gq(e){return!!(e&&e.__v_isReadonly)}function MP(e){return Gq(e)?MP(e.__v_raw):!!(e&&e.__v_isReactive)}function tS(e){return!!(e&&e.__v_isRef===!0)}function cf(e){const t=e&&e.__v_raw;return t?cf(t):e}var Uq=class{constructor(){this.refEditor=new Wq}set(e,t,n,o){const s=Array.isArray(t)?t:t.split(".");for(;s.length>1;){const a=s.shift();e instanceof Map?e=e.get(a):e instanceof Set?e=Array.from(e.values())[a]:e=e[a],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}const r=s[0],i=this.refEditor.get(e)[r];o?o(e,r,n):this.refEditor.isRef(i)?this.refEditor.set(i,n):e[r]=n}get(e,t){const n=Array.isArray(t)?t:t.split(".");for(let o=0;o<n.length;o++)if(e instanceof Map?e=e.get(n[o]):e=e[n[o]],this.refEditor.isRef(e)&&(e=this.refEditor.get(e)),!e)return;return e}has(e,t,n=!1){if(typeof e>"u")return!1;const o=Array.isArray(t)?t.slice():t.split("."),s=n?2:1;for(;e&&o.length>s;){const r=o.shift();e=e[r],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}return e!=null&&Object.prototype.hasOwnProperty.call(e,o[0])}createDefaultSetCallback(e){return(t,n,o)=>{if((e.remove||e.newKey)&&(Array.isArray(t)?t.splice(n,1):cf(t)instanceof Map?t.delete(n):cf(t)instanceof Set?t.delete(Array.from(t.values())[n]):Reflect.deleteProperty(t,n)),!e.remove){const s=t[e.newKey||n];this.refEditor.isRef(s)?this.refEditor.set(s,o):cf(t)instanceof Map?t.set(e.newKey||n,o):cf(t)instanceof Set?t.add(o):t[e.newKey||n]=o}}}},Wq=class{set(e,t){if(tS(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(s=>e.add(s));return}const n=Object.keys(t);if(e instanceof Map){const s=new Set(e.keys());n.forEach(r=>{e.set(r,Reflect.get(t,r)),s.delete(r)}),s.forEach(r=>e.delete(r));return}const o=new Set(Object.keys(e));n.forEach(s=>{Reflect.set(e,s,Reflect.get(t,s)),o.delete(s)}),o.forEach(s=>Reflect.deleteProperty(e,s))}}get(e){return tS(e)?e.value:e}isRef(e){return tS(e)||MP(e)}};et(),et(),et();var zq="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function jq(){if(typeof window>"u"||!vP||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const e=typeof localStorage.getItem<"u"?localStorage.getItem(zq):null;return e?JSON.parse(e):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}et(),et(),et();var NP,LP;(LP=(NP=Tt).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS)!=null||(NP.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var Kq=new Proxy(Tt.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(e,t,n){return Reflect.get(e,t,n)}});function qq(e,t){wo.timelineLayersState[t.id]=!1,Kq.push({...e,descriptorId:t.id,appRecord:Kb(t.app)})}var VP,BP;(BP=(VP=Tt).__VUE_DEVTOOLS_KIT_INSPECTOR__)!=null||(VP.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var nS=new Proxy(Tt.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(e,t,n){return Reflect.get(e,t,n)}}),$P=ku(()=>{Mu.hooks.callHook("sendInspectorToClient",HP())});function Yq(e,t){var n,o;nS.push({options:e,descriptor:t,treeFilterPlaceholder:(n=e.treeFilterPlaceholder)!=null?n:"Search tree...",stateFilterPlaceholder:(o=e.stateFilterPlaceholder)!=null?o:"Search state...",treeFilter:"",selectedNodeId:"",appRecord:Kb(t.app)}),$P()}function HP(){return nS.filter(e=>e.descriptor.app===ts.value.app).filter(e=>e.descriptor.id!=="components").map(e=>{var t;const n=e.descriptor,o=e.options;return{id:o.id,label:o.label,logo:n.logo,icon:`custom-ic-baseline-${(t=o==null?void 0:o.icon)==null?void 0:t.replace(/_/g,"-")}`,packageName:n.packageName,homepage:n.homepage,pluginId:n.id}})}function Bm(e,t){return nS.find(n=>n.options.id===e&&(t?n.descriptor.app===t:!0))}function Zq(){const e=bP();e.hook("addInspector",({inspector:o,plugin:s})=>{Yq(o,s.descriptor)});const t=ku(async({inspectorId:o,plugin:s})=>{var r;if(!o||!((r=s==null?void 0:s.descriptor)!=null&&r.app)||wo.highPerfModeEnabled)return;const i=Bm(o,s.descriptor.app),a={app:s.descriptor.app,inspectorId:o,filter:(i==null?void 0:i.treeFilter)||"",rootNodes:[]};await new Promise(l=>{e.callHookWith(async c=>{await Promise.all(c.map(u=>u(a))),l()},"getInspectorTree")}),e.callHookWith(async l=>{await Promise.all(l.map(c=>c({inspectorId:o,rootNodes:a.rootNodes})))},"sendInspectorTreeToClient")},120);e.hook("sendInspectorTree",t);const n=ku(async({inspectorId:o,plugin:s})=>{var r;if(!o||!((r=s==null?void 0:s.descriptor)!=null&&r.app)||wo.highPerfModeEnabled)return;const i=Bm(o,s.descriptor.app),a={app:s.descriptor.app,inspectorId:o,nodeId:(i==null?void 0:i.selectedNodeId)||"",state:null},l={currentTab:`custom-inspector:${o}`};a.nodeId&&await new Promise(c=>{e.callHookWith(async u=>{await Promise.all(u.map(d=>d(a,l))),c()},"getInspectorState")}),e.callHookWith(async c=>{await Promise.all(c.map(u=>u({inspectorId:o,nodeId:a.nodeId,state:a.state})))},"sendInspectorStateToClient")},120);return e.hook("sendInspectorState",n),e.hook("customInspectorSelectNode",({inspectorId:o,nodeId:s,plugin:r})=>{const i=Bm(o,r.descriptor.app);i&&(i.selectedNodeId=s)}),e.hook("timelineLayerAdded",({options:o,plugin:s})=>{qq(o,s.descriptor)}),e.hook("timelineEventAdded",({options:o,plugin:s})=>{var r;const i=["performance","component-event","keyboard","mouse"];wo.highPerfModeEnabled||!((r=wo.timelineLayersState)!=null&&r[s.descriptor.id])&&!i.includes(o.layerId)||e.callHookWith(async a=>{await Promise.all(a.map(l=>l(o)))},"sendTimelineEventToClient")}),e.hook("getComponentInstances",async({app:o})=>{const s=o.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!s)return null;const r=s.id.toString();return[...s.instanceMap].filter(([a])=>a.split(":")[0]===r).map(([,a])=>a)}),e.hook("getComponentBounds",async({instance:o})=>ec(o)),e.hook("getComponentName",({instance:o})=>Nm(o)),e.hook("componentHighlight",({uid:o})=>{const s=ts.value.instanceMap.get(o);s&&Oq(s)}),e.hook("componentUnhighlight",()=>{kP()}),e}var GP,UP;(UP=(GP=Tt).__VUE_DEVTOOLS_KIT_APP_RECORDS__)!=null||(GP.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var WP,zP;(zP=(WP=Tt).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__)!=null||(WP.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var jP,KP;(KP=(jP=Tt).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__)!=null||(jP.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__="");var qP,YP;(YP=(qP=Tt).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__)!=null||(qP.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var ZP,XP;(XP=(ZP=Tt).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__)!=null||(ZP.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var tc="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function Xq(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:jq()}}var JP,QP;(QP=(JP=Tt)[tc])!=null||(JP[tc]=Xq());var Jq=ku(e=>{Mu.hooks.callHook("devtoolsStateUpdated",{state:e})});ku((e,t)=>{Mu.hooks.callHook("devtoolsConnectedUpdated",{state:e,oldState:t})});var $m=new Proxy(Tt.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(e,t,n){return t==="value"?Tt.__VUE_DEVTOOLS_KIT_APP_RECORDS__:Tt.__VUE_DEVTOOLS_KIT_APP_RECORDS__[t]}}),ts=new Proxy(Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(e,t,n){return t==="value"?Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:t==="id"?Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[t]}});function ek(){Jq({...Tt[tc],appRecords:$m.value,activeAppRecordId:ts.id,tabs:Tt.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:Tt.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function Qq(e){Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=e,ek()}function eY(e){Tt.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=e,ek()}var wo=new Proxy(Tt[tc],{get(e,t){return t==="appRecords"?$m:t==="activeAppRecordId"?ts.id:t==="tabs"?Tt.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:t==="commands"?Tt.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:Tt[tc][t]},deleteProperty(e,t){return delete e[t],!0},set(e,t,n){return{...Tt[tc]},e[t]=n,Tt[tc][t]=n,!0}});function tY(e={}){var t,n,o;const{file:s,host:r,baseUrl:i=window.location.origin,line:a=0,column:l=0}=e;if(s){if(r==="chrome-extension"){const c=s.replace(/\\/g,"\\\\"),u=(n=(t=window.VUE_DEVTOOLS_CONFIG)==null?void 0:t.openInEditorHost)!=null?n:"/";fetch(`${u}__open-in-editor?file=${encodeURI(s)}`).then(d=>{if(!d.ok){const h=`Opening component ${c} failed`;console.log(`%c${h}`,"color:red")}})}else if(wo.vitePluginDetected){const c=(o=Tt.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__)!=null?o:i;Tt.__VUE_INSPECTOR__.openInEditor(c,s,a,l)}}}et(),et(),et(),et(),et();var tk,nk;(nk=(tk=Tt).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__)!=null||(tk.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var oS=new Proxy(Tt.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(e,t,n){return Reflect.get(e,t,n)}});function sS(e){const t={};return Object.keys(e).forEach(n=>{t[n]=e[n].defaultValue}),t}function rS(e){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${e}__`}function nY(e){var t,n,o;const s=(n=(t=oS.find(r=>{var i;return r[0].id===e&&!!((i=r[0])!=null&&i.settings)}))==null?void 0:t[0])!=null?n:null;return(o=s==null?void 0:s.settings)!=null?o:null}function ok(e,t){var n,o,s;const r=rS(e);if(r){const i=localStorage.getItem(r);if(i)return JSON.parse(i)}if(e){const i=(o=(n=oS.find(a=>a[0].id===e))==null?void 0:n[0])!=null?o:null;return sS((s=i==null?void 0:i.settings)!=null?s:{})}return sS(t)}function oY(e,t){const n=rS(e);localStorage.getItem(n)||localStorage.setItem(n,JSON.stringify(sS(t)))}function sY(e,t,n){const o=rS(e),s=localStorage.getItem(o),r=JSON.parse(s||"{}"),i={...r,[t]:n};localStorage.setItem(o,JSON.stringify(i)),Mu.hooks.callHookWith(a=>{a.forEach(l=>l({pluginId:e,key:t,oldValue:r[t],newValue:n,settings:i}))},"setPluginSettings")}et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et();var sk,rk,Os=(rk=(sk=Tt).__VUE_DEVTOOLS_HOOK)!=null?rk:sk.__VUE_DEVTOOLS_HOOK=bP(),rY={vueAppInit(e){Os.hook("app:init",e)},vueAppUnmount(e){Os.hook("app:unmount",e)},vueAppConnected(e){Os.hook("app:connected",e)},componentAdded(e){return Os.hook("component:added",e)},componentEmit(e){return Os.hook("component:emit",e)},componentUpdated(e){return Os.hook("component:updated",e)},componentRemoved(e){return Os.hook("component:removed",e)},setupDevtoolsPlugin(e){Os.hook("devtools-plugin:setup",e)},perfStart(e){return Os.hook("perf:start",e)},perfEnd(e){return Os.hook("perf:end",e)}},ik={on:rY,setupDevToolsPlugin(e,t){return Os.callHook("devtools-plugin:setup",e,t)}},iY=class{constructor({plugin:e,ctx:t}){this.hooks=t.hooks,this.plugin=e}get on(){return{visitComponentTree:e=>{this.hooks.hook("visitComponentTree",e)},inspectComponent:e=>{this.hooks.hook("inspectComponent",e)},editComponentState:e=>{this.hooks.hook("editComponentState",e)},getInspectorTree:e=>{this.hooks.hook("getInspectorTree",e)},getInspectorState:e=>{this.hooks.hook("getInspectorState",e)},editInspectorState:e=>{this.hooks.hook("editInspectorState",e)},inspectTimelineEvent:e=>{this.hooks.hook("inspectTimelineEvent",e)},timelineCleared:e=>{this.hooks.hook("timelineCleared",e)},setPluginSettings:e=>{this.hooks.hook("setPluginSettings",e)}}}notifyComponentUpdate(e){var t;if(wo.highPerfModeEnabled)return;const n=HP().find(o=>o.packageName===this.plugin.descriptor.packageName);if(n!=null&&n.id){if(e){const o=[e.appContext.app,e.uid,(t=e.parent)==null?void 0:t.uid,e];Os.callHook("component:updated",...o)}else Os.callHook("component:updated");this.hooks.callHook("sendInspectorState",{inspectorId:n.id,plugin:this.plugin})}}addInspector(e){this.hooks.callHook("addInspector",{inspector:e,plugin:this.plugin}),this.plugin.descriptor.settings&&oY(e.id,this.plugin.descriptor.settings)}sendInspectorTree(e){wo.highPerfModeEnabled||this.hooks.callHook("sendInspectorTree",{inspectorId:e,plugin:this.plugin})}sendInspectorState(e){wo.highPerfModeEnabled||this.hooks.callHook("sendInspectorState",{inspectorId:e,plugin:this.plugin})}selectInspectorNode(e,t){this.hooks.callHook("customInspectorSelectNode",{inspectorId:e,nodeId:t,plugin:this.plugin})}visitComponentTree(e){return this.hooks.callHook("visitComponentTree",e)}now(){return wo.highPerfModeEnabled?0:Date.now()}addTimelineLayer(e){this.hooks.callHook("timelineLayerAdded",{options:e,plugin:this.plugin})}addTimelineEvent(e){wo.highPerfModeEnabled||this.hooks.callHook("timelineEventAdded",{options:e,plugin:this.plugin})}getSettings(e){return ok(e??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(e){return this.hooks.callHook("getComponentInstances",{app:e})}getComponentBounds(e){return this.hooks.callHook("getComponentBounds",{instance:e})}getComponentName(e){return this.hooks.callHook("getComponentName",{instance:e})}highlightElement(e){const t=e.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook("componentHighlight",{uid:t})}unhighlightElement(){return this.hooks.callHook("componentUnhighlight")}},aY=iY;et(),et(),et(),et();var lY="__vue_devtool_undefined__",cY="__vue_devtool_infinity__",uY="__vue_devtool_negative_infinity__",dY="__vue_devtool_nan__";et(),et();var hY={[lY]:"undefined",[dY]:"NaN",[cY]:"Infinity",[uY]:"-Infinity"};Object.entries(hY).reduce((e,[t,n])=>(e[n]=t,e),{}),et(),et(),et(),et(),et();var ak,lk;(lk=(ak=Tt).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__)!=null||(ak.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function ck(e,t){return ik.setupDevToolsPlugin(e,t)}function fY(e,t){const[n,o]=e;if(n.app!==t)return;const s=new aY({plugin:{setupFn:o,descriptor:n},ctx:Mu});n.packageName==="vuex"&&s.on.editInspectorState(r=>{s.sendInspectorState(r.inspectorId)}),o(s)}function uk(e,t){Tt.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(e)||wo.highPerfModeEnabled&&!(t!=null&&t.inspectingComponent)||(Tt.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(e),oS.forEach(n=>{fY(n,e)}))}et(),et();var uf="__VUE_DEVTOOLS_ROUTER__",Ou="__VUE_DEVTOOLS_ROUTER_INFO__",dk,hk;(hk=(dk=Tt)[Ou])!=null||(dk[Ou]={currentRoute:null,routes:[]});var fk,pk;(pk=(fk=Tt)[uf])!=null||(fk[uf]={}),new Proxy(Tt[Ou],{get(e,t){return Tt[Ou][t]}}),new Proxy(Tt[uf],{get(e,t){if(t==="value")return Tt[uf]}});function pY(e){const t=new Map;return((e==null?void 0:e.getRoutes())||[]).filter(n=>!t.has(n.path)&&t.set(n.path,1))}function iS(e){return e.map(t=>{let{path:n,name:o,children:s,meta:r}=t;return s!=null&&s.length&&(s=iS(s)),{path:n,name:o,children:s,meta:r}})}function gY(e){if(e){const{fullPath:t,hash:n,href:o,path:s,name:r,matched:i,params:a,query:l}=e;return{fullPath:t,hash:n,href:o,path:s,name:r,params:a,query:l,matched:iS(i)}}return e}function mY(e,t){function n(){var o;const s=(o=e.app)==null?void 0:o.config.globalProperties.$router,r=gY(s==null?void 0:s.currentRoute.value),i=iS(pY(s)),a=console.warn;console.warn=()=>{},Tt[Ou]={currentRoute:r?wP(r):{},routes:wP(i)},Tt[uf]=s,console.warn=a}n(),ik.on.componentUpdated(ku(()=>{var o;((o=t.value)==null?void 0:o.app)===e.app&&(n(),!wo.highPerfModeEnabled&&Mu.hooks.callHook("routerInfoUpdated",{state:Tt[Ou]}))},200))}function vY(e){return{async getInspectorTree(t){const n={...t,app:ts.value.app,rootNodes:[]};return await new Promise(o=>{e.callHookWith(async s=>{await Promise.all(s.map(r=>r(n))),o()},"getInspectorTree")}),n.rootNodes},async getInspectorState(t){const n={...t,app:ts.value.app,state:null},o={currentTab:`custom-inspector:${t.inspectorId}`};return await new Promise(s=>{e.callHookWith(async r=>{await Promise.all(r.map(i=>i(n,o))),s()},"getInspectorState")}),n.state},editInspectorState(t){const n=new Uq,o={...t,app:ts.value.app,set:(s,r=t.path,i=t.state.value,a)=>{n.set(s,r,i,a||n.createDefaultSetCallback(t.state))}};e.callHookWith(s=>{s.forEach(r=>r(o))},"editInspectorState")},sendInspectorState(t){const n=Bm(t);e.callHook("sendInspectorState",{inspectorId:t,plugin:{descriptor:n.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return Lq()},cancelInspectComponentInspector(){return Nq()},getComponentRenderCode(t){const n=qb(ts.value,t);if(n)return typeof(n==null?void 0:n.type)!="function"?n.render.toString():n.type.toString()},scrollToComponent(t){return Vq({id:t})},openInEditor:tY,getVueInspector:Hq,toggleApp(t,n){const o=$m.value.find(s=>s.id===t);o&&(eY(t),Qq(o),mY(o,ts),$P(),uk(o.app,n))},inspectDOM(t){const n=qb(ts.value,t);if(n){const[o]=Yb(n);o&&(Tt.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=o)}},updatePluginSettings(t,n,o){sY(t,n,o)},getPluginSettings(t){return{options:nY(t),values:ok(t)}}}}et();var gk,mk;(mk=(gk=Tt).__VUE_DEVTOOLS_ENV__)!=null||(gk.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var vk=Zq(),yk,wk;(wk=(yk=Tt).__VUE_DEVTOOLS_KIT_CONTEXT__)!=null||(yk.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:vk,get state(){return{...wo,activeAppRecordId:ts.id,activeAppRecord:ts.value,appRecords:$m.value}},api:vY(vk)});var Mu=Tt.__VUE_DEVTOOLS_KIT_CONTEXT__;et(),yq(Cq());var Ck,bk;(bk=(Ck=Tt).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__)!=null||(Ck.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set}),et(),et();function yY(e){wo.highPerfModeEnabled=e??!wo.highPerfModeEnabled,!e&&ts.value&&uk(ts.value.app)}et(),et(),et();function wY(e){wo.devtoolsClientDetected={...wo.devtoolsClientDetected,...e};const t=Object.values(wo.devtoolsClientDetected).some(Boolean);yY(!t)}var Sk,Ek;(Ek=(Sk=Tt).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__)!=null||(Sk.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=wY),et(),et(),et(),et(),et(),et(),et();var CY=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},_k=class{constructor(t){this.generateIdentifier=t,this.kv=new CY}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},bY=class extends _k{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};et(),et();function SY(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function EY(e,t){const n=SY(e);if("find"in n)return n.find(t);const o=n;for(let s=0;s<o.length;s++){const r=o[s];if(t(r))return r}}function Nu(e,t){Object.entries(e).forEach(([n,o])=>t(o,n))}function Hm(e,t){return e.indexOf(t)!==-1}function Rk(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(t(o))return o}}var _Y=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return EY(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}};et(),et();var RY=e=>Object.prototype.toString.call(e).slice(8,-1),Dk=e=>typeof e>"u",DY=e=>e===null,df=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,aS=e=>df(e)&&Object.keys(e).length===0,za=e=>Array.isArray(e),TY=e=>typeof e=="string",IY=e=>typeof e=="number"&&!isNaN(e),xY=e=>typeof e=="boolean",FY=e=>e instanceof RegExp,hf=e=>e instanceof Map,ff=e=>e instanceof Set,Tk=e=>RY(e)==="Symbol",PY=e=>e instanceof Date&&!isNaN(e.valueOf()),kY=e=>e instanceof Error,Ik=e=>typeof e=="number"&&isNaN(e),AY=e=>xY(e)||DY(e)||Dk(e)||IY(e)||TY(e)||Tk(e),OY=e=>typeof e=="bigint",MY=e=>e===1/0||e===-1/0,NY=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),LY=e=>e instanceof URL;et();var xk=e=>e.replace(/\./g,"\\."),lS=e=>e.map(String).map(xk).join("."),pf=e=>{const t=[];let n="";for(let s=0;s<e.length;s++){let r=e.charAt(s);if(r==="\\"&&e.charAt(s+1)==="."){n+=".",s++;continue}if(r==="."){t.push(n),n="";continue}n+=r}const o=n;return t.push(o),t};et();function ci(e,t,n,o){return{isApplicable:e,annotation:t,transform:n,untransform:o}}var Fk=[ci(Dk,"undefined",()=>null,()=>{}),ci(OY,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ci(PY,"Date",e=>e.toISOString(),e=>new Date(e)),ci(kY,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(o=>{n[o]=e[o]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(o=>{n[o]=e[o]}),n}),ci(FY,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),ci(ff,"set",e=>[...e.values()],e=>new Set(e)),ci(hf,"map",e=>[...e.entries()],e=>new Map(e)),ci(e=>Ik(e)||MY(e),"number",e=>Ik(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ci(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),ci(LY,"URL",e=>e.toString(),e=>new URL(e))];function Gm(e,t,n,o){return{isApplicable:e,annotation:t,transform:n,untransform:o}}var Pk=Gm((e,t)=>Tk(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const o=n.symbolRegistry.getValue(t[1]);if(!o)throw new Error("Trying to deserialize unknown symbol");return o}),VY=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),kk=Gm(NY,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=VY[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Ak(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var Ok=Gm(Ak,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const o={};return n.forEach(s=>{o[s]=e[s]}),o},(e,t,n)=>{const o=n.classRegistry.getValue(t[1]);if(!o)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(o.prototype),e)}),Mk=Gm((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const o=n.customTransformerRegistry.findByName(t[1]);if(!o)throw new Error("Trying to deserialize unknown custom value");return o.deserialize(e)}),BY=[Ok,Pk,Mk,kk],Nk=(e,t)=>{const n=Rk(BY,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const o=Rk(Fk,s=>s.isApplicable(e,t));if(o)return{value:o.transform(e,t),type:o.annotation}},Lk={};Fk.forEach(e=>{Lk[e.annotation]=e});var $Y=(e,t,n)=>{if(za(t))switch(t[0]){case"symbol":return Pk.untransform(e,t,n);case"class":return Ok.untransform(e,t,n);case"custom":return Mk.untransform(e,t,n);case"typed-array":return kk.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const o=Lk[t];if(!o)throw new Error("Unknown transformation: "+t);return o.untransform(e,n)}};et();var Lu=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Vk(e){if(Hm(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Hm(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Hm(e,"constructor"))throw new Error("constructor is not allowed as a property")}var HY=(e,t)=>{Vk(t);for(let n=0;n<t.length;n++){const o=t[n];if(ff(e))e=Lu(e,+o);else if(hf(e)){const s=+o,r=+t[++n]==0?"key":"value",i=Lu(e,s);switch(r){case"key":e=i;break;case"value":e=e.get(i);break}}else e=e[o]}return e},cS=(e,t,n)=>{if(Vk(t),t.length===0)return n(e);let o=e;for(let r=0;r<t.length-1;r++){const i=t[r];if(za(o)){const a=+i;o=o[a]}else if(df(o))o=o[i];else if(ff(o)){const a=+i;o=Lu(o,a)}else if(hf(o)){if(r===t.length-2)break;const l=+i,c=+t[++r]==0?"key":"value",u=Lu(o,l);switch(c){case"key":o=u;break;case"value":o=o.get(u);break}}}const s=t[t.length-1];if(za(o)?o[+s]=n(o[+s]):df(o)&&(o[s]=n(o[s])),ff(o)){const r=Lu(o,+s),i=n(r);r!==i&&(o.delete(r),o.add(i))}if(hf(o)){const r=+t[t.length-2],i=Lu(o,r);switch(+s==0?"key":"value"){case"key":{const l=n(i);o.set(l,o.get(i)),l!==i&&o.delete(i);break}case"value":{o.set(i,n(o.get(i)));break}}}return e};function uS(e,t,n=[]){if(!e)return;if(!za(e)){Nu(e,(r,i)=>uS(r,t,[...n,...pf(i)]));return}const[o,s]=e;s&&Nu(s,(r,i)=>{uS(r,t,[...n,...pf(i)])}),t(o,n)}function GY(e,t,n){return uS(t,(o,s)=>{e=cS(e,s,r=>$Y(r,o,n))}),e}function UY(e,t){function n(o,s){const r=HY(e,pf(s));o.map(pf).forEach(i=>{e=cS(e,i,()=>r)})}if(za(t)){const[o,s]=t;o.forEach(r=>{e=cS(e,pf(r),()=>e)}),s&&Nu(s,n)}else Nu(t,n);return e}var WY=(e,t)=>df(e)||za(e)||hf(e)||ff(e)||Ak(e,t);function zY(e,t,n){const o=n.get(e);o?o.push(t):n.set(e,[t])}function jY(e,t){const n={};let o;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[r,...i]=s;r.length===0?o=i.map(lS):n[lS(r)]=i.map(lS)}),o?aS(n)?[o]:[o,n]:aS(n)?void 0:n}var Bk=(e,t,n,o,s=[],r=[],i=new Map)=>{var a;const l=AY(e);if(!l){zY(e,s,t);const p=i.get(e);if(p)return o?{transformedValue:null}:p}if(!WY(e,n)){const p=Nk(e,n),g=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:e};return l||i.set(e,g),g}if(Hm(r,e))return{transformedValue:null};const c=Nk(e,n),u=(a=c==null?void 0:c.value)!=null?a:e,d=za(u)?[]:{},h={};Nu(u,(p,g)=>{if(g==="__proto__"||g==="constructor"||g==="prototype")throw new Error(`Detected property ${g}. This is a prototype pollution risk, please remove it from your object.`);const v=Bk(p,t,n,o,[...s,g],[...r,e],i);d[g]=v.transformedValue,za(v.annotations)?h[g]=v.annotations:df(v.annotations)&&Nu(v.annotations,(w,S)=>{h[xk(g)+"."+S]=w})});const f=aS(h)?{transformedValue:d,annotations:c?[c.type]:void 0}:{transformedValue:d,annotations:c?[c.type,h]:h};return l||i.set(e,f),f};et(),et();function $k(e){return Object.prototype.toString.call(e).slice(8,-1)}function Hk(e){return $k(e)==="Array"}function KY(e){if($k(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function qY(e,t,n,o,s){const r={}.propertyIsEnumerable.call(o,t)?"enumerable":"nonenumerable";r==="enumerable"&&(e[t]=n),s&&r==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function dS(e,t={}){if(Hk(e))return e.map(s=>dS(s,t));if(!KY(e))return e;const n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e);return[...n,...o].reduce((s,r)=>{if(Hk(t.props)&&!t.props.includes(r))return s;const i=e[r],a=dS(i,t);return qY(s,r,a,e,t.nonenumerable),s},{})}var An=class{constructor({dedupe:e=!1}={}){this.classRegistry=new bY,this.symbolRegistry=new _k(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new _Y,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=Bk(e,t,this,this.dedupe),o={json:n.transformedValue};n.annotations&&(o.meta={...o.meta,values:n.annotations});const s=jY(t,this.dedupe);return s&&(o.meta={...o.meta,referentialEqualities:s}),o}deserialize(e){const{json:t,meta:n}=e;let o=dS(t);return n!=null&&n.values&&(o=GY(o,n.values,this)),n!=null&&n.referentialEqualities&&(o=UY(o,n.referentialEqualities)),o}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};An.defaultInstance=new An,An.serialize=An.defaultInstance.serialize.bind(An.defaultInstance),An.deserialize=An.defaultInstance.deserialize.bind(An.defaultInstance),An.stringify=An.defaultInstance.stringify.bind(An.defaultInstance),An.parse=An.defaultInstance.parse.bind(An.defaultInstance),An.registerClass=An.defaultInstance.registerClass.bind(An.defaultInstance),An.registerSymbol=An.defaultInstance.registerSymbol.bind(An.defaultInstance),An.registerCustom=An.defaultInstance.registerCustom.bind(An.defaultInstance),An.allowErrorProps=An.defaultInstance.allowErrorProps.bind(An.defaultInstance),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et(),et();var Gk,Uk;(Uk=(Gk=Tt).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__)!=null||(Gk.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var Wk,zk;(zk=(Wk=Tt).__VUE_DEVTOOLS_KIT_RPC_CLIENT__)!=null||(Wk.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var jk,Kk;(Kk=(jk=Tt).__VUE_DEVTOOLS_KIT_RPC_SERVER__)!=null||(jk.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var qk,Yk;(Yk=(qk=Tt).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__)!=null||(qk.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var Zk,Xk;(Xk=(Zk=Tt).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__)!=null||(Zk.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var Jk,Qk;(Qk=(Jk=Tt).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__)!=null||(Jk.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null),et(),et(),et(),et(),et(),et(),et();/*!
|
|
137
137
|
* pinia v3.0.4
|
|
138
138
|
* (c) 2025 Eduardo San Martin Morote
|
|
139
139
|
* @license MIT
|
|
@@ -143,13 +143,13 @@ Only state can be modified.`);i[0]="$state",Vu=!1,o.set(r,i,o.state.value),Vu=!0
|
|
|
143
143
|
state: () => new MyClass()
|
|
144
144
|
Found in store "${I.$id}".`),p&&r&&n.hydrate&&n.hydrate(I.$state,p),c=!0,u=!0,I}/*! #__NO_SIDE_EFFECTS__ */function rc(e,t,n){let o;const s=typeof t=="function";o=s?n:t;function r(i,a){const l=Kw();if(i=(J.env.NODE_ENV==="test"&&nc&&nc._testing?null:i)||(l?yn(Um,null):null),i&&gf(i),J.env.NODE_ENV!=="production"&&!nc)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
145
145
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
146
|
-
This will fail in production.`);i=nc,i._s.has(e)||(s?mS(e,t,o,i):gA(e,o,i),J.env.NODE_ENV!=="production"&&(r._pinia=i));const c=i._s.get(e);if(J.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?mS(u,t,o,i,!0):gA(u,sr({},o),i,!0);a._hotUpdate(d),delete i.state.value[u],i._s.delete(u)}if(J.env.NODE_ENV!=="production"&&ea){const u=oo();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return r.$id=e,r}function ns(e){const t=Lt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=q({get:()=>e[o],set(r){e[o]=r}}):(mn(s)||zs(s))&&(n[o]=Yr(e,o))}return n}const vS=rc("permissionStore",()=>{const e=V([]),t=V(),n=V({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),mZ="woohoo_getWoohooUserInterface_read",yS="media_getReviewUserInterface_read",vZ="update_getUpdateUserInterface_read",mA="Unarchive parent folder first to continue",yZ=(e,t,n,o,s,r)=>{const i=vS(),{userPermissions:a}=ns(i),l=q(()=>{const T=un.getInstance().getItem("BASE_URL"),P=un.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:M,entity_id:D,scene_id:F}=e.value;return{baseDomain:T||"",ws_code:M||"",entity_id:D||"",scene_id:F||"",reviewDomain:P||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=q(()=>{var P;const T=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(yS),canCopyLink:!0,canRename:(T==null?void 0:T.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(yS),canOpenTakeInUpdate:a.value.includes(vZ),canOpenTakeInWoohoo:a.value.includes(mZ),canDeleteRendition:((P=T==null?void 0:T.media)==null?void 0:P.has_delete_rendition_permission)??!1,canDeleteThumbnail:(T==null?void 0:T.has_edit_thumbnail_permission)??!1,canArchiveScene:T==null?void 0:T.has_archive_permission,canUnarchiveScene:T==null?void 0:T.has_archive_permission,canDeleteScene:(T==null?void 0:T.has_delete_permission)??!1,canEditDescription:(T==null?void 0:T.has_edit_permission)??!1}}),u=q(()=>({project:es({type:"project",config:l.value}).url,take_review:es({type:"review_take",config:l.value}).url,review:es({type:"review_scene",config:l.value}).url,review_scene:es({type:"review_scene",config:l.value}).url,woohoo:es({type:"woohoo",config:l.value}).url,update:es({type:"update",config:l.value}).url,scene_hub:es({type:"scene_hub",config:l.value}).url})),d=(T,P)=>{const M=T.metaKey||T.ctrlKey,D=u.value[P]||"";if(D){if(P==="scene_hub"){if(M){window.open(D,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}M?window.open(D,"_blank"):window.location.href=D}},h=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete rendition.")}catch(D){console.error("Error deleting rendition",D)}finally{s()}},f=async(T,P)=>{var M;try{await((M=e.value.axiosService.value)==null?void 0:M.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{s()}},p=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to archive scene."),P&&P("archived")}catch(D){console.error("Error archiving item",D)}finally{s()}},g=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete scene."),P&&P("deleted")}catch(D){console.error("Error deleting item",D)}finally{s()}},v=T=>{const P=u.value.scene_hub||"";P&&(_.value="Copied",navigator.clipboard.writeText(P),setTimeout(()=>{_.value="Copy link"},5e3))},w=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to unarchive scene."),P&&P("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{s()}},S=T=>p(T,t),b=T=>w(T,t),C=T=>g(T,t),_=V("Copy link"),E=T=>d(T,"review"),I=q(()=>{let T=[];if(!l.value.scene_id&&e.value.optionBlock&&T.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const P=()=>Math.random().toString(36).substring(2,9);return[{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:E,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:P(),label:_.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?mA:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?mA:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:C,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:w,options:I}};function Co(e){const t=V(!1),n=V(!1),o=q(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,vt(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return Qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",r)),u&&(u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",a))}),qn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",r)),u&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const $u=e=>{const t=V(!1),n=q(()=>t.value);return Qt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},vA=Ct(st({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=Ts,{triggerRef:n,popupRef:o}=yo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=q(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(K(),ie("div",{class:te(i.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[Dt(i.$slots,"default"),Ke(me("div",{class:te(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ks,r.showBadge],[H(t),{isLoading:r.loading,fullwidth:!0}]]),me("div",{ref_key:"popupRef",ref:o,class:te(i.$style["badge-tooltip"])},ht(r.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),mf=rc("switchStore",()=>{const e=V(null),t=yn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),wZ=st({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:Tm()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Yt,o=Ts,s=e,r=t,i={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=V(new Date),l=V(!0),c=V(!1),u=V(!1),d=V(null);let h=null,f=null;const p=mf(),{openPeopleInsight:g}=p,v=q(()=>!s.private&&!c.value),w=q(()=>{var x,$;return((x=d.value)==null?void 0:x.display_name)??(($=s.user)==null?void 0:$.name)}),S=q(()=>{var x,$;return!v.value||!d.value?s.status:(x=d.value.private_info)!=null&&x.is_offline?"offline":($=d.value.private_info)!=null&&$.last_active?"active":"away"}),b=q(()=>{const x=S.value;return x?i[x]:""}),C=q(()=>{var x,$;return(($=(x=d.value)==null?void 0:x.private_info)==null?void 0:$.timezone)??s.timezone}),_=q(()=>{if(!C.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:C.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",C.value),""}}),E=q(()=>{var x,$,W;return{id:s.user.id,name:w.value,initial:((x=d.value)==null?void 0:x.initial)??s.user.initial,profile_image:(($=d.value)==null?void 0:$.profile_image)??s.user.profile_image,color:((W=d.value)==null?void 0:W.color)??s.user.color,size:72,borderRadius:"8px"}}),I=q(()=>{const x=un.getInstance().getItem("BASE_URL"),$=un.getInstance().getItem("ws.code")||"";return es({type:"people_insight",config:{ws_code:$,baseDomain:x,user_id:s.user.id}}).url}),{copyToClipboard:T,tooltip:P}=fP(I.value,()=>r("copyLink",s.user.id)),M=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const x=await s.apiUpdateFunction(s.user.id);x?(d.value=x,r("dataUpdated",x)):(c.value=!0,u.value=!0,r("dataUpdated",null))}catch(x){c.value=!0,u.value=!0,console.error("Failed to fetch user data:",x)}finally{l.value=!1}},D=()=>{F(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(M,s.refreshInterval))},F=()=>{f!==null&&(clearInterval(f),f=null)},O=x=>{var $;if(x.ctrlKey||x.metaKey){window.open(I.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?($=s.switchInstance)==null||$.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(I.value,"_blank")}},k=x=>{O(x),r("insightClick",s.user.id)};return tt([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],D),Qt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await M(),D()):l.value=!1}),Ol(()=>{h&&clearInterval(h),F()}),(x,$)=>s.showPrivateUser&&(s.private||u.value)?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["private-badge"]])},[...$[0]||($[0]=[me("span",null,"Private User",-1)])],2)):(K(),ie("div",{key:1,class:te([x.$style["mini-people-card"],{[x.$style.loading]:l.value},"bg-skeleton"])},[me("div",{class:te(x.$style["avatar-section"])},[v.value?(K(),Ue(vA,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":b.value},{default:he(()=>[ue(Gh,Wt({readOnly:!0},E.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ue(Gh,Wt({key:1,readOnly:!0},E.value),null,16))],2),me("div",{class:te(x.$style["user-info"])},[me("div",{class:te(x.$style["info-column"])},[Ke((K(),ie("span",{class:te(x.$style["user-name"])},[Qe(ht(w.value),1)],2)),[[H(n),{content:w.value,delay:[1e3,0]}]]),C.value&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["time-row"]])},[Ke((K(),ie("div",{class:te(x.$style["time-display"])},[ue(lt,{source:"remote",src:"Globe",class:te(x.$style["clock-icon"]),size:"10"},null,8,["class"]),me("span",{class:te(x.$style["time-text"])},ht(_.value)+" ("+ht(C.value)+")",3)],2)),[[H(o),{isLoading:l.value,fullwidth:!0}]])],2)):Xe("",!0)],2),!e.readOnly&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(K(),Ue(at,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:kt(k,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Xe("",!0),e.showCopyLinkButton?Ke((K(),Ue(at,{key:1,variant:["icon","secondary"],size:"small",onClick:kt(H(T),["prevent","stop"]),disabled:s.disabled},{default:he(()=>[ue(lt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[H(n),{content:H(P),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Xe("",!0)],2)):Xe("",!0)],2)],2))}}),CZ=Ct(wZ,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),bZ=Ct(st({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=ko,o=Yt,s=e,{isEditing:r}=$u(s),i=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=q(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=V();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>Ke((K(),Ue(at,{class:te(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:H(r),onClick:kt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:he(()=>[ue(lt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[H(o),"More actions"],[H(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),SZ=["src","width","height","alt"],Ka=Ct(st({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Ts,{getCachedValue:n,setCachedValue:o}=$h({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=q(()=>({minWidth:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=q(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:u,loading:d}=TI(c,"visual",l,a);return(h,f)=>Ke((K(),ie("div",{class:te([h.$style.visualWrapper,{[h.$style.loading]:H(d)}]),style:cn(i.value)},[me("img",{src:H(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(i.value)},null,12,SZ)],6)),[[H(t),{isLoading:H(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),EZ=["tabindex"],_o=Ct(st({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;bg();const r=Og(),i=V(null),a=V("default"),l=q(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=q(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=q(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var C,_;const g=((C=i.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((_=i.value)==null?void 0:_.querySelectorAll(":scope > .wrapper-suffix").length)||0,w="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${b}))`:!g&&v?`calc(100% - (${v} * ${w} + ${b})) repeat(${v}, ${w})`:g&&v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${v} * ${w} + ${b})) repeat(${v}, ${w})`:"100%"},h=V("100%"),f=()=>{h.value=d()};mh(()=>{f()}),Qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{vt(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(K(),ie("div",{ref_key:"rootEl",ref:i,class:te([H(r)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Dt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Dt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),Dt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,EZ))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_46uq2_1",readOnly:"_readOnly_46uq2_26",bordered:"_bordered_46uq2_29",disabled:"_disabled_46uq2_29",active:"_active_46uq2_29",focused:"_focused_46uq2_29",hovered:"_hovered_46uq2_33",error:"_error_46uq2_37",clickable:"_clickable_46uq2_50",suffix:"_suffix_46uq2_56",prefix:"_prefix_46uq2_57"}}]]),_Z=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const RZ=Object.prototype.toString,DZ=e=>RZ.call(e)==="[object Object]",Hu=()=>{};function TZ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return n}function IZ(e,t={}){let n,o,s=Hu;const r=l=>{clearTimeout(l),s(),s=Hu};let i;return l=>{const c=Hi(e),u=Hi(t.maxWait);return n&&r(n),c<=0||u!==void 0&&u<=0?(o&&(r(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{s=t.rejectOnCancel?h:d,i=l,u&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,d(i())},u)),n=setTimeout(()=>{o&&r(o),o=void 0,d(l())},c)})}}function wS(e){return Array.isArray(e)?e:[e]}function xZ(e,t=200,n={}){return TZ(IZ(t,n),e)}function FZ(e,t,n){return tt(e,t,{...n,immediate:!0})}const yA=_Z?window:void 0;function vf(e){var t;const n=Hi(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function CS(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=q(()=>{const o=wS(Hi(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return FZ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>vf(r)))!==null&&o!==void 0?o:[yA].filter(r=>r!=null),wS(Hi(n.value?e[1]:e[0])),wS(H(n.value?e[2]:e[1])),Hi(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const c=DZ(i)?{...i}:i,u=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function bS(e,t,n={}){const{window:o=yA,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:Hu,cancel:Hu,trigger:Hu}:Hu;let l=!0;const c=v=>Hi(s).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(S=>S===v.target||v.composedPath().includes(S));{const S=vf(w);return S&&(v.target===S||v.composedPath().includes(S))}});function u(v){const w=Hi(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const S=Hi(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(C=>C.el===w.target||w.composedPath().includes(C.el))}const h=v=>{const w=vf(e);if(v.target!=null&&!(!(w instanceof Element)&&u(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[CS(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),CS(o,"pointerdown",v=>{const w=vf(e);l=!c(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),i&&CS(o,"blur",v=>{setTimeout(()=>{var w;const S=vf(e);((w=o.document.activeElement)===null||w===void 0?void 0:w.tagName)==="IFRAME"&&!(S!=null&&S.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const PZ=["value","placeholder","disabled","readonly","inputmode","maxlength"],SS=Ct(st({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const o=ko,s=Yt,r=e,i=n,a=V(null),l=V(r.modelValue||"");tt(l,()=>{i("onValidation",l.value)});const c=V(!1),u=V(r.modelValue||"");tt(()=>r.modelValue,N=>{l.value=N||"",u.value=N||""});const d=q(()=>{var N;return((N=l.value)==null?void 0:N.length)>0}),h={text:N=>N.slice(0,r.maxLength||255),number:N=>{let z=N.replace(/[^\d.-]/g,"");const ne=z.split(".");ne.length>2&&(z=ne[0]+"."+ne.slice(1).join("")),z=z.replace(/-/g,(U,ge)=>ge===0?U:"");const ve=z.startsWith("-")?"-":"",re=z.replace("-","").split(".");return re[0].length>17&&(re[0]=re[0].substring(0,17)),r.maxDecimalChar!==void 0&&re.length>1&&(re[1]=re[1].substring(0,r.maxDecimalChar)),z=ve+re.join("."),z},email:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),url:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),tel:N=>N.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=N=>{const z=h[r.type];return z?z(N):N},p=xZ(N=>{r.autoEmit&&(i("update:modelValue",N),i("input",N))},r.debounceDelay),g=N=>{const z=N;if(r.disabled||r.readOnly){z.preventDefault();return}const ne=z.target,pe=ne.selectionStart||0,ve=l.value,we=f(ne.value);ve!==we&&(l.value=we,i("input",we),r.autoEmit&&p(we),ne.value!==we&&(ne.value=we,vt(()=>{let re=pe;if(we.length<ne.value.length)re=pe;else{const U=we.length-ve.length;re=pe+U}re=Math.max(0,Math.min(re,we.length)),ne.setSelectionRange(re,re)})))},v=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}c.value=!0;const z=l.value;l.value="",i("update:modelValue",""),i("clear"),z!==""&&i("change",""),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),vt(()=>{var ne;(ne=a.value)==null||ne.focus(),setTimeout(()=>{c.value=!1},100)})},w=N=>{r.disabled||r.readOnly||(i("focus",N),r.selectOnFocus&&vt(()=>{N.target.select()}))},S=N=>{if(c.value)return;const ne=N.target.value;r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne),i("blur",ne,N)},b=N=>{setTimeout(()=>{vt(()=>{const ne=N.target.value;i("enter",ne,N),i("enterValue",ne),r.submitOnEnter&&(N.preventDefault(),r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))})},1e3)},C=N=>{const z=N.target,ne=z.value;if(i("escape",ne,N),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&z.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&z.blur()},_=N=>{const ne=N.target.value;i("tab",ne,N),r.autoEmit||(i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))},E=(N,z,ne)=>N===""?!0:N==="."?ne>0:new RegExp(`^\\d{0,${z}}(\\.\\d{0,${ne}})?$`).test(N),I=N=>{if(i("keydown",N),N.key===" "&&N.stopPropagation(),r.type==="number"){if(N.key==="e"||N.key==="E"){N.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(N.key)||N.ctrlKey||N.metaKey||N.altKey)){if(Number.isNaN(Number(N.key))&&N.key!=="."&&N.key!=="-"){N.preventDefault();return}const pe=l.value+N.key;if(!E(pe,17,r.maxDecimalChar||2)){N.preventDefault();return}}}N.key==="Escape"?C(N):N.key==="Enter"?b(N):N.key==="Tab"?_(N):(N.key==="ArrowUp"||N.key==="ArrowDown")&&r.type==="number"&&N.preventDefault()},T=N=>{i("keyup",N)},P=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("paste",N)},M=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("cut",N)},D=N=>{i("select",N)},F=`input-text-${Math.random().toString(36).substr(2,9)}`,O=V(!1),k=q(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});tt(()=>l.value,N=>{r.validatorFnc?O.value=!!N&&!r.validatorFnc(N):O.value=!1});const x=V(null),$=q(()=>({disabled:r.disabled,readOnly:r.readOnly,error:O.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:x,bordered:!0})),{argsMain:W,isHover:Q,isFocus:ae}=Co($);t({triggerFocus:()=>{vt(()=>{var N;(N=a.value)==null||N.focus()})},focus:()=>{ee()},blur:()=>{vt(()=>{var N;(N=a.value)==null||N.blur()})},select:()=>{vt(()=>{var N;(N=a.value)==null||N.select()})},setSelectionRange:(N,z)=>{vt(()=>{var ne;(ne=a.value)==null||ne.setSelectionRange(N,z)})},getValue:()=>l.value,setValue:N=>{l.value=f(N),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ee=()=>{!r.disabled&&!r.readOnly&&vt(()=>{var N;(N=a.value)==null||N.focus()})},X=q(()=>ae.value&&d.value);return(N,z)=>(K(),ie("div",{class:te([N.$style["input-wrapper"],"input-editor"]),onClick:ee},[Ke((K(),Ue(_o,Wt(H(W),{ref_key:"wrapperRef",ref:x,class:[N.$style["input-box"],{[N.$style["is-hovered"]]:H(Q),[N.$style["is-focused"]]:H(ae),[N.$style["has-input"]]:d.value,[N.$style["is-editting"]]:X.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:he(()=>[Dt(N.$slots,"prefix")]),suffix:he(()=>[d.value&&!r.disabled&&!r.readOnly?Dt(N.$slots,"clear",{key:0},()=>[Ke((K(),Ue(at,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:kt(v,["prevent","stop"]),size:18,rounded:!0,class:te(["wrapper-suffix",N.$style["clear-button"]])},{default:he(()=>[ue(lt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[H(s),{content:"Clear",contentClass:"extra-padding"}]])]):Dt(N.$slots,"suffix",{key:1})]),default:he(()=>[me("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:te([N.$style["column-config__input"]]),id:F,disabled:e.disabled,readonly:e.readOnly,inputmode:k.value,maxlength:r.maxLength,onInput:g,onFocus:w,onBlur:S,onKeydown:I,onKeyup:T,onPaste:P,onCut:M,onSelect:D},null,42,PZ)]),_:3},16,["class","bordered"])),[[H(o),r.focusIndex]]),O.value?Dt(N.$slots,"error",{key:0}):Xe("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1p4v0_1","is-disabled":"_is-disabled_1p4v0_16","is-readonly":"_is-readonly_1p4v0_16","is-hovered":"_is-hovered_1p4v0_16","is-focused":"_is-focused_1p4v0_20","column-config__input":"_column-config__input_1p4v0_40","clear-button":"_clear-button_1p4v0_55"}}]]),kZ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},ES=st({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null),i=xr(c=>{s("update:modelValue",c),s("search",c)},li),a=()=>{s("update:modelValue",""),s("clear"),vt(()=>{var c;(c=r.value)==null||c.focus()})},l=V(o.modelValue);return t({focus:()=>{var c;(c=r.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(K(),Ue(SS,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:H(i),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:he(()=>[me("div",kZ,[ue(lt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),ic=Ct(st({name:"ListItem",directives:{tooltip:Yt,focusable:ko},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=ko,s=e,r=n,i=V(!1),a=V(!1);function l(_){if(!_||typeof _!="object")return!1;const E=_;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const c=q(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!C.prefix),u=q(()=>!!C.suffix||s.danger&&i.value),d=q(()=>{var _;return s.type==="status"&&typeof((_=s.data)==null?void 0:_.color)=="string"?{backgroundColor:s.data.color,border:em(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=Og(),f=q(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:c.value,[h["has-suffix"]]:u.value,[h.readOnly]:s.readOnly}));q(()=>({content:"Cancel",...b})),q(()=>({content:"Confirm",theme:"warning",...b}));function p(_){return{name:_.name,initial:_.initial,id:_.id,profile_image:_.profile_image??null,color:_.color,size:24}}function g(){i.value=!1}function v(_){_?r("click",_):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function w(_){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(_);r("handleClick",_)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),C=bg();return tt(()=>s.show,_=>{_===!1&&(i.value=!1)}),t({select:()=>{w(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(_,E)=>{const I=eu("tooltip");return Ke((K(),Ue(at,{variant:["menu-item",e.danger?"danger":"menu-item"],class:te([_.$style["list-item"],f.value]),onHandleClick:w,onMouseenter:E[0]||(E[0]=T=>a.value=!0),onMouseleave:E[1]||(E[1]=T=>a.value=!1),onEscape:S,style:cn({width:s.itemWidth})},{default:he(()=>[c.value?(K(),ie("div",{key:0,class:te(_.$style["list-item__prefix"])},[Dt(_.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ue(lt,{key:0,src:e.icon,source:"remote",class:te(_.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(K(),ie("div",{key:1,class:te(_.$style["status-indicator"]),style:cn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(K(),Ue(Gh,Wt({key:2},p(e.data),{class:_.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Xe("",!0)])],2)):Xe("",!0),me("div",{class:te(_.$style["list-item__label"])},[Dt(_.$slots,"label",{selected:e.selected},()=>[Qe(ht(e.label),1)])],2),u.value?(K(),ie("div",{key:1,class:te(_.$style["list-item__suffix"])},[Dt(_.$slots,"suffix",{item:_.$props,hovered:a.value},()=>[e.danger&&i.value?(K(),ie("div",{key:0,class:te(_.$style["confirm-action"])},[Ke((K(),Ue(at,{variant:["tertiary","icon","danger"],size:"small",onClick:kt(g,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Xmark",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.0`],[I,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((K(),Ue(at,{variant:["danger","primary","icon"],size:"small",onClick:kt(v,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.1`],[I,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)])],2)):Xe("",!0)]),_:3},8,["variant","class","style"])),[[H(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_tuyyv_1",disabled:"_disabled_tuyyv_16",danger:"_danger_tuyyv_23","has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:"_clickable_tuyyv_40",readOnly:"_readOnly_tuyyv_43",hover:"_hover_tuyyv_47",active:"_active_tuyyv_53","list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"}}]]),AZ=["aria-activedescendant"],OZ=["innerHTML"],MZ=10,na=Ct(st({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=V(""),l=V(-1),c=V(null),u=V(null),d=V(new Map),h=q(()=>Vb(a.value)),f=()=>{const X=h.value;if(!X||X.length<r.minQueryLength)return r.options;if(d.value.has(X))return d.value.get(X);const N=r.options.map(z=>({item:z,score:k7(` ${z.label} `,X)})).filter(({score:z})=>z>0).sort((z,ne)=>ne.score-z.score).map(({item:z})=>z);return d.value.set(X,N),N},p=V([]);tt(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=q(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=xr(X=>{a.value=X,l.value=-1,i("search",X)},li),w=async X=>{ae.value=0,await v(X||""),ae.value=1},S=X=>a.value?A7(X,a.value):X,b=X=>{const z={[s.ARROW_DOWN]:()=>C(X),[s.ARROW_UP]:()=>_(X),[s.ENTER]:()=>T(X),[s.ESCAPE]:()=>P(X),[s.TAB]:()=>M(X)}[X.key];z&&z()},C=X=>{X.preventDefault(),E(1)},_=X=>{X.preventDefault(),E(-1)},E=X=>{const N=p.value.length;if(N===0)return;let z;X>0?z=(l.value+1)%N:l.value>0?z=l.value-1:z=N-1,l.value=z,I()},I=()=>{vt(()=>{var N;const X=(N=u.value)==null?void 0:N.querySelectorAll('[role="menuitem"]')[l.value];X==null||X.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},T=X=>{if(X.preventDefault(),l.value>=0&&l.value<p.value.length){const z=p.value[l.value];D(z,X)}},P=X=>{X.preventDefault(),O()},M=X=>{i("tab",X)},D=(X,N)=>{!X||X.disabled||(i("select",X,N),l.value=-1,O())},F=X=>{X>=0&&X<p.value.length&&(l.value=X)},O=()=>{i("close")},k=()=>{if(!g.value||!u.value)return;const{scrollTop:X,clientHeight:N,scrollHeight:z}=u.value;z-(X+N)<=MZ&&i("loadMore")},x=()=>{var X,N,z;(X=u.value)==null||X.addEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.addEventListener("keydown",b)},$=()=>{var X,N,z;(X=u.value)==null||X.removeEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.removeEventListener("keydown",b)};Qt(()=>{x()}),qn(()=>{$()}),tt(()=>r.loading,X=>{!X&&p.value.length>0&&(l.value=-1)});const W=X=>X?Array.isArray(r.selectedId)?r.selectedId.includes(String(X.id)):r.selectedId==X.id:!1,Q=V(null);tt(l,()=>{I()}),t({focus:()=>{vt(()=>{var X;(X=Q.value)==null||X.focus()})},reset:()=>{var X;(X=Q.value)==null||X.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:O,clearSearch:()=>{a.value=""},scrollTo:X=>{u.value&&(u.value.scrollTop=X)},selectIndex:X=>{X>=0&&X<p.value.length&&(l.value=X,I())}});const ae=V(0);tt([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const X=r.options.length>0&&p.value.length>0,N=!X&&a.value.length>0,z=!X&&a.value.length===0;r.loading?ae.value=0:X?ae.value=1:N?ae.value=2:z&&(ae.value=3)},{immediate:!0,deep:!0});const ee=()=>{i("cancel")};return(X,N)=>(K(),ie("datalist",{ref_key:"searchListRef",ref:c,class:te([X.$style["search-list"],ae.value===3||ae.value===2?X.$style.empty:"",p.value.length>8?X.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.itemWidth||e.width})},[ue(ES,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":N[0]||(N[0]=z=>a.value=z),class:te(X.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:N[1]||(N[1]=z=>w("")),onCancel:ee},null,8,["modelValue","class","disabled"]),me("div",{ref_key:"popupRef",ref:u,class:te(X.$style["list-container"])},[Dt(X.$slots,"extra-item",{query:a.value,isEmpty:ae.value===3||ae.value===2,isLoading:r.loading}),(K(!0),ie(It,null,Fn(p.value,(z,ne)=>Ke((K(),ie("div",{key:`${z.id}-${ne}`,role:"menuitem"},[Dt(X.$slots,"item",{item:z,index:ne,selectedIndex:l.value,isSelected:W,handleSelect:D,handleItemHover:F,getHighlightedLabel:S,query:a.value,idx:ne,focused:l.value==ne},()=>[z.hide?Xe("",!0):(K(),Ue(ic,Wt({key:0,ref_for:!0},z,{hover:ne===l.value,selected:W(z),type:z.type,id:`item-${ne}`,"aria-selected":ne===l.value,onClick:pe=>D(z,pe),onMouseover:pe=>F(ne),onEscape:O,itemWidth:e.itemWidth||e.width}),{prefix:he(()=>[Dt(X.$slots,"prefix-item",{item:z})]),label:he(()=>[a.value?Ke((K(),ie("span",{key:0,class:te(X.$style.match),innerHTML:S(z.label)},null,10,OZ)),[[H(o),{content:z.label,delay:[1e3,0]}]]):Ke((K(),ie("span",{key:1,class:te(X.$style["item-label"])},[Qe(ht(z.label),1)],2)),[[H(o),{content:z.label,delay:[1e3,0]}]])]),suffix:he(({hovered:pe})=>[Dt(X.$slots,"action",{item:z,isHovered:ne===l.value,hovered:pe,selected:l.value==ne})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[Ks,ae.value===1]])),128)),ae.value===0?Dt(X.$slots,"loading-more",{key:0},()=>[(K(),ie(It,null,Fn(8,z=>me("div",{class:te(X.$style["loading-more"]),key:z},[me("div",{class:te(X.$style["loading-skeleton"])},null,2),me("div",{class:te(X.$style["loading-skeleton"])},null,2)],2)),64))]):Xe("",!0),ae.value===2?(K(),ie("div",{key:1,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty",{query:a.value},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[2]||(N[2]=[me("div",null,[Qe(" No results. "),me("br"),Qe(" Try another search. ")],-1)])],2)])],2)):Xe("",!0),ae.value===3?(K(),ie("div",{key:2,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty-list",{},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[3]||(N[3]=[me("div",null,"No items available.",-1)])],2)])],2)):Xe("",!0),Dt(X.$slots,"footer")],2)],14,AZ))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Gu=st({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=C3,n=e,o=V(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=V(s());tt(()=>n,()=>{setTimeout(()=>{vt(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=q(()=>un.getInstance().getItem("user.ws_user_role_id")),a=q(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,c)=>Ke((K(),Ue(Gh,RH(pT(a.value)),null,16)),[[H(t),r.value]])}}),NZ={class:"avatar-wrapper"},LZ={class:"assignee-label"},wA=Ct(st({__name:"AssigneeItem",props:{user:{},hover:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Yt,o=e,s=q(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=bg(),i=q(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const c=u=>{u.forEach(d=>{d.type===It&&Array.isArray(d.children)?c(d.children):d.type!==Yn&&d.type!==Fa&&l++})};return c(r.actions()),l}),a=V(!1);return(l,c)=>(K(),ie("div",{class:te(["assignee-selector-item",{hovered:a.value||o.hover,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:cn({"--actions-count":i.value}),onMouseenter:c[0]||(c[0]=u=>a.value=!0),onMouseleave:c[1]||(c[1]=u=>a.value=!1)},[me("div",NZ,[ue(Gu,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(K(),ie("div",{key:0,class:te(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(K(),Ue(lt,{key:0,src:"CircleXMark"})):(K(),Ue(lt,{key:1,src:"CirclePlus"}))],2)):Xe("",!0)]),Ke((K(),ie("div",LZ,[Dt(l.$slots,"name",{},()=>[Qe(ht(o.user.name),1)],!0)])),[[H(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hover||o.focused?Dt(l.$slots,"actions",{key:0},void 0,!0):Xe("",!0)],38))}}),[["__scopeId","data-v-dbfbcc0c"]]),VZ={class:"unassign-icon"},_S=Ct(st({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(K(),Ue(H(at),{variant:"menu-item",onClick:o,actived:e.actived,style:cn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:he(()=>[me("div",VZ,[Dt(s.$slots,"icon",{},()=>[r[0]||(r[0]=me("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[me("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:he(()=>[Dt(s.$slots,"label",{},()=>[Qe(ht(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),BZ=["innerHTML"],CA=20,bA=Ct(st({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,{id:r}=ag(s),i=n,a=ne=>{var ve,we;const pe=(we=(ve=s.params)==null?void 0:ve.api)==null?void 0:we.getRowNode(String(r.value));pe==null||pe.setDataValue("assignees",rb(ne.assignees)),z("updated",ne)},l=V(!1),c=V(!1),u=V(null),d=V(1),h=V(!0),f=V(0),p=V(""),g=yn("bulkUpdate",V(!1)),v=yn("isSelectAll",V(!1)),w=q(()=>{var ne;return g.value&&v.value?[]:(ne=s.ids)!=null&&ne.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:C,assigneeList:_,mergedOptions:E,selectedUserIds:I}=Om({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{z("update-failed")}},w),{apiServices:T}=Zn(!g.value,s),P=yn("workspaceId"),M=async(ne=1,pe="",ve=!1)=>{var re,U,ge,oe,Re,G;if(!T.value)throw console.error("API service or item identifiers are undefined",T.value),new Error("API service or item identifiers are undefined");if(ve?c.value=!0:l.value=!0,u.value=null,!((re=T.value)!=null&&re.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const we=(s.ids??(s.id?[s.id]:[])).map(String);try{let Y;we.length==0?Y=await((U=T.value)==null?void 0:U.getEntityUserRoles({workspaceId:String(P),page:ne,per_page:CA,display_name_like:pe.trim(),entity_ids:String(s.entityId)})):Y=await((ge=T.value)==null?void 0:ge.multipleAssignableUser({workspaceId:String(P),itemIds:we,page:ne,perPage:CA,q:pe.trim(),entityId:String(s.entityId)}));const de=((oe=Pu(Y.data))==null?void 0:oe.map(Am))??[];_.value=ve?vu(_.value,de,"id"):de,f.value=Y.meta.total,h.value=(((Re=Y==null?void 0:Y.meta)==null?void 0:Re.current_page)||0)<(((G=Y==null?void 0:Y.meta)==null?void 0:G.last_page)||0),d.value=ne}catch(Y){console.error("Error fetching assignable users:",Y),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},D=()=>{!c.value&&h.value&&M(d.value+1,p.value,!0)},F=xr(async ne=>{p.value=ne,await M(1,ne,!1)},li),O=()=>M(1,p.value,!1);Qt(()=>{var ne;(ne=x.value)==null||ne.focus()}),t({getValue:()=>{var ne;return(ne=E.value.find(pe=>pe.selected))==null?void 0:ne.value},refresh:O,clearInternal:()=>{I.value=[]},focus:()=>{var ne;(ne=x.value)==null||ne.focus()}});const k=()=>{const ne=un.getInstance().getItem("BASE_URL"),pe=es({type:"access_setting",config:{baseDomain:ne,ws_code:s.workspaceId,entity_id:P}}).url;window.open(pe,"_blank")},x=V(null);Qt(()=>{vt(()=>{var ne;(ne=x.value)==null||ne.focus()})}),tt([()=>s.id,()=>s.workspaceId],()=>{M()},{deep:!0,immediate:!0});const $=ne=>{var ve;const pe=un.getInstance().getItem("ws.code");return((ve=T.value)==null?void 0:ve.getUserInformation(pe,ne))||Promise.resolve(null)},W=async(ne,pe,ve)=>{pe.preventDefault(),pe.stopPropagation(),pe.stopImmediatePropagation(),z("update-start");try{if(await C(ne))z("update-completed");else throw new Error("Failed to update assignees")}catch(we){z("update-failed"),console.error("Error updating assignees:",we)}},Q=async()=>{try{if(z("update-start"),await S())z("update-completed");else throw new Error("Failed to unassign all assignees")}catch(ne){z("update-failed"),console.error("Error unassigning all assignees:",ne)}finally{}},ae=async ne=>{try{if(z("update-start"),await b(ne))z("update-completed");else throw new Error("Failed to replace assignees")}catch(pe){z("update-failed"),console.error("Error replacing assignees:",pe)}finally{}},ee=()=>{var ne,pe;i("cancel"),(pe=(ne=s.params)==null?void 0:ne.api)==null||pe.stopEditing()};Jr("popupAttachRef",x);const X=V(),N=V(!1),z=(ne,pe)=>{switch(ne){case"updated":i("updated",pe);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed");break}};return Qt(()=>{vt(()=>{setTimeout(()=>{N.value=!0},50)})}),(ne,pe)=>(K(),ie("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:X},[ue(na,Wt({"selected-id":H(I)},{...s},{options:H(E),loading:l.value,ref_key:"popupRef",ref:x,"loading-more":c.value,"has-more":h.value,onSelect:pe[0]||(pe[0]=(ve,we)=>{W(ve,we)}),"data-wrapper":"true",onSearch:H(F),onLoadMore:D,onCancel:ee,onClose:ee}),tu({"extra-item":he(({isEmpty:ve,isLoading:we})=>[!ve&&!we?(K(),Ue(_S,{key:0,onClick:Q,actived:!1,label:"Unassign"},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})):Xe("",!0)]),item:he(({item:ve,selectedIndex:we,isSelected:re,handleItemHover:U,getHighlightedLabel:ge,query:oe,idx:Re,focused:G})=>[ue(wA,{user:ve.data,"multiple-select":!0,"append-to":X.value,isMe:!1,hover:Re===we,selected:re(ve),focused:G,onClick:kt(Y=>W(ve,Y,"click"),["stop","prevent"]),onMouseover:Y=>U(Re),"api-update-function":$},{name:he(()=>[oe?Ke((K(),ie("span",{key:0,class:te([ne.$style["item-label"],ne.$style.match]),style:{flex:"1"},innerHTML:ge(ve.label)},null,10,BZ)),[[H(o),{content:ve.label}]]):Ke((K(),ie("span",{key:1,class:te(ne.$style["item-label"]),style:{flex:"1"}},[Qe(ht(ve.label),1)],2)),[[H(o),{content:ve.label}]])]),actions:he(()=>[Ke((K(),Ue(at,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:kt(Y=>{var de;return ae((de=ve.data)==null?void 0:de.id)},["stop"])},{default:he(()=>[ue(lt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[H(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":he(()=>[me("div",{class:te(ne.$style["empty-state"])},[pe[3]||(pe[3]=Qe(" No assignee available. ",-1)),pe[4]||(pe[4]=me("br",null,null,-1)),ue(at,{onClick:k,variant:["tertiary"],size:"small"},{default:he(()=>[...pe[2]||(pe[2]=[Qe(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:he(()=>[me("div",{class:te(ne.$style["error-message"])},[Qe(ht(u.value)+" ",1),ue(at,{onClick:O,size:"small"},{default:he(()=>[...pe[1]||(pe[1]=[Qe(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),$Z={key:0,class:"inner"},yf=Ct(st({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=V(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:c,show:u}=yo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=V(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=ds({isShow:!1,isRender:!1});Qt(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.addEventListener("keydown",h)}),qn(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,w)=>{f.isShow=v,f.isRender=w};return tt(()=>a.value,(v,w)=>{v&&v!==w&&vt(()=>{g(!0,!0)}),p("onVisibleChange",v,w)}),t({hide:()=>{l(),g(!1,!0)},isVisible:a,open:()=>{u(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,w)=>(K(),ie("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[me("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[Dt(v.$slots,"trigger",{isVisible:H(a),hide:H(l),disabled:o.isUpdating||o.disabled,popupRef:H(i),triggerRef:H(r),toggle:H(c)},void 0,!0)],512),me("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?Ke((K(),ie("div",$Z,[Dt(v.$slots,"popup",{isVisible:H(a),hide:H(l),popupRef:H(i),triggerRef:H(r),toggle:H(c),open:H(u)},void 0,!0)],512)),[[Ks,!o.isUpdating&&!o.disabled&&f.isShow]]):Xe("",!0)],512)],512))}}),[["__scopeId","data-v-aab33e10"]]),HZ=st({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;Jr("bulkUpdate",!0);const o=V(!1),s=t,r=V(null),i=()=>{var d;(d=l.value)==null||d.hide(),o.value=!0,s("update-start")},a=d=>{var h,f;o.value=!1,d?(s("update-completed"),(h=l.value)==null||h.destroy()):(s("update-failed"),(f=l.value)==null||f.open())},l=V(null),c=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},u=(d,h)=>{vt(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return tt(()=>n.ids,()=>{vt(()=>{var d;(d=l.value)==null||d.destroy()})}),(d,h)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:u},{trigger:he(({hide:f,disabled:p})=>[ue(at,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:he(()=>[ue(lt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=Qe(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({hide:f})=>[ue(bA,Wt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:c,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0)),onCancel:f}),null,16,["ids","onCancel"])]),default:he(()=>[h[3]||(h[3]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),wf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],GZ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),qa=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=wf.indexOf(l);const u=i?-1:1;for(const d of wf){c=(c+u+wf.length)%wf.length;const h=wf[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(GZ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},UZ=["aria-label"],WZ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],zZ={style:{flex:"1"}},jZ=Ct(st({__name:"MainCalendar",props:LD({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:LD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Yt,s=V(null),r=e,i=q(()=>r.startDate&&r.endDate),a=rU(e,"tracingCase"),l=n,c=V(r.year),u=V(r.month);tt(()=>[r.year,r.month],([N,z])=>{c.value=N,u.value=z});const d=q(()=>bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=q(()=>bt.now().setZone(r.timezone)),f=q(()=>r.startDate?bt.fromJSDate(r.startDate,{zone:r.timezone}):null),p=q(()=>r.endDate?bt.fromJSDate(r.endDate,{zone:r.timezone}):null),g=V(f.value),v=V(p.value),w=V(f.value),S=V(p.value);tt([f,p],()=>{r.requireConfirm||(g.value=f.value,v.value=p.value,w.value=f.value,S.value=p.value)},{immediate:!0});const b=q(()=>r.requireConfirm?g.value:f.value),C=q(()=>r.requireConfirm?v.value:p.value);tt(()=>r.activeField,N=>{const z=N==="start"?b.value:C.value;z&&(c.value=z.year,u.value=z.month)}),tt(()=>{var N,z;return[(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate(),r.activeField]},()=>{const N=r.activeField==="start"?b.value:C.value;N&&(N.year!==c.value||N.month!==u.value)&&(c.value=N.year,u.value=N.month)});function _(N){return N.setZone("utc")}const E=V("");function I(N){E.value=N.toISODate()||"",vt(()=>{const z=document.querySelector(`.arbo-calendar-day[data-date="${E.value}"]`);z==null||z.focus()})}tt(()=>{var N,z;return[c.value,u.value,r.activeField,(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate()]},()=>{const N=r.activeField==="start"?b.value:C.value;let z;N&&N.year===c.value&&N.month===u.value?z=N:b.value&&b.value.year===c.value&&b.value.month===u.value?z=b.value:z=h.value,I(z)});function T(N){return N.toFormat("d")}const P=q(()=>{const N=bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}),z=N.weekday,ne=r.weekStart===1?(z+6)%7:z%7;let pe=N.minus({days:ne});const ve=[],we=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),re=Og();for(let ge=0;ge<42;ge++){const oe=[];pe.month!==u.value&&oe.push(re["is-outside"]),pe.hasSame(h.value,"day")&&oe.push(re["is-today"]),b.value&&pe.hasSame(b.value,"day")&&oe.push(re["is-selected-start"]),C.value&&pe.hasSame(C.value,"day")&&oe.push(re["is-selected-end"]),b.value&&C.value&&pe>b.value&&pe<C.value&&oe.push(re["is-in-range"]);const Re=T(pe),G=we[pe.weekday-1]||"";ve.push({dt:pe,iso:pe.toISODate()||"",label:pe.toFormat("d"),displayLabel:Re,weekdayLabel:G,aria:pe.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:oe}),pe=pe.plus({days:1})}const U=[];for(let ge=0;ge<6;ge++)U.push(ve.slice(ge*7,ge*7+7));return U}),M=q(()=>{const N=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?N:[N[6],...N.slice(0,6)]});function D(N,z,ne){const pe=N==="start"?z.startOf("day"):z.endOf("day"),ve=_(pe),we={year:pe.year,month:pe.month,day:pe.day,utc:ve.toISO()||""};N==="start"?(l("select-start",we,ne??!0),l("select-start-utc",we.utc)):(l("select-end",we),l("select-end-utc",we.utc))}function F(N){let z=c.value,ne=u.value+N;for(;ne<1;)ne+=12,z-=1;for(;ne>12;)ne-=12,z+=1;c.value=z,u.value=ne,l("update:year",z),l("update:month",ne)}function O(N){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).plus({days:N});ne.month===u.value&&ne.year===c.value&&I(ne)}function k(N=!1){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).weekday%7,pe=N?6-ne:-ne;O(pe)}const x=N=>{$(N)};function $(N){switch(N.preventDefault(),N.stopPropagation(),N.key){case"ArrowLeft":N.preventDefault(),O(-1);break;case"ArrowRight":N.preventDefault(),O(1);break;case"ArrowUp":N.preventDefault(),O(-7);break;case"ArrowDown":N.preventDefault(),O(7);break;case"Home":N.preventDefault(),k(!1);break;case"End":N.preventDefault(),k(!0);break;case"PageUp":N.preventDefault(),F(N.shiftKey?-12:-1);break;case"PageDown":N.preventDefault(),F(N.shiftKey?12:1);break;case"Enter":case" ":{N.preventDefault();const z=E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value,ne=P.value.flat().find(pe=>pe.iso===z.toISODate());ne&&Q(ne);break}}}const W=N=>{const z=bt.now().setZone(r.timezone);c.value=z.year,u.value=z.month,l("update:year",z.year),l("update:month",z.month),I(z),l("gotoToday")};function Q(N){var de,ke;const z=!!f.value,ne=!!p.value,pe=r.activeField,ve=((de=f.value)==null?void 0:de.toISODate())||"null",we=((ke=p.value)==null?void 0:ke.toISODate())||"null",re=N.dt.toISODate()||"",U=(xe,Ve)=>{a.value={case:xe,behavior:Ve}},ge=()=>`Selected start ${re} > existing end ${we} -> reset both to ${re}`,oe=()=>`Selected end ${re} < existing start ${ve} -> reset both to ${re}`,Re=()=>{D("start",N.dt,!0),D("end",N.dt),l("update:activeField","end")},G=(xe=!1)=>{D("start",N.dt,xe),xe&&l("update:activeField","end")},Y=(xe=!1)=>{D("end",N.dt),xe&&l("close")};if(z&&ne){pe==="start"?p.value&&N.dt>p.value?(Re(),U("INVERT_RANGE_FROM_START",ge())):(G(!1),U("UPDATE_START_IN_RANGE",`Updated start from ${ve} to ${re}; end remains ${we}`)):f.value&&N.dt<f.value?(Re(),U("INVERT_RANGE_FROM_END",oe())):(Y(!1),U("UPDATE_END_IN_RANGE",`Updated end from ${we} to ${re}; start remains ${ve}`));return}if(!z&&ne&&pe==="start"&&p.value&&N.dt>p.value){Re(),U("CREATE_RANGE_FROM_LATE_START",ge());return}if(z&&!ne&&pe==="end"&&f.value&&N.dt<f.value){Re(),U("CREATE_RANGE_FROM_EARLY_END",oe());return}if(!z&&!ne){if(pe==="start"){G(!0),U("INIT_START",`Picked start ${re}; awaiting end selection`);return}Y(r.immediatelyUpdate),U("INIT_END",`Picked end ${re}; awaiting start selection`);return}if(!z&&ne){if(pe==="start"){G(!0),U("FILL_MISSING_START",`Inserted start ${re}; existing end ${we}`);return}Y(!1),U("STRICT_UPDATE_END_ONLY",`Updated end to ${re}; start still null`);return}if(z&&!ne){if(pe==="start"){G(!0),U("RESELECT_START_BEFORE_END",`Replaced start with ${re}; end still null, switching to end`);return}Y(r.immediatelyUpdate),U("FILL_MISSING_END",`Picked end ${re}; start ${ve}`);return}}function ae(){w.value=g.value,S.value=v.value,l("confirm")}function ee(){g.value=w.value,v.value=S.value,l("cancel")}function X(){vt(()=>{var N;(N=s.value)==null||N.focus()})}return Qt(()=>{X()}),t({focus:X}),(N,z)=>(K(),ie("div",{ref_key:"calendarRef",ref:s,class:te([N.$style["arbo-calendar"],{[N.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[me("div",{class:te([N.$style["arbo-calendar-header"],N.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ie(It,null,Fn(M.value,ne=>(K(),ie("div",{key:ne,class:te(N.$style["arbo-calendar-weekday"]),role:"columnheader"},ht(ne),3))),128))],2),me("div",{class:te(N.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:z[0]||(z[0]=kt(ne=>H(qa)(ne,x),["prevent","stop"]))},[(K(!0),ie(It,null,Fn(P.value,(ne,pe)=>(K(),ie("div",{key:pe,class:te(N.$style["arbo-calendar-week"])},[(K(!0),ie(It,null,Fn(ne,ve=>(K(),ie("div",{key:ve.iso,class:te([N.$style["arbo-calendar-day"],ve.classes,{[N.$style["is-focused"]]:ve.iso===E.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":ve.aria,"data-date":ve.iso,"data-weekday":ve.weekdayLabel,tabindex:ve.iso===E.value?0:-1,onClick:we=>Q(ve)},ht(ve.displayLabel),11,WZ))),128))],2))),128))],34),r.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:te(N.$style["arbo-calendar-actions"])},[me("div",zZ,[Ke((K(),Ue(at,{variant:"secondary",size:"medium",onClick:z[1]||(z[1]=ne=>W()),onKeydown:H(qa),"data-index":"today-btn"},{prefix:he(()=>[ue(lt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[H(o),"Today"]])]),ue(at,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:H(qa),variant:"secondary",size:"medium",onClick:ee,"data-index":"cancel-btn"},{default:he(()=>[Qe(ht(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ue(at,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:H(qa),onClick:ae},{default:he(()=>[Qe(ht(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,UZ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:"_cancel_99b61_156",confirm:"_confirm_99b61_161"}}]]),KZ=["onClick"],qZ=["variant","onClick"],YZ=Ct(st({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=q(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const O=o.locale||"en-US",k=o.monthLabelStyle||"short",x=new Intl.DateTimeFormat(O,{month:k,timeZone:"UTC"});return Array.from({length:12},(W,Q)=>x.format(new Date(Date.UTC(2020,Q,1))))}),r=n,i=V(o.year),a=V(o.month),l=V(o.year);tt(()=>o.year,O=>{O!==i.value&&(i.value=O,l.value=O)}),tt(()=>o.month,O=>{O!==a.value&&(a.value=O)});const c=V("days");function u(O){c.value!==O&&(c.value=O,r("mode-change",O))}const d=q(()=>o.minYear),h=q(()=>o.maxYear),f=q(()=>{const O=o.yearSpan;return l.value-l.value%O}),p=q(()=>f.value+o.yearSpan-1);function g(){const O=o.yearSpan,k=f.value-O;k>=d.value&&(l.value=k)}function v(){const O=o.yearSpan,k=f.value+O;k<=h.value&&(l.value=k)}const w=q(()=>f.value-o.yearSpan<d.value),S=q(()=>p.value+o.yearSpan>h.value),b=q(()=>{const O=o.yearSpan;return Math.ceil(O/3)});function C(O){const x=f.value+(O-1)*3;return Array.from({length:3},($,W)=>x+W).filter($=>$<=p.value)}function _(){c.value==="months"?u("days"):u("months")}function E(){c.value==="years"?u("days"):u("years")}function I(O){i.value=O,l.value=O,r("update:year",O),r("year-selected",O),u("months")}function T(O){a.value=O,r("update:month",O),r("month-selected",O),u("days")}function P(){if(c.value==="days"){let O=i.value,k=a.value-1;if(k<1&&(k=12,O--),O<d.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else c.value==="years"&&g()}function M(){if(c.value==="days"){let O=i.value,k=a.value+1;if(k>12&&(k=1,O++),O>h.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else c.value==="years"&&v()}const D=q(()=>c.value==="days"?i.value===d.value&&a.value===1:c.value==="months"?i.value-1<d.value:w.value),F=q(()=>c.value==="days"?i.value===h.value&&a.value===12:c.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(O,k)=>{i.value=O,a.value=k}}),(O,k)=>(K(),ie("div",{class:te([O.$style["cal-nav-wrapper"]])},[Dt(O.$slots,"selection"),c.value==="days"?(K(),ie("div",{key:0,class:te(O.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:P,"data-index":"prev-btn",onKeydownCapture:jn(kt(P,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),me("div",{class:te(O.$style["cal-nav-center"])},[ue(at,{"data-index":"month-btn",variant:"secondary",onClick:_,onKeydown:H(qa)},{default:he(()=>[Qe(ht(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ue(at,{variant:"secondary",onClick:E,"data-index":"year-btn",onKeydown:H(qa)},{default:he(()=>[Qe(ht(i.value),1)]),_:1},8,["onKeydown"])],2),ue(at,{"data-index":"next-btn",variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:F.value,label:"",onClick:M,onKeydownCapture:jn(kt(M,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Xe("",!0),c.value==="years"?(K(),ie("div",{key:1,class:te(O.$style["year-grid"])},[me("div",{class:te(O.$style["year-grid-header"])},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),me("div",{class:te(O.$style["range-label"])},ht(f.value)+" - "+ht(p.value),3),ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),me("div",{class:te(O.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ie(It,null,Fn(b.value,x=>(K(),ie("div",{key:"yr-row-"+x,class:te(O.$style["year-grid-row"])},[(K(!0),ie(It,null,Fn(C(x),$=>(K(),ie("a",{key:$,tabindex:"0",class:te([O.$style["year-cell"],{[O.$style.selected]:$===i.value}]),onClick:W=>I($)},ht($),11,KZ))),128))],2))),128))],2)],2)):c.value==="months"?(K(),ie("div",{key:2,class:te(O.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[me("div",{class:te(O.$style.months)},[(K(!0),ie(It,null,Fn(s.value,(x,$)=>(K(),ie("a",{tabindex:"0",key:x,variant:$+1===a.value?"primary":"text",class:te([O.$style["month-cell"],{[O.$style.selected]:$+1===a.value}]),onClick:W=>T($+1)},ht(x),11,qZ))),128))],2)],2)):(K(),ie("div",{key:3,class:te(O.$style["days-slot"])},[Dt(O.$slots,"default",{year:i.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function ZZ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=V(""),i=q(()=>{const g=bt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=q(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const w=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return w<S?-1:w>S?1:0},c=q(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),u=q(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&c.value),d=q(()=>r.value.length===t.length&&u.value);return{inputValue:r,isValid:u,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=bt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>u.value?i.value:null}}const XZ={key:0,style:{marginLeft:"8px"}},JZ=["disabled","readonly","placeholder"],SA=Ct(st({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(null),a=V(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=ZZ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=q(()=>s.active),g=q(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:S}=Co(g),b=T=>{var M;const P=(M=T.clipboardData)==null?void 0:M.getData("text/plain");P&&(u.value=P.trim())},C=T=>{if(T.key==="Escape"){r("blur"),T.target.blur(),T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation();return}else T.key==="Tab"&&I(T)},_=()=>{d(),r("clear")};t({clear:_,setDate:h,getDate:f,focus:()=>{var T;return(T=i.value)==null?void 0:T.focus()}}),tt(()=>s.modelValue,T=>{T?h(T):d()},{immediate:!0}),tt([()=>c.value,()=>u.value],()=>{if(u.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const T=f();(T||u.value.length===0)&&r("complete",T)}}),tt(()=>l.value,T=>{T||r("invalid","")});const E=q(()=>!!s.isMultipleDate),I=T=>{T.preventDefault(),T.stopImmediatePropagation(),T.stopPropagation(),r("tab",T)};return(T,P)=>(K(),Ue(_o,Wt(H(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:he(()=>[me("div",{class:te([T.$style["date-input-wrapper"]])},[E.value?(K(),ie("span",XZ," Multiple ")):Ke((K(),ie("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":P[0]||(P[0]=M=>mn(u)?u.value=M:null),onPaste:kt(b,["prevent"]),placeholder:s.placeholder,class:te([T.$style["date-input"]]),onKeydown:C},null,42,JZ)),[[QT,H(u)]]),Dt(T.$slots,"clear",{handleClear:_},()=>[(H(u).length>0||E.value)&&!s.readOnly&&!s.disabled&&(H(w)||H(S))?Ke((K(),Ue(at,{key:0,variant:["icon","primary"],onClick:kt(_,["stop"]),size:16,rounded:!0},{default:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[H(o),"Clear"]]):(K(),Ue(lt,{key:1,src:"Calendar",source:"remote",class:te(T.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),QZ=st({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:Hb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=V({case:"",behavior:""}),s=e,r=V(null),i=n,a=async(U,ge)=>{i("start-update"),await U(),i("finish-update"),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},l=(U,ge)=>{U(),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},c=()=>{var ge;const U=bt.now().setZone(s.timezone);z.value=U.year,ne.value=U.month,(ge=N.value)==null||ge.setNavigation(U.year,U.month)},u=ds({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:w,beginInteraction:S,clearStart:b,clearDue:C}=L7(s,i),_=q(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});tt(()=>s.multipleStartDates,U=>{h.value=!!U},{immediate:!0}),tt(()=>s.multipleDueDates,U=>{f.value=!!U},{immediate:!0});const E=V(null),I=V(null),T=U=>{U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),ae()},P=()=>{var U;(U=I.value)==null||U.focus()},M=U=>{if(!U){u.start=!1,b();return}const ge=d.endDate?bt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(ge&&D(U,ge)>0){const Re={year:U.year,month:U.month,day:U.day};u.start=!1,w(Re,!1),p(Re),vt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.start=!1,w(oe,!0)},D=(U,ge)=>{const oe=U.startOf("day"),Re=ge.startOf("day");return oe<Re?-1:oe>Re?1:0},F=U=>{var ge;U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),(ge=document.querySelector('[data-index="prev-btn"]'))==null||ge.focus()},O=U=>{if(!U){u.end=!1,C();return}const ge=d.startDate?bt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(ge&&D(U,ge)<0){const Re={year:U.year,month:U.month,day:U.day};u.end=!1,w(Re),p(Re),vt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.end=!1,p(oe)},k=()=>{h.value=!1,b()},x=()=>{f.value=!1,C()},$=()=>{ee()},W=q(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,vt(()=>{var U;(U=r.value)==null||U.focus()}))}function ae(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,vt(()=>{var U;(U=E.value)==null||U.focus()}))}function ee(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function X(U){U.key==="Escape"?(U.stopPropagation(),ee()):U.key=="Tab"&&i("tab",U)}const N=V(null),z=V(new Date().getFullYear()),ne=V(new Date().getMonth()+1);tt(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(z.value=d.startDate.getFullYear(),ne.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(z.value=d.endDate.getFullYear(),ne.value=d.endDate.getMonth()+1)},{immediate:!0});const pe=V(null);function ve(){if(Array.isArray(s.value)){const[ge,oe]=s.value;d.startDate=ge||null,d.endDate=oe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const U=d.startDate||d.endDate||new Date;z.value=U.getFullYear(),ne.value=U.getMonth()+1}tt(()=>{var U,ge,oe,Re,G,Y,de,ke;return[((oe=(ge=(U=s.value)==null?void 0:U[0])==null?void 0:ge.getTime)==null?void 0:oe.call(ge))||((Re=s.value)==null?void 0:Re[0]),((de=(Y=(G=s.value)==null?void 0:G[1])==null?void 0:Y.getTime)==null?void 0:de.call(Y))||((ke=s.value)==null?void 0:ke[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:Q,openEnd:ae,closePicker:ee,clearAll:$,isOpen:W,drpRef:pe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():ae():Q()}});const re=V(null);return tt(()=>W.value,U=>{if(s.disabled||s.readOnly)return;const ge=re.value;ge&&(U?ge.show():ge.hide())},{immediate:!0}),(U,ge)=>(K(),ie("div",{class:te(U.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:I,onKeydown:X,tabindex:"1","data-index":"calendar-wrapper"},[ue(YZ,{year:z.value,"onUpdate:year":ge[6]||(ge[6]=oe=>z.value=oe),month:ne.value,"onUpdate:month":ge[7]||(ge[7]=oe=>ne.value=oe),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:N},{selection:he(()=>[me("div",{class:te(U.$style["calendar-input-section"])},[ue(SA,{ref_key:"starDateRef",ref:r,"model-value":H(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:H(d).isSelectingStart,onClick:Q,onClear:k,onComplete:M,onInvalid:ge[0]||(ge[0]=oe=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:P,onTab:T},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ue(SA,{ref_key:"endDateRef",ref:E,"model-value":H(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:H(d).isSelectingEnd,onClick:ae,onClear:x,disabled:s.disabled,onComplete:O,onInvalid:ge[1]||(ge[1]=oe=>u.end=!0),readOnly:s.readOnly,isMultipleDate:H(f),onTab:F},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:he(({year:oe,month:Re})=>[ue(jZ,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:pe,"tracing-case":o.value,"onUpdate:tracingCase":ge[2]||(ge[2]=G=>o.value=G),year:oe,month:Re,"start-date":H(d).startDate,"end-date":H(d).endDate,"active-field":_.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:H(w),onSelectEnd:H(p),onGotoToday:c,onConfirm:ge[3]||(ge[3]=()=>{a(H(v),ee)}),onCancel:ge[4]||(ge[4]=G=>l(H(g),ee)),onClose:ge[5]||(ge[5]=G=>a(H(v),ee))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Ym=Ct(QZ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_139py_1","calendar-input-section":"_calendar-input-section_139py_11","display-wrapper":"_display-wrapper_139py_19","calendar-actions":"_calendar-actions_139py_23","clear-all-btn":"_clear-all-btn_139py_29"}}]]),eX=st({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=yn("isSelectAll",V(!1)),r=yn("bulkUpdate",V(!1)),i=q(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=Zn(!r.value,o),l=yn("filterParams",null),c=V(null),u=async T=>{var P,M,D,F;try{C.value=!0,n("update-start");let O={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in T&&(O.startDate=T.start?km(T.start):null),"end"in T&&(O.dueDate=T.end?km(T.end):null),i.value?(O.itemIds=void 0,O.entityId=o.entityId):O.entityId=void 0,await((M=(P=a.value)==null?void 0:P.changeDate)==null?void 0:M.call(P,O)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:O}),n("update-completed"),(D=c.value)==null||D.hide()}catch(O){console.error("Failed to update dates:",O),vt(()=>{vt(()=>{var k;n("update-failed"),(k=c.value)==null||k.open()})})}finally{(F=S.value)==null||F.resetCalendarLogic(),C.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{w.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const P=o.rowSelected[0].dateRange;b.value=[(P==null?void 0:P[0])??null,(P==null?void 0:P[1])??null],w.value=!1,v.value=!1},p=()=>{var P,M;if(o.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=g(0),F=g(1);if(v.value=D,w.value=F,D)b.value[0]=null;else{const O=((P=o.rowSelected[0].dateRange)==null?void 0:P[0])??null;b.value[0]=O}if(F)b.value[1]=null;else{const O=((M=o.rowSelected[0].dateRange)==null?void 0:M[1])??null;b.value[1]=O}}else v.value=!1,w.value=!1,b.value=[null,null]},g=T=>{const P=o.rowSelected.map(D=>{var F;return(F=D.dateRange)==null?void 0:F[T]});return P.length===0?!1:new Set(P.map(D=>{var F;return(F=D==null?void 0:D.getTime)==null?void 0:F.call(D)})).size>1},v=V(!1),w=V(!1),S=V(null),b=V([null,null]);tt([()=>o.ids,()=>o.rowSelected],T=>{d(),vt(()=>{var P;(P=S.value)==null||P.focus()})},{immediate:!0,deep:!0});const C=V(!1),_=()=>{C.value=!0},E=()=>{vt(()=>{setTimeout(()=>{C.value=!1},500)})},I=(T,P)=>{T&&vt(()=>{var M;(M=S.value)==null||M.focus()})};return(T,P)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:c,isUpdating:C.value,disabled:o.disabled||C.value,onOnVisibleChange:I},{trigger:he(({hide:M,disabled:D})=>[ue(at,{variant:o.variant,loading:C.value,disabled:D,onEscape:M},{default:he(()=>[ue(lt,{src:"Calendar"}),P[0]||(P[0]=Qe(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({isVisible:M,hide:D})=>[M?(K(),Ue(Ym,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:u,ref_key:"calendarRef",ref:S,onClosed:D,onStartUpdate:_,onFinishUpdate:E,multipleDueDates:w.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Xe("",!0)]),default:he(()=>[P[1]||(P[1]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tX=e=>{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"},EA=rc("metricStore",()=>{const e=V();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return tX(o)}}}),nX=["onKeydown"],oX=["width","height","viewBox"],sX=["d"],rX="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",_A=st({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(o.modelValue??0),i=V(null),a=q(()=>{var D;return((D=o.params)==null?void 0:D.size)??24}),l=q(()=>{var D;return((D=o.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=q(()=>{var D;return((D=o.params)==null?void 0:D.iconPath)??rX}),u=q(()=>{var D;return((D=o.params)==null?void 0:D.wrapperTag)??"span"}),d=q(()=>{var D;return o.disabled||((D=o.params)==null?void 0:D.disabled)||!1}),h=q(()=>{var D;return o.readOnly||((D=o.params)==null?void 0:D.readOnly)||!1}),f=q(()=>!d.value&&!h.value),p=q(()=>d.value?"not-allowed":h.value?"default":"pointer");tt(()=>o.modelValue,D=>{typeof D=="number"&&D!==r.value&&(r.value=D)});const g=D=>{var F;return((F=o.params)==null?void 0:F.maxRating)-D+1<=r.value&&!v.value},v=V(!1),w=()=>{v.value=!0},S=()=>{v.value=!1},b=D=>{f.value&&C(D)},C=D=>{var O,k;if(!f.value)return;let F=((O=o.params)==null?void 0:O.maxRating)-D+1;F===r.value&&(F=0),r.value=F,s("update:modelValue",F),s("update",F),s("change",F),(k=o.params)!=null&&k.onUpdate&&o.params.onUpdate(F)},_=D=>{var F;D!==r.value&&(r.value=D,s("update:modelValue",D),s("update",D),s("change",D),(F=o.params)!=null&&F.onUpdate&&o.params.onUpdate(D),E.value=D)},E=V(r.value),I=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),r.value=E.value,s("cancel")},T=D=>{D.preventDefault(),_(r.value),s("handleEnter",r.value)},P=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),_(r.value))},M=()=>{f.value&&(r.value=Math.max(r.value-1,0),_(r.value))};return t({focus:()=>{var D;(D=i.value)==null||D.focus()}}),(D,F)=>(K(),ie("div",{class:te(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[jn(kt(M,["prevent"]),["left"]),jn(kt(P,["prevent"]),["right"]),jn(kt(M,["prevent"]),["down"]),jn(kt(P,["prevent"]),["up"]),jn(kt(T,["prevent"]),["enter"]),jn(kt(T,["prevent"]),["tab"]),jn(kt(I,["prevent"]),["escape"])]},[(K(!0),ie(It,null,Fn(e.params.maxRating,O=>(K(),Ue($w(u.value),{key:O,class:te(["rating-item",{filled:g(O),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-O,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(O),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-O+1,tabindex:-1,onClick:kt(k=>b(O),["prevent","stop"]),onMouseenter:w,onMouseleave:S},{default:he(()=>[Dt(D.$slots,"icon",{index:O,filled:g(O),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:O},()=>[(K(),ie("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[me("path",{d:c.value},null,8,sX)],8,oX))]),Dt(D.$slots,"overlay",{index:O,filled:g(O),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,nX))}}),iX={style:{maxWidth:"180px",lineHeight:"15px"}},aX=["innerHTML"],RA=st({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var w;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(C=>({label:C.name,value:C.name,id:C.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((w=v.restricted_value)==null?void 0:w.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},c=q(()=>l(s.config)),u=V(s.modelValue),d=v=>{u.value=v,r("update:modelValue",v),r("change",v||null)},h=V(c.value),f=V(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(w=>w.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=V(null);return Qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,w)=>(K(),Ue(na,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:w[0]||(w[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:he(({item:S,getHighlightedLabel:b,selectedIndex:C,index:_})=>[ue(ic,{hover:C==_,selected:S.value===e.modelValue,label:S.label,onSelect:E=>d(S.value||null),onClick:E=>d(S.value||null)},{label:he(()=>[me("div",iX,[Ke(me("span",{innerHTML:b(S.label)},null,8,aX),[[H(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":he(()=>[...w[1]||(w[1]=[Qe("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),lX={class:"metric-input-wrapper"},cX={key:0,class:"error-text input-2"},DA=st({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(s.modelValue),i=V(s.modelValue),a=V(!1),l=V(!0),c=V(""),u=q(()=>{var x;const k=Number.parseInt(String((x=s.config)==null?void 0:x.format_value)||"2",10);return Number.isFinite(k)&&k>=0?k:2}),d=k=>{if(!k)return k;const x=String(k).split(".");return x.length>1&&x[1].length>u.value?u.value===0?x[0]:`${x[0]}.${x[1].slice(0,u.value)}`:String(k)},h=k=>{const x=d(k);x!==k&&b.value?r.value=x:r.value=k},f=k=>{const x=k.target;if(!x)return;const $=x.value||"",W=$.indexOf(".");if(k.key==="."&&u.value===0){k.preventDefault();return}W!==-1&&/[0-9]/.test(k.key)&&$.slice(W+1).length>=u.value&&k.preventDefault()},p=q(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var X;const k=s.config.restricted_type.trim(),x=((X=s.config.restricted_value)==null?void 0:X.split(",").map(Number))||[],[$,W]=x,ae={range:`Enter a value between ${$} and ${W}`,not:`These values are not allowed: ${x.join(", ")}`,exact:"Value is not allowed"}[k];return l.value?"":ae},v=q(()=>{var x;let k="";return Number((x=s.config)==null?void 0:x.format_value)&&(k+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${k}`});tt(()=>s.modelValue,k=>{r.value=k,i.value=k});const w=k=>Im(s.config,k),S=n,b=V(null),C=k=>{const x=k===""?null:k,$=i.value===""?null:i.value;return x!==$},_=k=>{const x=d(k);if(!C(x))return!1;const $=x===""?null:x;return r.value=$,i.value=$,S("update:modelValue",$),S("handleChange",$),!0},E=()=>{r.value=i.value,S("update:modelValue",i.value)},I=(k,x)=>{_(k),S("enter")},T=(k,x)=>{if(a.value){a.value=!1;return}s.saveOnBlur?_(k):E()},P=k=>{if(k===null||k===""){l.value=!0;return}l.value=Im(s.config,Number(k)),c.value=l.value?"":g()},M=(k,x)=>{a.value=!0,s.saveOnEscape?_(k):E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},D=k=>{P(k),S("onValidation",k)},F=()=>{a.value=!0,E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},O=()=>{var k;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(k=b.value)==null||k.focus()};return t({focus:()=>{var k;return(k=b.value)==null?void 0:k.focus()},blur:()=>{var k;return(k=b.value)==null?void 0:k.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>_(r.value),revert:E}),Qt(()=>{var k;(k=b.value)==null||k.focus()}),(k,x)=>Ke((K(),ie("div",lX,[ue(SS,{maxDecimalChar:u.value,modelValue:r.value,"onUpdate:modelValue":x[0]||(x[0]=$=>r.value=$),placeholder:v.value,validatorFnc:w,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:I,onBlur:T,onClear:O,onEscape:M,onCancel:F,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ie("span",cX,ht(c.value),1)):Xe("",!0)])),[[H(o),p.value]])}}),uX={key:2},dX={class:"wrapper-suffix"},hX={key:3},fX=Ct(st({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(null),i=V(0),a=V(null),l=V(null),c=q(()=>uP(s.config)),u=V(!1),d=q(()=>!!pe.value),h=n,f=()=>{u.value=!1,ne(),h("cancel")},p=V(!0),g=re=>{if(re===null||re===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=Im(s.config,Number(re)),w.value=S()},v=()=>{u.value=!0,W()},w=V(""),S=()=>{var de;const re=s.config.restricted_type.trim(),U=((de=s.config.restricted_value)==null?void 0:de.split(",").map(Number))||[],[ge,oe]=U,G={range:`Enter a value between ${ge} and ${oe}`,not:`These values are not allowed: ${U.join(", ")}`,exact:"Value is not allowed"}[re];return p.value?"":G},b=q(()=>{var U;const re=Number.parseInt(String((U=s.config)==null?void 0:U.format_value)||"2",10);return Number.isFinite(re)&&re>=0?re:2}),C=re=>{u.value=!0,r.value=re},_=()=>{u.value=!0,ne(),W()},E=re=>{i.value=re,u.value=!0,W()},I=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(U=>U.charAt(0).toUpperCase()+U.slice(1)).join("").replace(/Outline|Solid/g,""),T=V(null),P=V(!0),M=q(()=>{var re;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((re=r.value)==null?void 0:re.length)===0,wrapperRef:N,active:d,focus:s.focus,bordered:!0}}),D=V(null),F=q(()=>P.value),O=q(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:D,active:F,focus:P.value,bordered:!0})),{argsMain:k}=Co(O),{argsMain:x}=Co(M),$=V(null),W=()=>{vt(()=>{var re;(re=$.value)==null||re.focus()})},Q=re=>{var U;if(re.format_type==="dropdown"&&re.format_value)try{const ge=JSON.parse(re.format_value);if(Array.isArray(ge))return ge.map(oe=>({label:oe.name,value:oe.name,id:oe.name}))}catch(ge){console.error("Failed to parse dropdown options",ge)}return re.format_type=="number"&&re.restricted_type=="exact"?((U=re.restricted_value)==null?void 0:U.split(",").map(oe=>({label:re.mapping[`!${oe}`]||oe,value:oe,id:oe})))||[]:[]},ae=q(()=>Q(s.config)),ee=q(()=>{var re;return((re=ae.value.find(U=>U.value===r.value))==null?void 0:re.label)||r.value||"-"}),X=()=>{var re;if(c.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(c.value=="number"){const U=(re=l.value)==null?void 0:re.getValue();h("updateMetric",U||null)}else h("updateMetric",r.value||null);u.value=!1,ne()},{triggerRef:N,popupRef:z,hide:ne,isVisible:pe,show:ve}=yo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),we=()=>{switch(c.value){case"number":vt(()=>{var re;(re=l.value)==null||re.focus()});break;case"dropdown":ve(),vt(()=>{var re;(re=T.value)==null||re.focus()});break;case"rating":P.value=!0,vt(()=>{var re;(re=a.value)==null||re.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,u.value=!1},focus:we,hasChanges:()=>u.value}),Qt(()=>{vt(()=>{setTimeout(()=>{we()},300)})}),(re,U)=>(K(),ie("div",{class:te(re.$style["metric-editor"])},[c.value=="number"?(K(),Ue(DA,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[0]||(U[0]=ge=>r.value=ge),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(K(),Ue(_o,Wt({key:1,"tab-index":1},H(k),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:he(()=>[ue(_A,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":U[1]||(U[1]=ge=>i.value=ge),onHandleEnter:E,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:he(()=>[ue(lt,{source:"rating",src:I()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(K(),ie("div",uX,[ue(_o,Wt(H(x),{ref_key:"triggerRef",ref:N,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:he(({})=>[me("div",dX,[ue(lt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:he(()=>[Ke((K(),ie("span",null,[Qe(ht(ee.value||""),1)])),[[H(o),{content:ee.value}]])]),_:1},16),me("div",{ref_key:"popupRef",ref:z},[H(pe)?(K(),Ue(RA,{key:0,ref_key:"metricEditorDropdownRef",ref:T,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[2]||(U[2]=ge=>r.value=ge),onChange:_,onCancel:f},null,8,["config","modelValue"])):Xe("",!0)],512)])):(K(),ie("span",hX,"Formular")),Ke((K(),Ue(at,{ref_key:"confirmButtonRef",ref:$,onHandleClick:X,"tab-index":"1",onKeypress:[jn(kt(we,["shift","prevent"]),["tab"]),jn(kt(f,["prevent"]),["escape"])],disabled:!p.value},{default:he(()=>[ue(lt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[H(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),pX=Ct(st({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(!1),a=V(null),l=V(null),c=()=>{i.value=!i.value},u=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await vt(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const w={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&u()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];w&&w()};return tt(i,g=>{g&&r("open")}),t({hide:u,show:d}),(g,v)=>(K(),ie("div",{class:te([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[me("div",{class:te(g.$style["metric-label"]),onClick:kt(c,["stop"])},[Dt(g.$slots,"default",{open:i.value},()=>[Ke((K(),ie("span",{class:te(g.$style["metric-name"])},[Qe(ht(e.label),1)],2)),[[H(o),{content:e.label}]]),e.morpheme&&i.value?(K(),ie("small",{key:0,class:te(g.$style["metric-morpheme"])}," ("+ht(e.morpheme)+") ",3)):Xe("",!0)])],2),ue(xT,{mode:"out-in",name:"slide"},{default:he(()=>[i.value?(K(),Ue(fX,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Xe("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var Uu=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(Uu||{});function TA(e,t){return function(){return e.apply(t,arguments)}}const{toString:gX}=Object.prototype,{getPrototypeOf:RS}=Object,{iterator:Zm,toStringTag:IA}=Symbol,Xm=(e=>t=>{const n=gX.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mr=e=>(e=e.toLowerCase(),t=>Xm(t)===e),Jm=e=>t=>typeof t===e,{isArray:Wu}=Array,zu=Jm("undefined");function Cf(e){return e!==null&&!zu(e)&&e.constructor!==null&&!zu(e.constructor)&&ps(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const xA=Mr("ArrayBuffer");function mX(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xA(e.buffer),t}const vX=Jm("string"),ps=Jm("function"),FA=Jm("number"),bf=e=>e!==null&&typeof e=="object",yX=e=>e===!0||e===!1,Qm=e=>{if(Xm(e)!=="object")return!1;const t=RS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(IA in e)&&!(Zm in e)},wX=e=>{if(!bf(e)||Cf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},CX=Mr("Date"),bX=Mr("File"),SX=Mr("Blob"),EX=Mr("FileList"),_X=e=>bf(e)&&ps(e.pipe),RX=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ps(e.append)&&((t=Xm(e))==="formdata"||t==="object"&&ps(e.toString)&&e.toString()==="[object FormData]"))},DX=Mr("URLSearchParams"),[TX,IX,xX,FX]=["ReadableStream","Request","Response","Headers"].map(Mr),PX=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),Wu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Cf(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function PA(e,t){if(Cf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kA=e=>!zu(e)&&e!==ac;function DS(){const{caseless:e,skipUndefined:t}=kA(this)&&this||{},n={},o=(s,r)=>{const i=e&&PA(n,r)||r;Qm(n[i])&&Qm(s)?n[i]=DS(n[i],s):Qm(s)?n[i]=DS({},s):Wu(s)?n[i]=s.slice():(!t||!zu(s))&&(n[i]=s)};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Sf(arguments[s],o);return n}const kX=(e,t,n,{allOwnKeys:o}={})=>(Sf(t,(s,r)=>{n&&ps(s)?e[r]=TA(s,n):e[r]=s},{allOwnKeys:o}),e),AX=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),OX=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},MX=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&RS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},NX=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},LX=e=>{if(!e)return null;if(Wu(e))return e;let t=e.length;if(!FA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},VX=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&RS(Uint8Array)),BX=(e,t)=>{const o=(e&&e[Zm]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},$X=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},HX=Mr("HTMLFormElement"),GX=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),AA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),UX=Mr("RegExp"),OA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Sf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},WX=e=>{OA(e,(t,n)=>{if(ps(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(ps(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zX=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return Wu(e)?o(e):o(String(e).split(t)),n},jX=()=>{},KX=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qX(e){return!!(e&&ps(e.append)&&e[IA]==="FormData"&&e[Zm])}const YX=e=>{const t=new Array(10),n=(o,s)=>{if(bf(o)){if(t.indexOf(o)>=0)return;if(Cf(o))return o;if(!("toJSON"in o)){t[s]=o;const r=Wu(o)?[]:{};return Sf(o,(i,a)=>{const l=n(i,s+1);!zu(l)&&(r[a]=l)}),t[s]=void 0,r}}return o};return n(e,0)},ZX=Mr("AsyncFunction"),XX=e=>e&&(bf(e)||ps(e))&&ps(e.then)&&ps(e.catch),MA=((e,t)=>e?setImmediate:t?((n,o)=>(ac.addEventListener("message",({source:s,data:r})=>{s===ac&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ps(ac.postMessage)),JX=typeof queueMicrotask<"u"?queueMicrotask.bind(ac):typeof J<"u"&&J.nextTick||MA,Be={isArray:Wu,isArrayBuffer:xA,isBuffer:Cf,isFormData:RX,isArrayBufferView:mX,isString:vX,isNumber:FA,isBoolean:yX,isObject:bf,isPlainObject:Qm,isEmptyObject:wX,isReadableStream:TX,isRequest:IX,isResponse:xX,isHeaders:FX,isUndefined:zu,isDate:CX,isFile:bX,isBlob:SX,isRegExp:UX,isFunction:ps,isStream:_X,isURLSearchParams:DX,isTypedArray:VX,isFileList:EX,forEach:Sf,merge:DS,extend:kX,trim:PX,stripBOM:AX,inherits:OX,toFlatObject:MX,kindOf:Xm,kindOfTest:Mr,endsWith:NX,toArray:LX,forEachEntry:BX,matchAll:$X,isHTMLForm:HX,hasOwnProperty:AA,hasOwnProp:AA,reduceDescriptors:OA,freezeMethods:WX,toObjectSet:zX,toCamelCase:GX,noop:jX,toFiniteNumber:KX,findKey:PA,global:ac,isContextDefined:kA,isSpecCompliantForm:qX,toJSONObject:YX,isAsyncFn:ZX,isThenable:XX,setImmediate:MA,asap:JX,isIterable:e=>e!=null&&ps(e[Zm])};function Zt(e,t,n,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}Be.inherits(Zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const NA=Zt.prototype,LA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{LA[e]={value:e}}),Object.defineProperties(Zt,LA),Object.defineProperty(NA,"isAxiosError",{value:!0}),Zt.from=(e,t,n,o,s,r)=>{const i=Object.create(NA);Be.toFlatObject(e,i,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Zt.call(i,a,l,n,o,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",r&&Object.assign(i,r),i};const QX=null;function TS(e){return Be.isPlainObject(e)||Be.isArray(e)}function VA(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function BA(e,t,n){return e?e.concat(t).map(function(s,r){return s=VA(s),!n&&r?"["+s+"]":s}).join(n?".":""):t}function eJ(e){return Be.isArray(e)&&!e.some(TS)}const tJ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function ev(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const o=n.metaTokens,s=n.visitor||u,r=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new Zt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,v){let w=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=o?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&eJ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(w=Be.toArray(p)))return g=VA(g),w.forEach(function(b,C){!(Be.isUndefined(b)||b===null)&&t.append(i===!0?BA([g],C,r):i===null?g:g+"[]",c(b))}),!1}return TS(p)?!0:(t.append(BA(v,g,r),c(p)),!1)}const d=[],h=Object.assign(tJ,{defaultVisitor:u,convertValue:c,isVisitable:TS});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(w,S){(!(Be.isUndefined(w)||w===null)&&s.call(t,w,Be.isString(S)?S.trim():S,g,h))===!0&&f(w,g?g.concat(S):[S])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function $A(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function IS(e,t){this._pairs=[],e&&ev(e,this,t)}const HA=IS.prototype;HA.append=function(t,n){this._pairs.push([t,n])},HA.toString=function(t){const n=t?function(o){return t.call(this,o,$A)}:$A;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function nJ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function GA(e,t,n){if(!t)return e;const o=n&&n.encode||nJ;Be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let r;if(s?r=s(t,n):r=Be.isURLSearchParams(t)?t.toString():new IS(t,n).toString(o),r){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class UA{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(o){o!==null&&t(o)})}}const WA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:IS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xS=typeof window<"u"&&typeof document<"u",FS=typeof navigator=="object"&&navigator||void 0,sJ=xS&&(!FS||["ReactNative","NativeScript","NS"].indexOf(FS.product)<0),rJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iJ=xS&&window.location.href||"http://localhost",zo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xS,hasStandardBrowserEnv:sJ,hasStandardBrowserWebWorkerEnv:rJ,navigator:FS,origin:iJ},Symbol.toStringTag,{value:"Module"})),...oJ};function aJ(e,t){return ev(e,new zo.classes.URLSearchParams,{visitor:function(n,o,s,r){return zo.isNode&&Be.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function lJ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cJ(e){const t={},n=Object.keys(e);let o;const s=n.length;let r;for(o=0;o<s;o++)r=n[o],t[r]=e[r];return t}function zA(e){function t(n,o,s,r){let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&Be.isArray(s)?s.length:i,l?(Be.hasOwnProp(s,i)?s[i]=[s[i],o]:s[i]=o,!a):((!s[i]||!Be.isObject(s[i]))&&(s[i]=[]),t(n,o,s[i],r)&&Be.isArray(s[i])&&(s[i]=cJ(s[i])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(o,s)=>{t(lJ(o),s,n,0)}),n}return null}function uJ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Ef={transitional:WA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,r=Be.isObject(t);if(r&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return s?JSON.stringify(zA(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(o.indexOf("application/x-www-form-urlencoded")>-1)return aJ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ev(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||s?(n.setContentType("application/json",!1),uJ(t)):t}],transformResponse:[function(t){const n=this.transitional||Ef.transitional,o=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(o&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?Zt.from(a,Zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:zo.classes.FormData,Blob:zo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{Ef.headers[e]={}});const dJ=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hJ=e=>{const t={};let n,o,s;return e&&e.split(`
|
|
146
|
+
This will fail in production.`);i=nc,i._s.has(e)||(s?mS(e,t,o,i):gA(e,o,i),J.env.NODE_ENV!=="production"&&(r._pinia=i));const c=i._s.get(e);if(J.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?mS(u,t,o,i,!0):gA(u,sr({},o),i,!0);a._hotUpdate(d),delete i.state.value[u],i._s.delete(u)}if(J.env.NODE_ENV!=="production"&&ea){const u=oo();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return r.$id=e,r}function ns(e){const t=Lt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=q({get:()=>e[o],set(r){e[o]=r}}):(mn(s)||zs(s))&&(n[o]=Yr(e,o))}return n}const vS=rc("permissionStore",()=>{const e=V([]),t=V(),n=V({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),mZ="woohoo_getWoohooUserInterface_read",yS="media_getReviewUserInterface_read",vZ="update_getUpdateUserInterface_read",mA="Unarchive parent folder first to continue",yZ=(e,t,n,o,s,r)=>{const i=vS(),{userPermissions:a}=ns(i),l=q(()=>{const T=un.getInstance().getItem("BASE_URL"),P=un.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:M,entity_id:D,scene_id:F}=e.value;return{baseDomain:T||"",ws_code:M||"",entity_id:D||"",scene_id:F||"",reviewDomain:P||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=q(()=>{var P;const T=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(yS),canCopyLink:!0,canRename:(T==null?void 0:T.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(yS),canOpenTakeInUpdate:a.value.includes(vZ),canOpenTakeInWoohoo:a.value.includes(mZ),canDeleteRendition:((P=T==null?void 0:T.media)==null?void 0:P.has_delete_rendition_permission)??!1,canDeleteThumbnail:(T==null?void 0:T.has_edit_thumbnail_permission)??!1,canArchiveScene:T==null?void 0:T.has_archive_permission,canUnarchiveScene:T==null?void 0:T.has_archive_permission,canDeleteScene:(T==null?void 0:T.has_delete_permission)??!1,canEditDescription:(T==null?void 0:T.has_edit_permission)??!1}}),u=q(()=>({project:es({type:"project",config:l.value}).url,take_review:es({type:"review_take",config:l.value}).url,review:es({type:"review_scene",config:l.value}).url,review_scene:es({type:"review_scene",config:l.value}).url,woohoo:es({type:"woohoo",config:l.value}).url,update:es({type:"update",config:l.value}).url,scene_hub:es({type:"scene_hub",config:l.value}).url})),d=(T,P)=>{const M=T.metaKey||T.ctrlKey,D=u.value[P]||"";if(D){if(P==="scene_hub"){if(M){window.open(D,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}M?window.open(D,"_blank"):window.location.href=D}},h=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete rendition.")}catch(D){console.error("Error deleting rendition",D)}finally{s()}},f=async(T,P)=>{var M;try{await((M=e.value.axiosService.value)==null?void 0:M.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{s()}},p=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to archive scene."),P&&P("archived")}catch(D){console.error("Error archiving item",D)}finally{s()}},g=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete scene."),P&&P("deleted")}catch(D){console.error("Error deleting item",D)}finally{s()}},v=T=>{const P=u.value.scene_hub||"";P&&(_.value="Copied",navigator.clipboard.writeText(P),setTimeout(()=>{_.value="Copy link"},5e3))},w=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to unarchive scene."),P&&P("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{s()}},S=T=>p(T,t),b=T=>w(T,t),C=T=>g(T,t),_=V("Copy link"),E=T=>d(T,"review"),I=q(()=>{let T=[];if(!l.value.scene_id&&e.value.optionBlock&&T.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const P=()=>Math.random().toString(36).substring(2,9);return[{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:E,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:P(),label:_.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?mA:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?mA:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:C,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:w,options:I}};function Co(e){const t=V(!1),n=V(!1),o=q(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,vt(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return Qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",r)),u&&(u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",a))}),qn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",r)),u&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const $u=e=>{const t=V(!1),n=q(()=>t.value);return Qt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},vA=Ct(st({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=Ts,{triggerRef:n,popupRef:o}=yo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=q(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(K(),ie("div",{class:te(i.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[Dt(i.$slots,"default"),Ke(me("div",{class:te(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ks,r.showBadge],[H(t),{isLoading:r.loading,fullwidth:!0}]]),me("div",{ref_key:"popupRef",ref:o,class:te(i.$style["badge-tooltip"])},ht(r.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),mf=rc("switchStore",()=>{const e=V(null),t=yn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),wZ=st({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:Tm()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Yt,o=Ts,s=e,r=t,i={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=V(new Date),l=V(!0),c=V(!1),u=V(!1),d=V(null);let h=null,f=null;const p=mf(),{openPeopleInsight:g}=p,v=q(()=>!s.private&&!c.value),w=q(()=>{var x,$;return((x=d.value)==null?void 0:x.display_name)??(($=s.user)==null?void 0:$.name)}),S=q(()=>{var x,$;return!v.value||!d.value?s.status:(x=d.value.private_info)!=null&&x.is_offline?"offline":($=d.value.private_info)!=null&&$.last_active?"active":"away"}),b=q(()=>{const x=S.value;return x?i[x]:""}),C=q(()=>{var x,$;return(($=(x=d.value)==null?void 0:x.private_info)==null?void 0:$.timezone)??s.timezone}),_=q(()=>{if(!C.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:C.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",C.value),""}}),E=q(()=>{var x,$,W;return{id:s.user.id,name:w.value,initial:((x=d.value)==null?void 0:x.initial)??s.user.initial,profile_image:(($=d.value)==null?void 0:$.profile_image)??s.user.profile_image,color:((W=d.value)==null?void 0:W.color)??s.user.color,size:72,borderRadius:"8px"}}),I=q(()=>{const x=un.getInstance().getItem("BASE_URL"),$=un.getInstance().getItem("ws.code")||"";return es({type:"people_insight",config:{ws_code:$,baseDomain:x,user_id:s.user.id}}).url}),{copyToClipboard:T,tooltip:P}=fP(I.value,()=>r("copyLink",s.user.id)),M=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const x=await s.apiUpdateFunction(s.user.id);x?(d.value=x,r("dataUpdated",x)):(c.value=!0,u.value=!0,r("dataUpdated",null))}catch(x){c.value=!0,u.value=!0,console.error("Failed to fetch user data:",x)}finally{l.value=!1}},D=()=>{F(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(M,s.refreshInterval))},F=()=>{f!==null&&(clearInterval(f),f=null)},O=x=>{var $;if(x.ctrlKey||x.metaKey){window.open(I.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?($=s.switchInstance)==null||$.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(I.value,"_blank")}},k=x=>{O(x),r("insightClick",s.user.id)};return tt([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],D),Qt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await M(),D()):l.value=!1}),Ol(()=>{h&&clearInterval(h),F()}),(x,$)=>s.showPrivateUser&&(s.private||u.value)?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["private-badge"]])},[...$[0]||($[0]=[me("span",null,"Private User",-1)])],2)):(K(),ie("div",{key:1,class:te([x.$style["mini-people-card"],{[x.$style.loading]:l.value},"bg-skeleton"])},[me("div",{class:te(x.$style["avatar-section"])},[v.value?(K(),Ue(vA,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":b.value},{default:he(()=>[ue(Gh,Wt({readOnly:!0},E.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ue(Gh,Wt({key:1,readOnly:!0},E.value),null,16))],2),me("div",{class:te(x.$style["user-info"])},[me("div",{class:te(x.$style["info-column"])},[Ke((K(),ie("span",{class:te(x.$style["user-name"])},[Qe(ht(w.value),1)],2)),[[H(n),{content:w.value,delay:[1e3,0]}]]),C.value&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["time-row"]])},[Ke((K(),ie("div",{class:te(x.$style["time-display"])},[ue(lt,{source:"remote",src:"Globe",class:te(x.$style["clock-icon"]),size:"10"},null,8,["class"]),me("span",{class:te(x.$style["time-text"])},ht(_.value)+" ("+ht(C.value)+")",3)],2)),[[H(o),{isLoading:l.value,fullwidth:!0}]])],2)):Xe("",!0)],2),!e.readOnly&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(K(),Ue(at,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:kt(k,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Xe("",!0),e.showCopyLinkButton?Ke((K(),Ue(at,{key:1,variant:["icon","secondary"],size:"small",onClick:kt(H(T),["prevent","stop"]),disabled:s.disabled},{default:he(()=>[ue(lt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[H(n),{content:H(P),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Xe("",!0)],2)):Xe("",!0)],2)],2))}}),CZ=Ct(wZ,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),bZ=Ct(st({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=ko,o=Yt,s=e,{isEditing:r}=$u(s),i=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=q(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=V();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>Ke((K(),Ue(at,{class:te(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:H(r),onClick:kt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:he(()=>[ue(lt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[H(o),"More actions"],[H(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),SZ=["src","width","height","alt"],Ka=Ct(st({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Ts,{getCachedValue:n,setCachedValue:o}=$h({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=q(()=>({minWidth:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=q(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:u,loading:d}=TI(c,"visual",l,a);return(h,f)=>Ke((K(),ie("div",{class:te([h.$style.visualWrapper,{[h.$style.loading]:H(d)}]),style:cn(i.value)},[me("img",{src:H(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(i.value)},null,12,SZ)],6)),[[H(t),{isLoading:H(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),EZ=["tabindex"],_o=Ct(st({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;bg();const r=Og(),i=V(null),a=V("default"),l=q(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=q(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=q(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var C,_;const g=((C=i.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((_=i.value)==null?void 0:_.querySelectorAll(":scope > .wrapper-suffix").length)||0,w="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${b}))`:!g&&v?`calc(100% - (${v} * ${w} + ${b})) repeat(${v}, ${w})`:g&&v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${v} * ${w} + ${b})) repeat(${v}, ${w})`:"100%"},h=V("100%"),f=()=>{h.value=d()};mh(()=>{f()}),Qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{vt(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(K(),ie("div",{ref_key:"rootEl",ref:i,class:te([H(r)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Dt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Dt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),Dt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,EZ))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_46uq2_1",readOnly:"_readOnly_46uq2_26",bordered:"_bordered_46uq2_29",disabled:"_disabled_46uq2_29",active:"_active_46uq2_29",focused:"_focused_46uq2_29",hovered:"_hovered_46uq2_33",error:"_error_46uq2_37",clickable:"_clickable_46uq2_50",suffix:"_suffix_46uq2_56",prefix:"_prefix_46uq2_57"}}]]),_Z=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const RZ=Object.prototype.toString,DZ=e=>RZ.call(e)==="[object Object]",Hu=()=>{};function TZ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return n}function IZ(e,t={}){let n,o,s=Hu;const r=l=>{clearTimeout(l),s(),s=Hu};let i;return l=>{const c=Hi(e),u=Hi(t.maxWait);return n&&r(n),c<=0||u!==void 0&&u<=0?(o&&(r(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{s=t.rejectOnCancel?h:d,i=l,u&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,d(i())},u)),n=setTimeout(()=>{o&&r(o),o=void 0,d(l())},c)})}}function wS(e){return Array.isArray(e)?e:[e]}function xZ(e,t=200,n={}){return TZ(IZ(t,n),e)}function FZ(e,t,n){return tt(e,t,{...n,immediate:!0})}const yA=_Z?window:void 0;function vf(e){var t;const n=Hi(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function CS(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=q(()=>{const o=wS(Hi(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return FZ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>vf(r)))!==null&&o!==void 0?o:[yA].filter(r=>r!=null),wS(Hi(n.value?e[1]:e[0])),wS(H(n.value?e[2]:e[1])),Hi(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const c=DZ(i)?{...i}:i,u=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function bS(e,t,n={}){const{window:o=yA,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:Hu,cancel:Hu,trigger:Hu}:Hu;let l=!0;const c=v=>Hi(s).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(S=>S===v.target||v.composedPath().includes(S));{const S=vf(w);return S&&(v.target===S||v.composedPath().includes(S))}});function u(v){const w=Hi(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const S=Hi(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(C=>C.el===w.target||w.composedPath().includes(C.el))}const h=v=>{const w=vf(e);if(v.target!=null&&!(!(w instanceof Element)&&u(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[CS(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),CS(o,"pointerdown",v=>{const w=vf(e);l=!c(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),i&&CS(o,"blur",v=>{setTimeout(()=>{var w;const S=vf(e);((w=o.document.activeElement)===null||w===void 0?void 0:w.tagName)==="IFRAME"&&!(S!=null&&S.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const PZ=["value","placeholder","disabled","readonly","inputmode","maxlength"],SS=Ct(st({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const o=ko,s=Yt,r=e,i=n,a=V(null),l=V(r.modelValue||"");tt(l,()=>{i("onValidation",l.value)});const c=V(!1),u=V(r.modelValue||"");tt(()=>r.modelValue,N=>{l.value=N||"",u.value=N||""});const d=q(()=>{var N;return((N=l.value)==null?void 0:N.length)>0}),h={text:N=>N.slice(0,r.maxLength||255),number:N=>{let z=N.replace(/[^\d.-]/g,"");const ne=z.split(".");ne.length>2&&(z=ne[0]+"."+ne.slice(1).join("")),z=z.replace(/-/g,(U,ge)=>ge===0?U:"");const ve=z.startsWith("-")?"-":"",re=z.replace("-","").split(".");return re[0].length>17&&(re[0]=re[0].substring(0,17)),r.maxDecimalChar!==void 0&&re.length>1&&(re[1]=re[1].substring(0,r.maxDecimalChar)),z=ve+re.join("."),z},email:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),url:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),tel:N=>N.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=N=>{const z=h[r.type];return z?z(N):N},p=xZ(N=>{r.autoEmit&&(i("update:modelValue",N),i("input",N))},r.debounceDelay),g=N=>{const z=N;if(r.disabled||r.readOnly){z.preventDefault();return}const ne=z.target,pe=ne.selectionStart||0,ve=l.value,we=f(ne.value);ve!==we&&(l.value=we,i("input",we),r.autoEmit&&p(we),ne.value!==we&&(ne.value=we,vt(()=>{let re=pe;if(we.length<ne.value.length)re=pe;else{const U=we.length-ve.length;re=pe+U}re=Math.max(0,Math.min(re,we.length)),ne.setSelectionRange(re,re)})))},v=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}c.value=!0;const z=l.value;l.value="",i("update:modelValue",""),i("clear"),z!==""&&i("change",""),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),vt(()=>{var ne;(ne=a.value)==null||ne.focus(),setTimeout(()=>{c.value=!1},100)})},w=N=>{r.disabled||r.readOnly||(i("focus",N),r.selectOnFocus&&vt(()=>{N.target.select()}))},S=N=>{if(c.value)return;const ne=N.target.value;r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne),i("blur",ne,N)},b=N=>{setTimeout(()=>{vt(()=>{const ne=N.target.value;i("enter",ne,N),i("enterValue",ne),r.submitOnEnter&&(N.preventDefault(),r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))})},1e3)},C=N=>{const z=N.target,ne=z.value;if(i("escape",ne,N),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&z.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&z.blur()},_=N=>{const ne=N.target.value;i("tab",ne,N),r.autoEmit||(i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))},E=(N,z,ne)=>N===""?!0:N==="."?ne>0:new RegExp(`^\\d{0,${z}}(\\.\\d{0,${ne}})?$`).test(N),I=N=>{if(i("keydown",N),N.key===" "&&N.stopPropagation(),r.type==="number"){if(N.key==="e"||N.key==="E"){N.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(N.key)||N.ctrlKey||N.metaKey||N.altKey)){if(Number.isNaN(Number(N.key))&&N.key!=="."&&N.key!=="-"){N.preventDefault();return}const pe=l.value+N.key;if(!E(pe,17,r.maxDecimalChar||2)){N.preventDefault();return}}}N.key==="Escape"?C(N):N.key==="Enter"?b(N):N.key==="Tab"?_(N):(N.key==="ArrowUp"||N.key==="ArrowDown")&&r.type==="number"&&N.preventDefault()},T=N=>{i("keyup",N)},P=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("paste",N)},M=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("cut",N)},D=N=>{i("select",N)},F=`input-text-${Math.random().toString(36).substr(2,9)}`,O=V(!1),k=q(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});tt(()=>l.value,N=>{r.validatorFnc?O.value=!!N&&!r.validatorFnc(N):O.value=!1});const x=V(null),$=q(()=>({disabled:r.disabled,readOnly:r.readOnly,error:O.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:x,bordered:!0})),{argsMain:W,isHover:Q,isFocus:ae}=Co($);t({triggerFocus:()=>{vt(()=>{var N;(N=a.value)==null||N.focus()})},focus:()=>{ee()},blur:()=>{vt(()=>{var N;(N=a.value)==null||N.blur()})},select:()=>{vt(()=>{var N;(N=a.value)==null||N.select()})},setSelectionRange:(N,z)=>{vt(()=>{var ne;(ne=a.value)==null||ne.setSelectionRange(N,z)})},getValue:()=>l.value,setValue:N=>{l.value=f(N),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ee=()=>{!r.disabled&&!r.readOnly&&vt(()=>{var N;(N=a.value)==null||N.focus()})},X=q(()=>ae.value&&d.value);return(N,z)=>(K(),ie("div",{class:te([N.$style["input-wrapper"],"input-editor"]),onClick:ee},[Ke((K(),Ue(_o,Wt(H(W),{ref_key:"wrapperRef",ref:x,class:[N.$style["input-box"],{[N.$style["is-hovered"]]:H(Q),[N.$style["is-focused"]]:H(ae),[N.$style["has-input"]]:d.value,[N.$style["is-editting"]]:X.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:he(()=>[Dt(N.$slots,"prefix")]),suffix:he(()=>[d.value&&!r.disabled&&!r.readOnly?Dt(N.$slots,"clear",{key:0},()=>[Ke((K(),Ue(at,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:kt(v,["prevent","stop"]),size:18,rounded:!0,class:te(["wrapper-suffix",N.$style["clear-button"]])},{default:he(()=>[ue(lt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[H(s),{content:"Clear",contentClass:"extra-padding"}]])]):Dt(N.$slots,"suffix",{key:1})]),default:he(()=>[me("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:te([N.$style["column-config__input"]]),id:F,disabled:e.disabled,readonly:e.readOnly,inputmode:k.value,maxlength:r.maxLength,onInput:g,onFocus:w,onBlur:S,onKeydown:I,onKeyup:T,onPaste:P,onCut:M,onSelect:D},null,42,PZ)]),_:3},16,["class","bordered"])),[[H(o),r.focusIndex]]),O.value?Dt(N.$slots,"error",{key:0}):Xe("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1p4v0_1","is-disabled":"_is-disabled_1p4v0_16","is-readonly":"_is-readonly_1p4v0_16","is-hovered":"_is-hovered_1p4v0_16","is-focused":"_is-focused_1p4v0_20","column-config__input":"_column-config__input_1p4v0_40","clear-button":"_clear-button_1p4v0_55"}}]]),kZ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},ES=st({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null),i=xr(c=>{s("update:modelValue",c),s("search",c)},li),a=()=>{s("update:modelValue",""),s("clear"),vt(()=>{var c;(c=r.value)==null||c.focus()})},l=V(o.modelValue);return t({focus:()=>{var c;(c=r.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(K(),Ue(SS,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:H(i),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:he(()=>[me("div",kZ,[ue(lt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),ic=Ct(st({name:"ListItem",directives:{tooltip:Yt,focusable:ko},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=ko,s=e,r=n,i=V(!1),a=V(!1);function l(_){if(!_||typeof _!="object")return!1;const E=_;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const c=q(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!C.prefix),u=q(()=>!!C.suffix||s.danger&&i.value),d=q(()=>{var _;return s.type==="status"&&typeof((_=s.data)==null?void 0:_.color)=="string"?{backgroundColor:s.data.color,border:em(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=Og(),f=q(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:c.value,[h["has-suffix"]]:u.value,[h.readOnly]:s.readOnly}));q(()=>({content:"Cancel",...b})),q(()=>({content:"Confirm",theme:"warning",...b}));function p(_){return{name:_.name,initial:_.initial,id:_.id,profile_image:_.profile_image??null,color:_.color,size:24}}function g(){i.value=!1}function v(_){_?r("click",_):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function w(_){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(_);r("handleClick",_)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),C=bg();return tt(()=>s.show,_=>{_===!1&&(i.value=!1)}),t({select:()=>{w(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(_,E)=>{const I=eu("tooltip");return Ke((K(),Ue(at,{variant:["menu-item",e.danger?"danger":"menu-item"],class:te([_.$style["list-item"],f.value]),onHandleClick:w,onMouseenter:E[0]||(E[0]=T=>a.value=!0),onMouseleave:E[1]||(E[1]=T=>a.value=!1),onEscape:S,style:cn({width:s.itemWidth})},{default:he(()=>[c.value?(K(),ie("div",{key:0,class:te(_.$style["list-item__prefix"])},[Dt(_.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ue(lt,{key:0,src:e.icon,source:"remote",class:te(_.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(K(),ie("div",{key:1,class:te(_.$style["status-indicator"]),style:cn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(K(),Ue(Gh,Wt({key:2},p(e.data),{class:_.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Xe("",!0)])],2)):Xe("",!0),me("div",{class:te(_.$style["list-item__label"])},[Dt(_.$slots,"label",{selected:e.selected},()=>[Qe(ht(e.label),1)])],2),u.value?(K(),ie("div",{key:1,class:te(_.$style["list-item__suffix"])},[Dt(_.$slots,"suffix",{item:_.$props,hovered:a.value},()=>[e.danger&&i.value?(K(),ie("div",{key:0,class:te(_.$style["confirm-action"])},[Ke((K(),Ue(at,{variant:["tertiary","icon","danger"],size:"small",onClick:kt(g,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Xmark",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.0`],[I,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((K(),Ue(at,{variant:["danger","primary","icon"],size:"small",onClick:kt(v,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.1`],[I,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)])],2)):Xe("",!0)]),_:3},8,["variant","class","style"])),[[H(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_tuyyv_1",disabled:"_disabled_tuyyv_16",danger:"_danger_tuyyv_23","has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:"_clickable_tuyyv_40",readOnly:"_readOnly_tuyyv_43",hover:"_hover_tuyyv_47",active:"_active_tuyyv_53","list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"}}]]),AZ=["aria-activedescendant"],OZ=["innerHTML"],MZ=10,na=Ct(st({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=V(""),l=V(-1),c=V(null),u=V(null),d=V(new Map),h=q(()=>Vb(a.value)),f=()=>{const X=h.value;if(!X||X.length<r.minQueryLength)return r.options;if(d.value.has(X))return d.value.get(X);const N=r.options.map(z=>({item:z,score:k7(` ${z.label} `,X)})).filter(({score:z})=>z>0).sort((z,ne)=>ne.score-z.score).map(({item:z})=>z);return d.value.set(X,N),N},p=V([]);tt(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=q(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=xr(X=>{a.value=X,l.value=-1,i("search",X)},li),w=async X=>{ae.value=0,await v(X||""),ae.value=1},S=X=>a.value?A7(X,a.value):X,b=X=>{const z={[s.ARROW_DOWN]:()=>C(X),[s.ARROW_UP]:()=>_(X),[s.ENTER]:()=>T(X),[s.ESCAPE]:()=>P(X),[s.TAB]:()=>M(X)}[X.key];z&&z()},C=X=>{X.preventDefault(),E(1)},_=X=>{X.preventDefault(),E(-1)},E=X=>{const N=p.value.length;if(N===0)return;let z;X>0?z=(l.value+1)%N:l.value>0?z=l.value-1:z=N-1,l.value=z,I()},I=()=>{vt(()=>{var N;const X=(N=u.value)==null?void 0:N.querySelectorAll('[role="menuitem"]')[l.value];X==null||X.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},T=X=>{if(X.preventDefault(),l.value>=0&&l.value<p.value.length){const z=p.value[l.value];D(z,X)}},P=X=>{X.preventDefault(),O()},M=X=>{i("tab",X)},D=(X,N)=>{!X||X.disabled||(i("select",X,N),l.value=-1,O())},F=X=>{X>=0&&X<p.value.length&&(l.value=X)},O=()=>{i("close")},k=()=>{if(!g.value||!u.value)return;const{scrollTop:X,clientHeight:N,scrollHeight:z}=u.value;z-(X+N)<=MZ&&i("loadMore")},x=()=>{var X,N,z;(X=u.value)==null||X.addEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.addEventListener("keydown",b)},$=()=>{var X,N,z;(X=u.value)==null||X.removeEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.removeEventListener("keydown",b)};Qt(()=>{x()}),qn(()=>{$()}),tt(()=>r.loading,X=>{!X&&p.value.length>0&&(l.value=-1)});const W=X=>X?Array.isArray(r.selectedId)?r.selectedId.includes(String(X.id)):r.selectedId==X.id:!1,Q=V(null);tt(l,()=>{I()}),t({focus:()=>{vt(()=>{var X;(X=Q.value)==null||X.focus()})},reset:()=>{var X;(X=Q.value)==null||X.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:O,clearSearch:()=>{a.value=""},scrollTo:X=>{u.value&&(u.value.scrollTop=X)},selectIndex:X=>{X>=0&&X<p.value.length&&(l.value=X,I())}});const ae=V(0);tt([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const X=r.options.length>0&&p.value.length>0,N=!X&&a.value.length>0,z=!X&&a.value.length===0;r.loading?ae.value=0:X?ae.value=1:N?ae.value=2:z&&(ae.value=3)},{immediate:!0,deep:!0});const ee=()=>{i("cancel")};return(X,N)=>(K(),ie("datalist",{ref_key:"searchListRef",ref:c,class:te([X.$style["search-list"],ae.value===3||ae.value===2?X.$style.empty:"",p.value.length>8?X.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.itemWidth||e.width})},[ue(ES,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":N[0]||(N[0]=z=>a.value=z),class:te(X.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:N[1]||(N[1]=z=>w("")),onCancel:ee},null,8,["modelValue","class","disabled"]),me("div",{ref_key:"popupRef",ref:u,class:te(X.$style["list-container"])},[Dt(X.$slots,"extra-item",{query:a.value,isEmpty:ae.value===3||ae.value===2,isLoading:r.loading}),(K(!0),ie(It,null,Fn(p.value,(z,ne)=>Ke((K(),ie("div",{key:`${z.id}-${ne}`,role:"menuitem"},[Dt(X.$slots,"item",{item:z,index:ne,selectedIndex:l.value,isSelected:W,handleSelect:D,handleItemHover:F,getHighlightedLabel:S,query:a.value,idx:ne,focused:l.value==ne},()=>[z.hide?Xe("",!0):(K(),Ue(ic,Wt({key:0,ref_for:!0},z,{hover:ne===l.value,selected:W(z),type:z.type,id:`item-${ne}`,"aria-selected":ne===l.value,onClick:pe=>D(z,pe),onMouseover:pe=>F(ne),onEscape:O,itemWidth:e.itemWidth||e.width}),{prefix:he(()=>[Dt(X.$slots,"prefix-item",{item:z})]),label:he(()=>[a.value?Ke((K(),ie("span",{key:0,class:te(X.$style.match),innerHTML:S(z.label)},null,10,OZ)),[[H(o),{content:z.label,delay:[1e3,0]}]]):Ke((K(),ie("span",{key:1,class:te(X.$style["item-label"])},[Qe(ht(z.label),1)],2)),[[H(o),{content:z.label,delay:[1e3,0]}]])]),suffix:he(({hovered:pe})=>[Dt(X.$slots,"action",{item:z,isHovered:ne===l.value,hovered:pe,selected:l.value==ne})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[Ks,ae.value===1]])),128)),ae.value===0?Dt(X.$slots,"loading-more",{key:0},()=>[(K(),ie(It,null,Fn(8,z=>me("div",{class:te(X.$style["loading-more"]),key:z},[me("div",{class:te(X.$style["loading-skeleton"])},null,2),me("div",{class:te(X.$style["loading-skeleton"])},null,2)],2)),64))]):Xe("",!0),ae.value===2?(K(),ie("div",{key:1,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty",{query:a.value},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[2]||(N[2]=[me("div",null,[Qe(" No results. "),me("br"),Qe(" Try another search. ")],-1)])],2)])],2)):Xe("",!0),ae.value===3?(K(),ie("div",{key:2,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty-list",{},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[3]||(N[3]=[me("div",null,"No items available.",-1)])],2)])],2)):Xe("",!0),Dt(X.$slots,"footer")],2)],14,AZ))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Gu=st({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=C3,n=e,o=V(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=V(s());tt(()=>n,()=>{setTimeout(()=>{vt(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=q(()=>un.getInstance().getItem("user.ws_user_role_id")),a=q(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,c)=>Ke((K(),Ue(Gh,RH(pT(a.value)),null,16)),[[H(t),r.value]])}}),NZ={class:"avatar-wrapper"},LZ={class:"assignee-label"},wA=Ct(st({__name:"AssigneeItem",props:{user:{},hover:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Yt,o=e,s=q(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=bg(),i=q(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const c=u=>{u.forEach(d=>{d.type===It&&Array.isArray(d.children)?c(d.children):d.type!==Yn&&d.type!==Fa&&l++})};return c(r.actions()),l}),a=V(!1);return(l,c)=>(K(),ie("div",{class:te(["assignee-selector-item",{hovered:a.value||o.hover,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:cn({"--actions-count":i.value}),onMouseenter:c[0]||(c[0]=u=>a.value=!0),onMouseleave:c[1]||(c[1]=u=>a.value=!1)},[me("div",NZ,[ue(Gu,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(K(),ie("div",{key:0,class:te(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(K(),Ue(lt,{key:0,src:"CircleXMark"})):(K(),Ue(lt,{key:1,src:"CirclePlus"}))],2)):Xe("",!0)]),Ke((K(),ie("div",LZ,[Dt(l.$slots,"name",{},()=>[Qe(ht(o.user.name),1)],!0)])),[[H(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hover||o.focused?Dt(l.$slots,"actions",{key:0},void 0,!0):Xe("",!0)],38))}}),[["__scopeId","data-v-dbfbcc0c"]]),VZ={class:"unassign-icon"},_S=Ct(st({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(K(),Ue(H(at),{variant:"menu-item",onClick:o,actived:e.actived,style:cn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:he(()=>[me("div",VZ,[Dt(s.$slots,"icon",{},()=>[r[0]||(r[0]=me("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[me("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:he(()=>[Dt(s.$slots,"label",{},()=>[Qe(ht(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),BZ=["innerHTML"],CA=20,bA=Ct(st({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,{id:r}=ag(s),i=n,a=ne=>{var ve,we;const pe=(we=(ve=s.params)==null?void 0:ve.api)==null?void 0:we.getRowNode(String(r.value));pe==null||pe.setDataValue("assignees",rb(ne.assignees)),z("updated",ne)},l=V(!1),c=V(!1),u=V(null),d=V(1),h=V(!0),f=V(0),p=V(""),g=yn("bulkUpdate",V(!1)),v=yn("isSelectAll",V(!1)),w=q(()=>{var ne;return g.value&&v.value?[]:(ne=s.ids)!=null&&ne.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:C,assigneeList:_,mergedOptions:E,selectedUserIds:I}=Om({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{z("update-failed")}},w),{apiServices:T}=Zn(!g.value,s),P=yn("workspaceId"),M=async(ne=1,pe="",ve=!1)=>{var re,U,ge,oe,Re,G;if(!T.value)throw console.error("API service or item identifiers are undefined",T.value),new Error("API service or item identifiers are undefined");if(ve?c.value=!0:l.value=!0,u.value=null,!((re=T.value)!=null&&re.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const we=(s.ids??(s.id?[s.id]:[])).map(String);try{let Y;we.length==0?Y=await((U=T.value)==null?void 0:U.getEntityUserRoles({workspaceId:String(P),page:ne,per_page:CA,display_name_like:pe.trim(),entity_ids:String(s.entityId)})):Y=await((ge=T.value)==null?void 0:ge.multipleAssignableUser({workspaceId:String(P),itemIds:we,page:ne,perPage:CA,q:pe.trim(),entityId:String(s.entityId)}));const de=((oe=Pu(Y.data))==null?void 0:oe.map(Am))??[];_.value=ve?vu(_.value,de,"id"):de,f.value=Y.meta.total,h.value=(((Re=Y==null?void 0:Y.meta)==null?void 0:Re.current_page)||0)<(((G=Y==null?void 0:Y.meta)==null?void 0:G.last_page)||0),d.value=ne}catch(Y){console.error("Error fetching assignable users:",Y),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},D=()=>{!c.value&&h.value&&M(d.value+1,p.value,!0)},F=xr(async ne=>{p.value=ne,await M(1,ne,!1)},li),O=()=>M(1,p.value,!1);Qt(()=>{var ne;(ne=x.value)==null||ne.focus()}),t({getValue:()=>{var ne;return(ne=E.value.find(pe=>pe.selected))==null?void 0:ne.value},refresh:O,clearInternal:()=>{I.value=[]},focus:()=>{var ne;(ne=x.value)==null||ne.focus()}});const k=()=>{const ne=un.getInstance().getItem("BASE_URL"),pe=es({type:"access_setting",config:{baseDomain:ne,ws_code:s.workspaceId,entity_id:P}}).url;window.open(pe,"_blank")},x=V(null);Qt(()=>{vt(()=>{var ne;(ne=x.value)==null||ne.focus()})}),tt([()=>s.id,()=>s.workspaceId],()=>{M()},{deep:!0,immediate:!0});const $=ne=>{var ve;const pe=un.getInstance().getItem("ws.code");return((ve=T.value)==null?void 0:ve.getUserInformation(pe,ne))||Promise.resolve(null)},W=async(ne,pe,ve)=>{pe.preventDefault(),pe.stopPropagation(),pe.stopImmediatePropagation(),z("update-start");try{if(await C(ne))z("update-completed");else throw new Error("Failed to update assignees")}catch(we){z("update-failed"),console.error("Error updating assignees:",we)}},Q=async()=>{try{if(z("update-start"),await S())z("update-completed");else throw new Error("Failed to unassign all assignees")}catch(ne){z("update-failed"),console.error("Error unassigning all assignees:",ne)}finally{}},ae=async ne=>{try{if(z("update-start"),await b(ne))z("update-completed");else throw new Error("Failed to replace assignees")}catch(pe){z("update-failed"),console.error("Error replacing assignees:",pe)}finally{}},ee=()=>{var ne,pe;i("cancel"),(pe=(ne=s.params)==null?void 0:ne.api)==null||pe.stopEditing()};Jr("popupAttachRef",x);const X=V(),N=V(!1),z=(ne,pe)=>{switch(ne){case"updated":i("updated",pe);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed");break}};return Qt(()=>{vt(()=>{setTimeout(()=>{N.value=!0},50)})}),(ne,pe)=>(K(),ie("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:X},[ue(na,Wt({"selected-id":H(I)},{...s},{options:H(E),loading:l.value,ref_key:"popupRef",ref:x,"loading-more":c.value,"has-more":h.value,onSelect:pe[0]||(pe[0]=(ve,we)=>{W(ve,we)}),"data-wrapper":"true",onSearch:H(F),onLoadMore:D,onCancel:ee,onClose:ee}),tu({"extra-item":he(({isEmpty:ve,isLoading:we})=>[!ve&&!we?(K(),Ue(_S,{key:0,onClick:Q,actived:!1,label:"Unassign"},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})):Xe("",!0)]),item:he(({item:ve,selectedIndex:we,isSelected:re,handleItemHover:U,getHighlightedLabel:ge,query:oe,idx:Re,focused:G})=>[ue(wA,{user:ve.data,"multiple-select":!0,"append-to":X.value,isMe:!1,hover:Re===we,selected:re(ve),focused:G,onClick:kt(Y=>W(ve,Y,"click"),["stop","prevent"]),onMouseover:Y=>U(Re),"api-update-function":$},{name:he(()=>[oe?Ke((K(),ie("span",{key:0,class:te([ne.$style["item-label"],ne.$style.match]),style:{flex:"1"},innerHTML:ge(ve.label)},null,10,BZ)),[[H(o),{content:ve.label}]]):Ke((K(),ie("span",{key:1,class:te(ne.$style["item-label"]),style:{flex:"1"}},[Qe(ht(ve.label),1)],2)),[[H(o),{content:ve.label}]])]),actions:he(()=>[Ke((K(),Ue(at,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:kt(Y=>{var de;return ae((de=ve.data)==null?void 0:de.id)},["stop"])},{default:he(()=>[ue(lt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[H(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":he(()=>[me("div",{class:te(ne.$style["empty-state"])},[pe[3]||(pe[3]=Qe(" No assignee available. ",-1)),pe[4]||(pe[4]=me("br",null,null,-1)),ue(at,{onClick:k,variant:["tertiary"],size:"small"},{default:he(()=>[...pe[2]||(pe[2]=[Qe(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:he(()=>[me("div",{class:te(ne.$style["error-message"])},[Qe(ht(u.value)+" ",1),ue(at,{onClick:O,size:"small"},{default:he(()=>[...pe[1]||(pe[1]=[Qe(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),$Z={key:0,class:"inner"},yf=Ct(st({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=V(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:c,show:u}=yo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=V(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=ds({isShow:!1,isRender:!1});Qt(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.addEventListener("keydown",h)}),qn(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,w)=>{f.isShow=v,f.isRender=w};return tt(()=>a.value,(v,w)=>{v&&v!==w&&vt(()=>{g(!0,!0)}),p("onVisibleChange",v,w)}),t({hide:()=>{l(),g(!1,!0)},isVisible:a,open:()=>{u(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,w)=>(K(),ie("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[me("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[Dt(v.$slots,"trigger",{isVisible:H(a),hide:H(l),disabled:o.isUpdating||o.disabled,popupRef:H(i),triggerRef:H(r),toggle:H(c)},void 0,!0)],512),me("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?Ke((K(),ie("div",$Z,[Dt(v.$slots,"popup",{isVisible:H(a),hide:H(l),popupRef:H(i),triggerRef:H(r),toggle:H(c),open:H(u)},void 0,!0)],512)),[[Ks,!o.isUpdating&&!o.disabled&&f.isShow]]):Xe("",!0)],512)],512))}}),[["__scopeId","data-v-aab33e10"]]),HZ=st({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;Jr("bulkUpdate",!0);const o=V(!1),s=t,r=V(null),i=()=>{o.value=!0,s("update-start"),setTimeout(()=>{var d;(d=l.value)==null||d.hide()},0)},a=d=>{var h,f;o.value=!1,d?(s("update-completed"),(h=l.value)==null||h.destroy()):(s("update-failed"),(f=l.value)==null||f.open())},l=V(null),c=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},u=(d,h)=>{vt(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return tt(()=>n.ids,()=>{vt(()=>{var d;(d=l.value)==null||d.destroy()})}),(d,h)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:u},{trigger:he(({hide:f,disabled:p})=>[ue(at,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:he(()=>[ue(lt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=Qe(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({hide:f})=>[ue(bA,Wt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:c,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0)),onCancel:f}),null,16,["ids","onCancel"])]),default:he(()=>[h[3]||(h[3]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),wf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],GZ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),qa=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=wf.indexOf(l);const u=i?-1:1;for(const d of wf){c=(c+u+wf.length)%wf.length;const h=wf[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(GZ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},UZ=["aria-label"],WZ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],zZ={style:{flex:"1"}},jZ=Ct(st({__name:"MainCalendar",props:LD({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:LD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Yt,s=V(null),r=e,i=q(()=>r.startDate&&r.endDate),a=rU(e,"tracingCase"),l=n,c=V(r.year),u=V(r.month);tt(()=>[r.year,r.month],([N,z])=>{c.value=N,u.value=z});const d=q(()=>bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=q(()=>bt.now().setZone(r.timezone)),f=q(()=>r.startDate?bt.fromJSDate(r.startDate,{zone:r.timezone}):null),p=q(()=>r.endDate?bt.fromJSDate(r.endDate,{zone:r.timezone}):null),g=V(f.value),v=V(p.value),w=V(f.value),S=V(p.value);tt([f,p],()=>{r.requireConfirm||(g.value=f.value,v.value=p.value,w.value=f.value,S.value=p.value)},{immediate:!0});const b=q(()=>r.requireConfirm?g.value:f.value),C=q(()=>r.requireConfirm?v.value:p.value);tt(()=>r.activeField,N=>{const z=N==="start"?b.value:C.value;z&&(c.value=z.year,u.value=z.month)}),tt(()=>{var N,z;return[(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate(),r.activeField]},()=>{const N=r.activeField==="start"?b.value:C.value;N&&(N.year!==c.value||N.month!==u.value)&&(c.value=N.year,u.value=N.month)});function _(N){return N.setZone("utc")}const E=V("");function I(N){E.value=N.toISODate()||"",vt(()=>{const z=document.querySelector(`.arbo-calendar-day[data-date="${E.value}"]`);z==null||z.focus()})}tt(()=>{var N,z;return[c.value,u.value,r.activeField,(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate()]},()=>{const N=r.activeField==="start"?b.value:C.value;let z;N&&N.year===c.value&&N.month===u.value?z=N:b.value&&b.value.year===c.value&&b.value.month===u.value?z=b.value:z=h.value,I(z)});function T(N){return N.toFormat("d")}const P=q(()=>{const N=bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}),z=N.weekday,ne=r.weekStart===1?(z+6)%7:z%7;let pe=N.minus({days:ne});const ve=[],we=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),re=Og();for(let ge=0;ge<42;ge++){const oe=[];pe.month!==u.value&&oe.push(re["is-outside"]),pe.hasSame(h.value,"day")&&oe.push(re["is-today"]),b.value&&pe.hasSame(b.value,"day")&&oe.push(re["is-selected-start"]),C.value&&pe.hasSame(C.value,"day")&&oe.push(re["is-selected-end"]),b.value&&C.value&&pe>b.value&&pe<C.value&&oe.push(re["is-in-range"]);const Re=T(pe),G=we[pe.weekday-1]||"";ve.push({dt:pe,iso:pe.toISODate()||"",label:pe.toFormat("d"),displayLabel:Re,weekdayLabel:G,aria:pe.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:oe}),pe=pe.plus({days:1})}const U=[];for(let ge=0;ge<6;ge++)U.push(ve.slice(ge*7,ge*7+7));return U}),M=q(()=>{const N=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?N:[N[6],...N.slice(0,6)]});function D(N,z,ne){const pe=N==="start"?z.startOf("day"):z.endOf("day"),ve=_(pe),we={year:pe.year,month:pe.month,day:pe.day,utc:ve.toISO()||""};N==="start"?(l("select-start",we,ne??!0),l("select-start-utc",we.utc)):(l("select-end",we),l("select-end-utc",we.utc))}function F(N){let z=c.value,ne=u.value+N;for(;ne<1;)ne+=12,z-=1;for(;ne>12;)ne-=12,z+=1;c.value=z,u.value=ne,l("update:year",z),l("update:month",ne)}function O(N){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).plus({days:N});ne.month===u.value&&ne.year===c.value&&I(ne)}function k(N=!1){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).weekday%7,pe=N?6-ne:-ne;O(pe)}const x=N=>{$(N)};function $(N){switch(N.preventDefault(),N.stopPropagation(),N.key){case"ArrowLeft":N.preventDefault(),O(-1);break;case"ArrowRight":N.preventDefault(),O(1);break;case"ArrowUp":N.preventDefault(),O(-7);break;case"ArrowDown":N.preventDefault(),O(7);break;case"Home":N.preventDefault(),k(!1);break;case"End":N.preventDefault(),k(!0);break;case"PageUp":N.preventDefault(),F(N.shiftKey?-12:-1);break;case"PageDown":N.preventDefault(),F(N.shiftKey?12:1);break;case"Enter":case" ":{N.preventDefault();const z=E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value,ne=P.value.flat().find(pe=>pe.iso===z.toISODate());ne&&Q(ne);break}}}const W=N=>{const z=bt.now().setZone(r.timezone);c.value=z.year,u.value=z.month,l("update:year",z.year),l("update:month",z.month),I(z),l("gotoToday")};function Q(N){var de,ke;const z=!!f.value,ne=!!p.value,pe=r.activeField,ve=((de=f.value)==null?void 0:de.toISODate())||"null",we=((ke=p.value)==null?void 0:ke.toISODate())||"null",re=N.dt.toISODate()||"",U=(xe,Ve)=>{a.value={case:xe,behavior:Ve}},ge=()=>`Selected start ${re} > existing end ${we} -> reset both to ${re}`,oe=()=>`Selected end ${re} < existing start ${ve} -> reset both to ${re}`,Re=()=>{D("start",N.dt,!0),D("end",N.dt),l("update:activeField","end")},G=(xe=!1)=>{D("start",N.dt,xe),xe&&l("update:activeField","end")},Y=(xe=!1)=>{D("end",N.dt),xe&&l("close")};if(z&&ne){pe==="start"?p.value&&N.dt>p.value?(Re(),U("INVERT_RANGE_FROM_START",ge())):(G(!1),U("UPDATE_START_IN_RANGE",`Updated start from ${ve} to ${re}; end remains ${we}`)):f.value&&N.dt<f.value?(Re(),U("INVERT_RANGE_FROM_END",oe())):(Y(!1),U("UPDATE_END_IN_RANGE",`Updated end from ${we} to ${re}; start remains ${ve}`));return}if(!z&&ne&&pe==="start"&&p.value&&N.dt>p.value){Re(),U("CREATE_RANGE_FROM_LATE_START",ge());return}if(z&&!ne&&pe==="end"&&f.value&&N.dt<f.value){Re(),U("CREATE_RANGE_FROM_EARLY_END",oe());return}if(!z&&!ne){if(pe==="start"){G(!0),U("INIT_START",`Picked start ${re}; awaiting end selection`);return}Y(r.immediatelyUpdate),U("INIT_END",`Picked end ${re}; awaiting start selection`);return}if(!z&&ne){if(pe==="start"){G(!0),U("FILL_MISSING_START",`Inserted start ${re}; existing end ${we}`);return}Y(!1),U("STRICT_UPDATE_END_ONLY",`Updated end to ${re}; start still null`);return}if(z&&!ne){if(pe==="start"){G(!0),U("RESELECT_START_BEFORE_END",`Replaced start with ${re}; end still null, switching to end`);return}Y(r.immediatelyUpdate),U("FILL_MISSING_END",`Picked end ${re}; start ${ve}`);return}}function ae(){w.value=g.value,S.value=v.value,l("confirm")}function ee(){g.value=w.value,v.value=S.value,l("cancel")}function X(){vt(()=>{var N;(N=s.value)==null||N.focus()})}return Qt(()=>{X()}),t({focus:X}),(N,z)=>(K(),ie("div",{ref_key:"calendarRef",ref:s,class:te([N.$style["arbo-calendar"],{[N.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[me("div",{class:te([N.$style["arbo-calendar-header"],N.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ie(It,null,Fn(M.value,ne=>(K(),ie("div",{key:ne,class:te(N.$style["arbo-calendar-weekday"]),role:"columnheader"},ht(ne),3))),128))],2),me("div",{class:te(N.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:z[0]||(z[0]=kt(ne=>H(qa)(ne,x),["prevent","stop"]))},[(K(!0),ie(It,null,Fn(P.value,(ne,pe)=>(K(),ie("div",{key:pe,class:te(N.$style["arbo-calendar-week"])},[(K(!0),ie(It,null,Fn(ne,ve=>(K(),ie("div",{key:ve.iso,class:te([N.$style["arbo-calendar-day"],ve.classes,{[N.$style["is-focused"]]:ve.iso===E.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":ve.aria,"data-date":ve.iso,"data-weekday":ve.weekdayLabel,tabindex:ve.iso===E.value?0:-1,onClick:we=>Q(ve)},ht(ve.displayLabel),11,WZ))),128))],2))),128))],34),r.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:te(N.$style["arbo-calendar-actions"])},[me("div",zZ,[Ke((K(),Ue(at,{variant:"secondary",size:"medium",onClick:z[1]||(z[1]=ne=>W()),onKeydown:H(qa),"data-index":"today-btn"},{prefix:he(()=>[ue(lt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[H(o),"Today"]])]),ue(at,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:H(qa),variant:"secondary",size:"medium",onClick:ee,"data-index":"cancel-btn"},{default:he(()=>[Qe(ht(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ue(at,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:H(qa),onClick:ae},{default:he(()=>[Qe(ht(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,UZ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:"_cancel_99b61_156",confirm:"_confirm_99b61_161"}}]]),KZ=["onClick"],qZ=["variant","onClick"],YZ=Ct(st({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=q(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const O=o.locale||"en-US",k=o.monthLabelStyle||"short",x=new Intl.DateTimeFormat(O,{month:k,timeZone:"UTC"});return Array.from({length:12},(W,Q)=>x.format(new Date(Date.UTC(2020,Q,1))))}),r=n,i=V(o.year),a=V(o.month),l=V(o.year);tt(()=>o.year,O=>{O!==i.value&&(i.value=O,l.value=O)}),tt(()=>o.month,O=>{O!==a.value&&(a.value=O)});const c=V("days");function u(O){c.value!==O&&(c.value=O,r("mode-change",O))}const d=q(()=>o.minYear),h=q(()=>o.maxYear),f=q(()=>{const O=o.yearSpan;return l.value-l.value%O}),p=q(()=>f.value+o.yearSpan-1);function g(){const O=o.yearSpan,k=f.value-O;k>=d.value&&(l.value=k)}function v(){const O=o.yearSpan,k=f.value+O;k<=h.value&&(l.value=k)}const w=q(()=>f.value-o.yearSpan<d.value),S=q(()=>p.value+o.yearSpan>h.value),b=q(()=>{const O=o.yearSpan;return Math.ceil(O/3)});function C(O){const x=f.value+(O-1)*3;return Array.from({length:3},($,W)=>x+W).filter($=>$<=p.value)}function _(){c.value==="months"?u("days"):u("months")}function E(){c.value==="years"?u("days"):u("years")}function I(O){i.value=O,l.value=O,r("update:year",O),r("year-selected",O),u("months")}function T(O){a.value=O,r("update:month",O),r("month-selected",O),u("days")}function P(){if(c.value==="days"){let O=i.value,k=a.value-1;if(k<1&&(k=12,O--),O<d.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else c.value==="years"&&g()}function M(){if(c.value==="days"){let O=i.value,k=a.value+1;if(k>12&&(k=1,O++),O>h.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else c.value==="years"&&v()}const D=q(()=>c.value==="days"?i.value===d.value&&a.value===1:c.value==="months"?i.value-1<d.value:w.value),F=q(()=>c.value==="days"?i.value===h.value&&a.value===12:c.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(O,k)=>{i.value=O,a.value=k}}),(O,k)=>(K(),ie("div",{class:te([O.$style["cal-nav-wrapper"]])},[Dt(O.$slots,"selection"),c.value==="days"?(K(),ie("div",{key:0,class:te(O.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:P,"data-index":"prev-btn",onKeydownCapture:jn(kt(P,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),me("div",{class:te(O.$style["cal-nav-center"])},[ue(at,{"data-index":"month-btn",variant:"secondary",onClick:_,onKeydown:H(qa)},{default:he(()=>[Qe(ht(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ue(at,{variant:"secondary",onClick:E,"data-index":"year-btn",onKeydown:H(qa)},{default:he(()=>[Qe(ht(i.value),1)]),_:1},8,["onKeydown"])],2),ue(at,{"data-index":"next-btn",variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:F.value,label:"",onClick:M,onKeydownCapture:jn(kt(M,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Xe("",!0),c.value==="years"?(K(),ie("div",{key:1,class:te(O.$style["year-grid"])},[me("div",{class:te(O.$style["year-grid-header"])},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),me("div",{class:te(O.$style["range-label"])},ht(f.value)+" - "+ht(p.value),3),ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),me("div",{class:te(O.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ie(It,null,Fn(b.value,x=>(K(),ie("div",{key:"yr-row-"+x,class:te(O.$style["year-grid-row"])},[(K(!0),ie(It,null,Fn(C(x),$=>(K(),ie("a",{key:$,tabindex:"0",class:te([O.$style["year-cell"],{[O.$style.selected]:$===i.value}]),onClick:W=>I($)},ht($),11,KZ))),128))],2))),128))],2)],2)):c.value==="months"?(K(),ie("div",{key:2,class:te(O.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[me("div",{class:te(O.$style.months)},[(K(!0),ie(It,null,Fn(s.value,(x,$)=>(K(),ie("a",{tabindex:"0",key:x,variant:$+1===a.value?"primary":"text",class:te([O.$style["month-cell"],{[O.$style.selected]:$+1===a.value}]),onClick:W=>T($+1)},ht(x),11,qZ))),128))],2)],2)):(K(),ie("div",{key:3,class:te(O.$style["days-slot"])},[Dt(O.$slots,"default",{year:i.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function ZZ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=V(""),i=q(()=>{const g=bt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=q(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const w=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return w<S?-1:w>S?1:0},c=q(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),u=q(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&c.value),d=q(()=>r.value.length===t.length&&u.value);return{inputValue:r,isValid:u,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=bt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>u.value?i.value:null}}const XZ={key:0,style:{marginLeft:"8px"}},JZ=["disabled","readonly","placeholder"],SA=Ct(st({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(null),a=V(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=ZZ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=q(()=>s.active),g=q(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:S}=Co(g),b=T=>{var M;const P=(M=T.clipboardData)==null?void 0:M.getData("text/plain");P&&(u.value=P.trim())},C=T=>{if(T.key==="Escape"){r("blur"),T.target.blur(),T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation();return}else T.key==="Tab"&&I(T)},_=()=>{d(),r("clear")};t({clear:_,setDate:h,getDate:f,focus:()=>{var T;return(T=i.value)==null?void 0:T.focus()}}),tt(()=>s.modelValue,T=>{T?h(T):d()},{immediate:!0}),tt([()=>c.value,()=>u.value],()=>{if(u.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const T=f();(T||u.value.length===0)&&r("complete",T)}}),tt(()=>l.value,T=>{T||r("invalid","")});const E=q(()=>!!s.isMultipleDate),I=T=>{T.preventDefault(),T.stopImmediatePropagation(),T.stopPropagation(),r("tab",T)};return(T,P)=>(K(),Ue(_o,Wt(H(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:he(()=>[me("div",{class:te([T.$style["date-input-wrapper"]])},[E.value?(K(),ie("span",XZ," Multiple ")):Ke((K(),ie("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":P[0]||(P[0]=M=>mn(u)?u.value=M:null),onPaste:kt(b,["prevent"]),placeholder:s.placeholder,class:te([T.$style["date-input"]]),onKeydown:C},null,42,JZ)),[[QT,H(u)]]),Dt(T.$slots,"clear",{handleClear:_},()=>[(H(u).length>0||E.value)&&!s.readOnly&&!s.disabled&&(H(w)||H(S))?Ke((K(),Ue(at,{key:0,variant:["icon","primary"],onClick:kt(_,["stop"]),size:16,rounded:!0},{default:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[H(o),"Clear"]]):(K(),Ue(lt,{key:1,src:"Calendar",source:"remote",class:te(T.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),QZ=st({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:Hb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=V({case:"",behavior:""}),s=e,r=V(null),i=n,a=async(U,ge)=>{i("start-update"),await U(),i("finish-update"),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},l=(U,ge)=>{U(),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},c=()=>{var ge;const U=bt.now().setZone(s.timezone);z.value=U.year,ne.value=U.month,(ge=N.value)==null||ge.setNavigation(U.year,U.month)},u=ds({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:w,beginInteraction:S,clearStart:b,clearDue:C}=L7(s,i),_=q(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});tt(()=>s.multipleStartDates,U=>{h.value=!!U},{immediate:!0}),tt(()=>s.multipleDueDates,U=>{f.value=!!U},{immediate:!0});const E=V(null),I=V(null),T=U=>{U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),ae()},P=()=>{var U;(U=I.value)==null||U.focus()},M=U=>{if(!U){u.start=!1,b();return}const ge=d.endDate?bt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(ge&&D(U,ge)>0){const Re={year:U.year,month:U.month,day:U.day};u.start=!1,w(Re,!1),p(Re),vt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.start=!1,w(oe,!0)},D=(U,ge)=>{const oe=U.startOf("day"),Re=ge.startOf("day");return oe<Re?-1:oe>Re?1:0},F=U=>{var ge;U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),(ge=document.querySelector('[data-index="prev-btn"]'))==null||ge.focus()},O=U=>{if(!U){u.end=!1,C();return}const ge=d.startDate?bt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(ge&&D(U,ge)<0){const Re={year:U.year,month:U.month,day:U.day};u.end=!1,w(Re),p(Re),vt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.end=!1,p(oe)},k=()=>{h.value=!1,b()},x=()=>{f.value=!1,C()},$=()=>{ee()},W=q(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,vt(()=>{var U;(U=r.value)==null||U.focus()}))}function ae(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,vt(()=>{var U;(U=E.value)==null||U.focus()}))}function ee(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function X(U){U.key==="Escape"?(U.stopPropagation(),ee()):U.key=="Tab"&&i("tab",U)}const N=V(null),z=V(new Date().getFullYear()),ne=V(new Date().getMonth()+1);tt(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(z.value=d.startDate.getFullYear(),ne.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(z.value=d.endDate.getFullYear(),ne.value=d.endDate.getMonth()+1)},{immediate:!0});const pe=V(null);function ve(){if(Array.isArray(s.value)){const[ge,oe]=s.value;d.startDate=ge||null,d.endDate=oe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const U=d.startDate||d.endDate||new Date;z.value=U.getFullYear(),ne.value=U.getMonth()+1}tt(()=>{var U,ge,oe,Re,G,Y,de,ke;return[((oe=(ge=(U=s.value)==null?void 0:U[0])==null?void 0:ge.getTime)==null?void 0:oe.call(ge))||((Re=s.value)==null?void 0:Re[0]),((de=(Y=(G=s.value)==null?void 0:G[1])==null?void 0:Y.getTime)==null?void 0:de.call(Y))||((ke=s.value)==null?void 0:ke[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:Q,openEnd:ae,closePicker:ee,clearAll:$,isOpen:W,drpRef:pe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():ae():Q()}});const re=V(null);return tt(()=>W.value,U=>{if(s.disabled||s.readOnly)return;const ge=re.value;ge&&(U?ge.show():ge.hide())},{immediate:!0}),(U,ge)=>(K(),ie("div",{class:te(U.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:I,onKeydown:X,tabindex:"1","data-index":"calendar-wrapper"},[ue(YZ,{year:z.value,"onUpdate:year":ge[6]||(ge[6]=oe=>z.value=oe),month:ne.value,"onUpdate:month":ge[7]||(ge[7]=oe=>ne.value=oe),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:N},{selection:he(()=>[me("div",{class:te(U.$style["calendar-input-section"])},[ue(SA,{ref_key:"starDateRef",ref:r,"model-value":H(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:H(d).isSelectingStart,onClick:Q,onClear:k,onComplete:M,onInvalid:ge[0]||(ge[0]=oe=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:P,onTab:T},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ue(SA,{ref_key:"endDateRef",ref:E,"model-value":H(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:H(d).isSelectingEnd,onClick:ae,onClear:x,disabled:s.disabled,onComplete:O,onInvalid:ge[1]||(ge[1]=oe=>u.end=!0),readOnly:s.readOnly,isMultipleDate:H(f),onTab:F},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:he(({year:oe,month:Re})=>[ue(jZ,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:pe,"tracing-case":o.value,"onUpdate:tracingCase":ge[2]||(ge[2]=G=>o.value=G),year:oe,month:Re,"start-date":H(d).startDate,"end-date":H(d).endDate,"active-field":_.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:H(w),onSelectEnd:H(p),onGotoToday:c,onConfirm:ge[3]||(ge[3]=()=>{a(H(v),ee)}),onCancel:ge[4]||(ge[4]=G=>l(H(g),ee)),onClose:ge[5]||(ge[5]=G=>a(H(v),ee))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Ym=Ct(QZ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_139py_1","calendar-input-section":"_calendar-input-section_139py_11","display-wrapper":"_display-wrapper_139py_19","calendar-actions":"_calendar-actions_139py_23","clear-all-btn":"_clear-all-btn_139py_29"}}]]),eX=st({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=yn("isSelectAll",V(!1)),r=yn("bulkUpdate",V(!1)),i=q(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=Zn(!r.value,o),l=yn("filterParams",null),c=V(null),u=async T=>{var P,M,D,F;try{C.value=!0,n("update-start");let O={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in T&&(O.startDate=T.start?km(T.start):null),"end"in T&&(O.dueDate=T.end?km(T.end):null),i.value?(O.itemIds=void 0,O.entityId=o.entityId):O.entityId=void 0,await((M=(P=a.value)==null?void 0:P.changeDate)==null?void 0:M.call(P,O)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:O}),n("update-completed"),(D=c.value)==null||D.hide()}catch(O){console.error("Failed to update dates:",O),vt(()=>{vt(()=>{var k;n("update-failed"),(k=c.value)==null||k.open()})})}finally{(F=S.value)==null||F.resetCalendarLogic(),C.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{w.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const P=o.rowSelected[0].dateRange;b.value=[(P==null?void 0:P[0])??null,(P==null?void 0:P[1])??null],w.value=!1,v.value=!1},p=()=>{var P,M;if(o.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=g(0),F=g(1);if(v.value=D,w.value=F,D)b.value[0]=null;else{const O=((P=o.rowSelected[0].dateRange)==null?void 0:P[0])??null;b.value[0]=O}if(F)b.value[1]=null;else{const O=((M=o.rowSelected[0].dateRange)==null?void 0:M[1])??null;b.value[1]=O}}else v.value=!1,w.value=!1,b.value=[null,null]},g=T=>{const P=o.rowSelected.map(D=>{var F;return(F=D.dateRange)==null?void 0:F[T]});return P.length===0?!1:new Set(P.map(D=>{var F;return(F=D==null?void 0:D.getTime)==null?void 0:F.call(D)})).size>1},v=V(!1),w=V(!1),S=V(null),b=V([null,null]);tt([()=>o.ids,()=>o.rowSelected],T=>{d(),vt(()=>{var P;(P=S.value)==null||P.focus()})},{immediate:!0,deep:!0});const C=V(!1),_=()=>{C.value=!0},E=()=>{vt(()=>{setTimeout(()=>{C.value=!1},500)})},I=(T,P)=>{T&&vt(()=>{var M;(M=S.value)==null||M.focus()})};return(T,P)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:c,isUpdating:C.value,disabled:o.disabled||C.value,onOnVisibleChange:I},{trigger:he(({hide:M,disabled:D})=>[ue(at,{variant:o.variant,loading:C.value,disabled:D,onEscape:M},{default:he(()=>[ue(lt,{src:"Calendar"}),P[0]||(P[0]=Qe(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({isVisible:M,hide:D})=>[M?(K(),Ue(Ym,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:u,ref_key:"calendarRef",ref:S,onClosed:D,onStartUpdate:_,onFinishUpdate:E,multipleDueDates:w.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Xe("",!0)]),default:he(()=>[P[1]||(P[1]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tX=e=>{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"},EA=rc("metricStore",()=>{const e=V();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return tX(o)}}}),nX=["onKeydown"],oX=["width","height","viewBox"],sX=["d"],rX="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",_A=st({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(o.modelValue??0),i=V(null),a=q(()=>{var D;return((D=o.params)==null?void 0:D.size)??24}),l=q(()=>{var D;return((D=o.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=q(()=>{var D;return((D=o.params)==null?void 0:D.iconPath)??rX}),u=q(()=>{var D;return((D=o.params)==null?void 0:D.wrapperTag)??"span"}),d=q(()=>{var D;return o.disabled||((D=o.params)==null?void 0:D.disabled)||!1}),h=q(()=>{var D;return o.readOnly||((D=o.params)==null?void 0:D.readOnly)||!1}),f=q(()=>!d.value&&!h.value),p=q(()=>d.value?"not-allowed":h.value?"default":"pointer");tt(()=>o.modelValue,D=>{typeof D=="number"&&D!==r.value&&(r.value=D)});const g=D=>{var F;return((F=o.params)==null?void 0:F.maxRating)-D+1<=r.value&&!v.value},v=V(!1),w=()=>{v.value=!0},S=()=>{v.value=!1},b=D=>{f.value&&C(D)},C=D=>{var O,k;if(!f.value)return;let F=((O=o.params)==null?void 0:O.maxRating)-D+1;F===r.value&&(F=0),r.value=F,s("update:modelValue",F),s("update",F),s("change",F),(k=o.params)!=null&&k.onUpdate&&o.params.onUpdate(F)},_=D=>{var F;D!==r.value&&(r.value=D,s("update:modelValue",D),s("update",D),s("change",D),(F=o.params)!=null&&F.onUpdate&&o.params.onUpdate(D),E.value=D)},E=V(r.value),I=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),r.value=E.value,s("cancel")},T=D=>{D.preventDefault(),_(r.value),s("handleEnter",r.value)},P=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),_(r.value))},M=()=>{f.value&&(r.value=Math.max(r.value-1,0),_(r.value))};return t({focus:()=>{var D;(D=i.value)==null||D.focus()}}),(D,F)=>(K(),ie("div",{class:te(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[jn(kt(M,["prevent"]),["left"]),jn(kt(P,["prevent"]),["right"]),jn(kt(M,["prevent"]),["down"]),jn(kt(P,["prevent"]),["up"]),jn(kt(T,["prevent"]),["enter"]),jn(kt(T,["prevent"]),["tab"]),jn(kt(I,["prevent"]),["escape"])]},[(K(!0),ie(It,null,Fn(e.params.maxRating,O=>(K(),Ue($w(u.value),{key:O,class:te(["rating-item",{filled:g(O),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-O,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(O),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-O+1,tabindex:-1,onClick:kt(k=>b(O),["prevent","stop"]),onMouseenter:w,onMouseleave:S},{default:he(()=>[Dt(D.$slots,"icon",{index:O,filled:g(O),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:O},()=>[(K(),ie("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[me("path",{d:c.value},null,8,sX)],8,oX))]),Dt(D.$slots,"overlay",{index:O,filled:g(O),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,nX))}}),iX={style:{maxWidth:"180px",lineHeight:"15px"}},aX=["innerHTML"],RA=st({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var w;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(C=>({label:C.name,value:C.name,id:C.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((w=v.restricted_value)==null?void 0:w.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},c=q(()=>l(s.config)),u=V(s.modelValue),d=v=>{u.value=v,r("update:modelValue",v),r("change",v||null)},h=V(c.value),f=V(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(w=>w.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=V(null);return Qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,w)=>(K(),Ue(na,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:w[0]||(w[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:he(({item:S,getHighlightedLabel:b,selectedIndex:C,index:_})=>[ue(ic,{hover:C==_,selected:S.value===e.modelValue,label:S.label,onSelect:E=>d(S.value||null),onClick:E=>d(S.value||null)},{label:he(()=>[me("div",iX,[Ke(me("span",{innerHTML:b(S.label)},null,8,aX),[[H(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":he(()=>[...w[1]||(w[1]=[Qe("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),lX={class:"metric-input-wrapper"},cX={key:0,class:"error-text input-2"},DA=st({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(s.modelValue),i=V(s.modelValue),a=V(!1),l=V(!0),c=V(""),u=q(()=>{var x;const k=Number.parseInt(String((x=s.config)==null?void 0:x.format_value)||"2",10);return Number.isFinite(k)&&k>=0?k:2}),d=k=>{if(!k)return k;const x=String(k).split(".");return x.length>1&&x[1].length>u.value?u.value===0?x[0]:`${x[0]}.${x[1].slice(0,u.value)}`:String(k)},h=k=>{const x=d(k);x!==k&&b.value?r.value=x:r.value=k},f=k=>{const x=k.target;if(!x)return;const $=x.value||"",W=$.indexOf(".");if(k.key==="."&&u.value===0){k.preventDefault();return}W!==-1&&/[0-9]/.test(k.key)&&$.slice(W+1).length>=u.value&&k.preventDefault()},p=q(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var X;const k=s.config.restricted_type.trim(),x=((X=s.config.restricted_value)==null?void 0:X.split(",").map(Number))||[],[$,W]=x,ae={range:`Enter a value between ${$} and ${W}`,not:`These values are not allowed: ${x.join(", ")}`,exact:"Value is not allowed"}[k];return l.value?"":ae},v=q(()=>{var x;let k="";return Number((x=s.config)==null?void 0:x.format_value)&&(k+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${k}`});tt(()=>s.modelValue,k=>{r.value=k,i.value=k});const w=k=>Im(s.config,k),S=n,b=V(null),C=k=>{const x=k===""?null:k,$=i.value===""?null:i.value;return x!==$},_=k=>{const x=d(k);if(!C(x))return!1;const $=x===""?null:x;return r.value=$,i.value=$,S("update:modelValue",$),S("handleChange",$),!0},E=()=>{r.value=i.value,S("update:modelValue",i.value)},I=(k,x)=>{_(k),S("enter")},T=(k,x)=>{if(a.value){a.value=!1;return}s.saveOnBlur?_(k):E()},P=k=>{if(k===null||k===""){l.value=!0;return}l.value=Im(s.config,Number(k)),c.value=l.value?"":g()},M=(k,x)=>{a.value=!0,s.saveOnEscape?_(k):E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},D=k=>{P(k),S("onValidation",k)},F=()=>{a.value=!0,E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},O=()=>{var k;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(k=b.value)==null||k.focus()};return t({focus:()=>{var k;return(k=b.value)==null?void 0:k.focus()},blur:()=>{var k;return(k=b.value)==null?void 0:k.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>_(r.value),revert:E}),Qt(()=>{var k;(k=b.value)==null||k.focus()}),(k,x)=>Ke((K(),ie("div",lX,[ue(SS,{maxDecimalChar:u.value,modelValue:r.value,"onUpdate:modelValue":x[0]||(x[0]=$=>r.value=$),placeholder:v.value,validatorFnc:w,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:I,onBlur:T,onClear:O,onEscape:M,onCancel:F,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ie("span",cX,ht(c.value),1)):Xe("",!0)])),[[H(o),p.value]])}}),uX={key:2},dX={class:"wrapper-suffix"},hX={key:3},fX=Ct(st({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(null),i=V(0),a=V(null),l=V(null),c=q(()=>uP(s.config)),u=V(!1),d=q(()=>!!pe.value),h=n,f=()=>{u.value=!1,ne(),h("cancel")},p=V(!0),g=re=>{if(re===null||re===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=Im(s.config,Number(re)),w.value=S()},v=()=>{u.value=!0,W()},w=V(""),S=()=>{var de;const re=s.config.restricted_type.trim(),U=((de=s.config.restricted_value)==null?void 0:de.split(",").map(Number))||[],[ge,oe]=U,G={range:`Enter a value between ${ge} and ${oe}`,not:`These values are not allowed: ${U.join(", ")}`,exact:"Value is not allowed"}[re];return p.value?"":G},b=q(()=>{var U;const re=Number.parseInt(String((U=s.config)==null?void 0:U.format_value)||"2",10);return Number.isFinite(re)&&re>=0?re:2}),C=re=>{u.value=!0,r.value=re},_=()=>{u.value=!0,ne(),W()},E=re=>{i.value=re,u.value=!0,W()},I=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(U=>U.charAt(0).toUpperCase()+U.slice(1)).join("").replace(/Outline|Solid/g,""),T=V(null),P=V(!0),M=q(()=>{var re;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((re=r.value)==null?void 0:re.length)===0,wrapperRef:N,active:d,focus:s.focus,bordered:!0}}),D=V(null),F=q(()=>P.value),O=q(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:D,active:F,focus:P.value,bordered:!0})),{argsMain:k}=Co(O),{argsMain:x}=Co(M),$=V(null),W=()=>{vt(()=>{var re;(re=$.value)==null||re.focus()})},Q=re=>{var U;if(re.format_type==="dropdown"&&re.format_value)try{const ge=JSON.parse(re.format_value);if(Array.isArray(ge))return ge.map(oe=>({label:oe.name,value:oe.name,id:oe.name}))}catch(ge){console.error("Failed to parse dropdown options",ge)}return re.format_type=="number"&&re.restricted_type=="exact"?((U=re.restricted_value)==null?void 0:U.split(",").map(oe=>({label:re.mapping[`!${oe}`]||oe,value:oe,id:oe})))||[]:[]},ae=q(()=>Q(s.config)),ee=q(()=>{var re;return((re=ae.value.find(U=>U.value===r.value))==null?void 0:re.label)||r.value||"-"}),X=()=>{var re;if(c.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(c.value=="number"){const U=(re=l.value)==null?void 0:re.getValue();h("updateMetric",U||null)}else h("updateMetric",r.value||null);u.value=!1,ne()},{triggerRef:N,popupRef:z,hide:ne,isVisible:pe,show:ve}=yo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),we=()=>{switch(c.value){case"number":vt(()=>{var re;(re=l.value)==null||re.focus()});break;case"dropdown":ve(),vt(()=>{var re;(re=T.value)==null||re.focus()});break;case"rating":P.value=!0,vt(()=>{var re;(re=a.value)==null||re.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,u.value=!1},focus:we,hasChanges:()=>u.value}),Qt(()=>{vt(()=>{setTimeout(()=>{we()},300)})}),(re,U)=>(K(),ie("div",{class:te(re.$style["metric-editor"])},[c.value=="number"?(K(),Ue(DA,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[0]||(U[0]=ge=>r.value=ge),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(K(),Ue(_o,Wt({key:1,"tab-index":1},H(k),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:he(()=>[ue(_A,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":U[1]||(U[1]=ge=>i.value=ge),onHandleEnter:E,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:he(()=>[ue(lt,{source:"rating",src:I()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(K(),ie("div",uX,[ue(_o,Wt(H(x),{ref_key:"triggerRef",ref:N,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:he(({})=>[me("div",dX,[ue(lt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:he(()=>[Ke((K(),ie("span",null,[Qe(ht(ee.value||""),1)])),[[H(o),{content:ee.value}]])]),_:1},16),me("div",{ref_key:"popupRef",ref:z},[H(pe)?(K(),Ue(RA,{key:0,ref_key:"metricEditorDropdownRef",ref:T,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[2]||(U[2]=ge=>r.value=ge),onChange:_,onCancel:f},null,8,["config","modelValue"])):Xe("",!0)],512)])):(K(),ie("span",hX,"Formular")),Ke((K(),Ue(at,{ref_key:"confirmButtonRef",ref:$,onHandleClick:X,"tab-index":"1",onKeypress:[jn(kt(we,["shift","prevent"]),["tab"]),jn(kt(f,["prevent"]),["escape"])],disabled:!p.value},{default:he(()=>[ue(lt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[H(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),pX=Ct(st({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(!1),a=V(null),l=V(null),c=()=>{i.value=!i.value},u=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await vt(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const w={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&u()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];w&&w()};return tt(i,g=>{g&&r("open")}),t({hide:u,show:d}),(g,v)=>(K(),ie("div",{class:te([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[me("div",{class:te(g.$style["metric-label"]),onClick:kt(c,["stop"])},[Dt(g.$slots,"default",{open:i.value},()=>[Ke((K(),ie("span",{class:te(g.$style["metric-name"])},[Qe(ht(e.label),1)],2)),[[H(o),{content:e.label}]]),e.morpheme&&i.value?(K(),ie("small",{key:0,class:te(g.$style["metric-morpheme"])}," ("+ht(e.morpheme)+") ",3)):Xe("",!0)])],2),ue(xT,{mode:"out-in",name:"slide"},{default:he(()=>[i.value?(K(),Ue(fX,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Xe("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var Uu=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(Uu||{});function TA(e,t){return function(){return e.apply(t,arguments)}}const{toString:gX}=Object.prototype,{getPrototypeOf:RS}=Object,{iterator:Zm,toStringTag:IA}=Symbol,Xm=(e=>t=>{const n=gX.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mr=e=>(e=e.toLowerCase(),t=>Xm(t)===e),Jm=e=>t=>typeof t===e,{isArray:Wu}=Array,zu=Jm("undefined");function Cf(e){return e!==null&&!zu(e)&&e.constructor!==null&&!zu(e.constructor)&&ps(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const xA=Mr("ArrayBuffer");function mX(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xA(e.buffer),t}const vX=Jm("string"),ps=Jm("function"),FA=Jm("number"),bf=e=>e!==null&&typeof e=="object",yX=e=>e===!0||e===!1,Qm=e=>{if(Xm(e)!=="object")return!1;const t=RS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(IA in e)&&!(Zm in e)},wX=e=>{if(!bf(e)||Cf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},CX=Mr("Date"),bX=Mr("File"),SX=Mr("Blob"),EX=Mr("FileList"),_X=e=>bf(e)&&ps(e.pipe),RX=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ps(e.append)&&((t=Xm(e))==="formdata"||t==="object"&&ps(e.toString)&&e.toString()==="[object FormData]"))},DX=Mr("URLSearchParams"),[TX,IX,xX,FX]=["ReadableStream","Request","Response","Headers"].map(Mr),PX=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),Wu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Cf(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function PA(e,t){if(Cf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kA=e=>!zu(e)&&e!==ac;function DS(){const{caseless:e,skipUndefined:t}=kA(this)&&this||{},n={},o=(s,r)=>{const i=e&&PA(n,r)||r;Qm(n[i])&&Qm(s)?n[i]=DS(n[i],s):Qm(s)?n[i]=DS({},s):Wu(s)?n[i]=s.slice():(!t||!zu(s))&&(n[i]=s)};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Sf(arguments[s],o);return n}const kX=(e,t,n,{allOwnKeys:o}={})=>(Sf(t,(s,r)=>{n&&ps(s)?e[r]=TA(s,n):e[r]=s},{allOwnKeys:o}),e),AX=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),OX=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},MX=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&RS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},NX=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},LX=e=>{if(!e)return null;if(Wu(e))return e;let t=e.length;if(!FA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},VX=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&RS(Uint8Array)),BX=(e,t)=>{const o=(e&&e[Zm]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},$X=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},HX=Mr("HTMLFormElement"),GX=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),AA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),UX=Mr("RegExp"),OA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Sf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},WX=e=>{OA(e,(t,n)=>{if(ps(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(ps(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zX=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return Wu(e)?o(e):o(String(e).split(t)),n},jX=()=>{},KX=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qX(e){return!!(e&&ps(e.append)&&e[IA]==="FormData"&&e[Zm])}const YX=e=>{const t=new Array(10),n=(o,s)=>{if(bf(o)){if(t.indexOf(o)>=0)return;if(Cf(o))return o;if(!("toJSON"in o)){t[s]=o;const r=Wu(o)?[]:{};return Sf(o,(i,a)=>{const l=n(i,s+1);!zu(l)&&(r[a]=l)}),t[s]=void 0,r}}return o};return n(e,0)},ZX=Mr("AsyncFunction"),XX=e=>e&&(bf(e)||ps(e))&&ps(e.then)&&ps(e.catch),MA=((e,t)=>e?setImmediate:t?((n,o)=>(ac.addEventListener("message",({source:s,data:r})=>{s===ac&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ps(ac.postMessage)),JX=typeof queueMicrotask<"u"?queueMicrotask.bind(ac):typeof J<"u"&&J.nextTick||MA,Be={isArray:Wu,isArrayBuffer:xA,isBuffer:Cf,isFormData:RX,isArrayBufferView:mX,isString:vX,isNumber:FA,isBoolean:yX,isObject:bf,isPlainObject:Qm,isEmptyObject:wX,isReadableStream:TX,isRequest:IX,isResponse:xX,isHeaders:FX,isUndefined:zu,isDate:CX,isFile:bX,isBlob:SX,isRegExp:UX,isFunction:ps,isStream:_X,isURLSearchParams:DX,isTypedArray:VX,isFileList:EX,forEach:Sf,merge:DS,extend:kX,trim:PX,stripBOM:AX,inherits:OX,toFlatObject:MX,kindOf:Xm,kindOfTest:Mr,endsWith:NX,toArray:LX,forEachEntry:BX,matchAll:$X,isHTMLForm:HX,hasOwnProperty:AA,hasOwnProp:AA,reduceDescriptors:OA,freezeMethods:WX,toObjectSet:zX,toCamelCase:GX,noop:jX,toFiniteNumber:KX,findKey:PA,global:ac,isContextDefined:kA,isSpecCompliantForm:qX,toJSONObject:YX,isAsyncFn:ZX,isThenable:XX,setImmediate:MA,asap:JX,isIterable:e=>e!=null&&ps(e[Zm])};function Zt(e,t,n,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}Be.inherits(Zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const NA=Zt.prototype,LA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{LA[e]={value:e}}),Object.defineProperties(Zt,LA),Object.defineProperty(NA,"isAxiosError",{value:!0}),Zt.from=(e,t,n,o,s,r)=>{const i=Object.create(NA);Be.toFlatObject(e,i,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Zt.call(i,a,l,n,o,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",r&&Object.assign(i,r),i};const QX=null;function TS(e){return Be.isPlainObject(e)||Be.isArray(e)}function VA(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function BA(e,t,n){return e?e.concat(t).map(function(s,r){return s=VA(s),!n&&r?"["+s+"]":s}).join(n?".":""):t}function eJ(e){return Be.isArray(e)&&!e.some(TS)}const tJ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function ev(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const o=n.metaTokens,s=n.visitor||u,r=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new Zt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,v){let w=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=o?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&eJ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(w=Be.toArray(p)))return g=VA(g),w.forEach(function(b,C){!(Be.isUndefined(b)||b===null)&&t.append(i===!0?BA([g],C,r):i===null?g:g+"[]",c(b))}),!1}return TS(p)?!0:(t.append(BA(v,g,r),c(p)),!1)}const d=[],h=Object.assign(tJ,{defaultVisitor:u,convertValue:c,isVisitable:TS});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(w,S){(!(Be.isUndefined(w)||w===null)&&s.call(t,w,Be.isString(S)?S.trim():S,g,h))===!0&&f(w,g?g.concat(S):[S])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function $A(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function IS(e,t){this._pairs=[],e&&ev(e,this,t)}const HA=IS.prototype;HA.append=function(t,n){this._pairs.push([t,n])},HA.toString=function(t){const n=t?function(o){return t.call(this,o,$A)}:$A;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function nJ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function GA(e,t,n){if(!t)return e;const o=n&&n.encode||nJ;Be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let r;if(s?r=s(t,n):r=Be.isURLSearchParams(t)?t.toString():new IS(t,n).toString(o),r){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class UA{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(o){o!==null&&t(o)})}}const WA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:IS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xS=typeof window<"u"&&typeof document<"u",FS=typeof navigator=="object"&&navigator||void 0,sJ=xS&&(!FS||["ReactNative","NativeScript","NS"].indexOf(FS.product)<0),rJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iJ=xS&&window.location.href||"http://localhost",zo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xS,hasStandardBrowserEnv:sJ,hasStandardBrowserWebWorkerEnv:rJ,navigator:FS,origin:iJ},Symbol.toStringTag,{value:"Module"})),...oJ};function aJ(e,t){return ev(e,new zo.classes.URLSearchParams,{visitor:function(n,o,s,r){return zo.isNode&&Be.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function lJ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cJ(e){const t={},n=Object.keys(e);let o;const s=n.length;let r;for(o=0;o<s;o++)r=n[o],t[r]=e[r];return t}function zA(e){function t(n,o,s,r){let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&Be.isArray(s)?s.length:i,l?(Be.hasOwnProp(s,i)?s[i]=[s[i],o]:s[i]=o,!a):((!s[i]||!Be.isObject(s[i]))&&(s[i]=[]),t(n,o,s[i],r)&&Be.isArray(s[i])&&(s[i]=cJ(s[i])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(o,s)=>{t(lJ(o),s,n,0)}),n}return null}function uJ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Ef={transitional:WA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,r=Be.isObject(t);if(r&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return s?JSON.stringify(zA(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(o.indexOf("application/x-www-form-urlencoded")>-1)return aJ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ev(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||s?(n.setContentType("application/json",!1),uJ(t)):t}],transformResponse:[function(t){const n=this.transitional||Ef.transitional,o=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(o&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?Zt.from(a,Zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:zo.classes.FormData,Blob:zo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{Ef.headers[e]={}});const dJ=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hJ=e=>{const t={};let n,o,s;return e&&e.split(`
|
|
147
147
|
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),o=i.substring(s+1).trim(),!(!n||t[n]&&dJ[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},jA=Symbol("internals");function _f(e){return e&&String(e).trim().toLowerCase()}function tv(e){return e===!1||e==null?e:Be.isArray(e)?e.map(tv):String(e)}function fJ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const pJ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function PS(e,t,n,o,s){if(Be.isFunction(o))return o.call(this,t,n);if(s&&(t=n),!!Be.isString(t)){if(Be.isString(o))return t.indexOf(o)!==-1;if(Be.isRegExp(o))return o.test(t)}}function gJ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function mJ(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(s,r,i){return this[o].call(this,t,s,r,i)},configurable:!0})})}let gs=class{constructor(t){t&&this.set(t)}set(t,n,o){const s=this;function r(a,l,c){const u=_f(l);if(!u)throw new Error("header name must be a non-empty string");const d=Be.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||l]=tv(a))}const i=(a,l)=>Be.forEach(a,(c,u)=>r(c,u,l));if(Be.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(Be.isString(t)&&(t=t.trim())&&!pJ(t))i(hJ(t),n);else if(Be.isObject(t)&&Be.isIterable(t)){let a={},l,c;for(const u of t){if(!Be.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?Be.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}i(a,n)}else t!=null&&r(n,t,o);return this}get(t,n){if(t=_f(t),t){const o=Be.findKey(this,t);if(o){const s=this[o];if(!n)return s;if(n===!0)return fJ(s);if(Be.isFunction(n))return n.call(this,s,o);if(Be.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=_f(t),t){const o=Be.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||PS(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let s=!1;function r(i){if(i=_f(i),i){const a=Be.findKey(o,i);a&&(!n||PS(o,o[a],a,n))&&(delete o[a],s=!0)}}return Be.isArray(t)?t.forEach(r):r(t),s}clear(t){const n=Object.keys(this);let o=n.length,s=!1;for(;o--;){const r=n[o];(!t||PS(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const n=this,o={};return Be.forEach(this,(s,r)=>{const i=Be.findKey(o,r);if(i){n[i]=tv(s),delete n[r];return}const a=t?gJ(r):String(r).trim();a!==r&&delete n[r],n[a]=tv(s),o[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(o,s)=>{o!=null&&o!==!1&&(n[s]=t&&Be.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
148
148
|
`)}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 o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[jA]=this[jA]={accessors:{}}).accessors,s=this.prototype;function r(i){const a=_f(i);o[a]||(mJ(s,i),o[a]=!0)}return Be.isArray(t)?t.forEach(r):r(t),this}};gs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(gs.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),Be.freezeMethods(gs);function kS(e,t){const n=this||Ef,o=t||n,s=gs.from(o.headers);let r=o.data;return Be.forEach(e,function(a){r=a.call(n,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function KA(e){return!!(e&&e.__CANCEL__)}function ju(e,t,n){Zt.call(this,e??"canceled",Zt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(ju,Zt,{__CANCEL__:!0});function qA(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new Zt("Request failed with status code "+n.status,[Zt.ERR_BAD_REQUEST,Zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vJ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yJ(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,r=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=o[r];i||(i=c),n[s]=l,o[s]=c;let d=r,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===r&&(r=(r+1)%e),c-i<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function wJ(e,t){let n=0,o=1e3/t,s,r;const i=(c,u=Date.now())=>{n=u,s=null,r&&(clearTimeout(r),r=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=o?i(c,u):(s=c,r||(r=setTimeout(()=>{r=null,i(s)},o-d)))},()=>s&&i(s)]}const nv=(e,t,n=3)=>{let o=0;const s=yJ(50,250);return wJ(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,l=i-o,c=s(l),u=i<=a;o=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},YA=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ZA=e=>(...t)=>Be.asap(()=>e(...t)),CJ=zo.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,zo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(zo.origin),zo.navigator&&/(msie|trident)/i.test(zo.navigator.userAgent)):()=>!0,bJ=zo.hasStandardBrowserEnv?{write(e,t,n,o,s,r,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(o)&&a.push(`path=${o}`),Be.isString(s)&&a.push(`domain=${s}`),r===!0&&a.push("secure"),Be.isString(i)&&a.push(`SameSite=${i}`),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 SJ(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function EJ(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function XA(e,t,n){let o=!SJ(t);return e&&(o||n==!1)?EJ(e,t):t}const JA=e=>e instanceof gs?{...e}:e;function lc(e,t){t=t||{};const n={};function o(c,u,d,h){return Be.isPlainObject(c)&&Be.isPlainObject(u)?Be.merge.call({caseless:h},c,u):Be.isPlainObject(u)?Be.merge({},u):Be.isArray(u)?u.slice():u}function s(c,u,d,h){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return o(void 0,c,d,h)}else return o(c,u,d,h)}function r(c,u){if(!Be.isUndefined(u))return o(void 0,u)}function i(c,u){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return o(void 0,c)}else return o(void 0,u)}function a(c,u,d){if(d in t)return o(c,u);if(d in e)return o(void 0,c)}const l={url:r,method:r,data:r,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,u,d)=>s(JA(c),JA(u),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||s,h=d(e[u],t[u],u);Be.isUndefined(h)&&d!==a||(n[u]=h)}),n}const QA=e=>{const t=lc({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:r,headers:i,auth:a}=t;if(t.headers=i=gs.from(i),t.url=GA(XA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(zo.hasStandardBrowserEnv||zo.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&i.set(u,d)})}}if(zo.hasStandardBrowserEnv&&(o&&Be.isFunction(o)&&(o=o(t)),o||o!==!1&&CJ(t.url))){const l=s&&r&&bJ.read(r);l&&i.set(s,l)}return t},_J=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const s=QA(e);let r=s.data;const i=gs.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,u,d,h,f,p;function g(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function w(){if(!v)return;const b=gs.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};qA(function(I){n(I),g()},function(I){o(I),g()},_),v=null}"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(w)},v.onabort=function(){v&&(o(new Zt("Request aborted",Zt.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const _=C&&C.message?C.message:"Network Error",E=new Zt(_,Zt.ERR_NETWORK,e,v);E.event=C||null,o(E),v=null},v.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||WA;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),o(new Zt(C,_.clarifyTimeoutError?Zt.ETIMEDOUT:Zt.ECONNABORTED,e,v)),v=null},r===void 0&&i.setContentType(null),"setRequestHeader"in v&&Be.forEach(i.toJSON(),function(C,_){v.setRequestHeader(_,C)}),Be.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),c&&([h,p]=nv(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=nv(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(u=b=>{v&&(o(!b||b.type?new ju(null,e,v):b),v.abort(),v=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const S=vJ(s.url);if(S&&zo.protocols.indexOf(S)===-1){o(new Zt("Unsupported protocol "+S+":",Zt.ERR_BAD_REQUEST,e));return}v.send(r||null)})},RJ=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,s;const r=function(c){if(!s){s=!0,a();const u=c instanceof Error?c:this.reason;o.abort(u instanceof Zt?u:new ju(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,r(new Zt(`timeout ${t} of ms exceeded`,Zt.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),e=null)};e.forEach(c=>c.addEventListener("abort",r));const{signal:l}=o;return l.unsubscribe=()=>Be.asap(a),l}},DJ=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,s;for(;o<n;)s=o+t,yield e.slice(o,s),o=s},TJ=async function*(e,t){for await(const n of IJ(e))yield*DJ(n,t)},IJ=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},eO=(e,t,n,o)=>{const s=TJ(e,t);let r=0,i,a=l=>{i||(i=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},tO=64*1024,{isFunction:ov}=Be,xJ=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:nO,TextEncoder:oO}=Be.global,sO=(e,...t)=>{try{return!!e(...t)}catch{return!1}},FJ=e=>{e=Be.merge.call({skipUndefined:!0},xJ,e);const{fetch:t,Request:n,Response:o}=e,s=t?ov(t):typeof fetch=="function",r=ov(n),i=ov(o);if(!s)return!1;const a=s&&ov(nO),l=s&&(typeof oO=="function"?(p=>g=>p.encode(g))(new oO):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=r&&a&&sO(()=>{let p=!1;const g=new n(zo.origin,{body:new nO,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=i&&a&&sO(()=>Be.isReadableStream(new o("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let w=g&&g[p];if(w)return w.call(g);throw new Zt(`Response type '${p}' is not supported`,Zt.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(zo.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:w,signal:S,cancelToken:b,timeout:C,onDownloadProgress:_,onUploadProgress:E,responseType:I,headers:T,withCredentials:P="same-origin",fetchOptions:M}=QA(p),D=t||fetch;I=I?(I+"").toLowerCase():"text";let F=RJ([S,b&&b.toAbortSignal()],C),O=null;const k=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let x;try{if(E&&c&&v!=="get"&&v!=="head"&&(x=await f(T,w))!==0){let X=new n(g,{method:"POST",body:w,duplex:"half"}),N;if(Be.isFormData(w)&&(N=X.headers.get("content-type"))&&T.setContentType(N),X.body){const[z,ne]=YA(x,nv(ZA(E)));w=eO(X.body,tO,z,ne)}}Be.isString(P)||(P=P?"include":"omit");const $=r&&"credentials"in n.prototype,W={...M,signal:F,method:v.toUpperCase(),headers:T.normalize().toJSON(),body:w,duplex:"half",credentials:$?P:void 0};O=r&&new n(g,W);let Q=await(r?D(O,M):D(g,W));const ae=u&&(I==="stream"||I==="response");if(u&&(_||ae&&k)){const X={};["status","statusText","headers"].forEach(pe=>{X[pe]=Q[pe]});const N=Be.toFiniteNumber(Q.headers.get("content-length")),[z,ne]=_&&YA(N,nv(ZA(_),!0))||[];Q=new o(eO(Q.body,tO,z,()=>{ne&&ne(),k&&k()}),X)}I=I||"text";let ee=await d[Be.findKey(d,I)||"text"](Q,p);return!ae&&k&&k(),await new Promise((X,N)=>{qA(X,N,{data:ee,headers:gs.from(Q.headers),status:Q.status,statusText:Q.statusText,config:p,request:O})})}catch($){throw k&&k(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new Zt("Network Error",Zt.ERR_NETWORK,p,O),{cause:$.cause||$}):Zt.from($,$&&$.code,p,O)}}},PJ=new Map,rO=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:s}=t,r=[o,s,n];let i=r.length,a=i,l,c,u=PJ;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:FJ(t)),u=c;return c};rO();const AS={http:QX,xhr:_J,fetch:{get:rO}};Be.forEach(AS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const iO=e=>`- ${e}`,kJ=e=>Be.isFunction(e)||e===null||e===!1;function AJ(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let o,s;const r={};for(let i=0;i<n;i++){o=e[i];let a;if(s=o,!kJ(o)&&(s=AS[(a=String(o)).toLowerCase()],s===void 0))throw new Zt(`Unknown adapter '${a}'`);if(s&&(Be.isFunction(s)||(s=s.get(t))))break;r[a||"#"+i]=s}if(!s){const i=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
149
149
|
`+i.map(iO).join(`
|
|
150
150
|
`):" "+iO(i[0]):"as no adapter specified";throw new Zt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const aO={getAdapter:AJ,adapters:AS};function OS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ju(null,e)}function lO(e){return OS(e),e.headers=gs.from(e.headers),e.data=kS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),aO.getAdapter(e.adapter||Ef.adapter,e)(e).then(function(o){return OS(e),o.data=kS.call(e,e.transformResponse,o),o.headers=gs.from(o.headers),o},function(o){return KA(o)||(OS(e),o&&o.response&&(o.response.data=kS.call(e,e.transformResponse,o.response),o.response.headers=gs.from(o.response.headers))),Promise.reject(o)})}const cO="1.13.2",sv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sv[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const uO={};sv.transitional=function(t,n,o){function s(r,i){return"[Axios v"+cO+"] Transitional option '"+r+"'"+i+(o?". "+o:"")}return(r,i,a)=>{if(t===!1)throw new Zt(s(i," has been removed"+(n?" in "+n:"")),Zt.ERR_DEPRECATED);return n&&!uO[i]&&(uO[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(r,i,a):!0}},sv.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function OJ(e,t,n){if(typeof e!="object")throw new Zt("options must be an object",Zt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const r=o[s],i=t[r];if(i){const a=e[r],l=a===void 0||i(a,r,e);if(l!==!0)throw new Zt("option "+r+" must be "+l,Zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Zt("Unknown option "+r,Zt.ERR_BAD_OPTION)}}const rv={assertOptions:OJ,validators:sv},di=rv.validators;let cc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new UA,response:new UA}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{o.stack?r&&!String(o.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
151
151
|
`+r):o.stack=r}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=lc(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:r}=n;o!==void 0&&rv.assertOptions(o,{silentJSONParsing:di.transitional(di.boolean),forcedJSONParsing:di.transitional(di.boolean),clarifyTimeoutError:di.transitional(di.boolean)},!1),s!=null&&(Be.isFunction(s)?n.paramsSerializer={serialize:s}:rv.assertOptions(s,{encode:di.function,serialize:di.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),rv.assertOptions(n,{baseUrl:di.spelling("baseURL"),withXsrfToken:di.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=r&&Be.merge(r.common,r[n.method]);r&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),n.headers=gs.concat(i,r);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 c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[lO.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}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{u=lO.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=lc(this.defaults,t);const n=XA(t.baseURL,t.url,t.allowAbsoluteUrls);return GA(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){cc.prototype[t]=function(n,o){return this.request(lc(o||{},{method:t,url:n,data:(o||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(o){return function(r,i,a){return this.request(lc(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}cc.prototype[t]=n(),cc.prototype[t+"Form"]=n(!0)});let MJ=class pH{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const o=this;this.promise.then(s=>{if(!o._listeners)return;let r=o._listeners.length;for(;r-- >0;)o._listeners[r](s);o._listeners=null}),this.promise.then=s=>{let r;const i=new Promise(a=>{o.subscribe(a),r=a}).then(s);return i.cancel=function(){o.unsubscribe(r)},i},t(function(r,i,a){o.reason||(o.reason=new ju(r,i,a),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new pH(function(s){t=s}),cancel:t}}};function NJ(e){return function(n){return e.apply(null,n)}}function LJ(e){return Be.isObject(e)&&e.isAxiosError===!0}const MS={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(MS).forEach(([e,t])=>{MS[t]=e});function dO(e){const t=new cc(e),n=TA(cc.prototype.request,t);return Be.extend(n,cc.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return dO(lc(e,s))},n}const Qn=dO(Ef);Qn.Axios=cc,Qn.CanceledError=ju,Qn.CancelToken=MJ,Qn.isCancel=KA,Qn.VERSION=cO,Qn.toFormData=ev,Qn.AxiosError=Zt,Qn.Cancel=Qn.CanceledError,Qn.all=function(t){return Promise.all(t)},Qn.spread=NJ,Qn.isAxiosError=LJ,Qn.mergeConfig=lc,Qn.AxiosHeaders=gs,Qn.formToJSON=e=>zA(Be.isHTMLForm(e)?new FormData(e):e),Qn.getAdapter=aO.getAdapter,Qn.HttpStatusCode=MS,Qn.default=Qn;const{Axios:LRe,AxiosError:VRe,CanceledError:BRe,isCancel:$Re,CancelToken:HRe,VERSION:GRe,all:URe,Cancel:WRe,isAxiosError:VJ,spread:zRe,toFormData:jRe,AxiosHeaders:KRe,HttpStatusCode:qRe,formToJSON:YRe,getAdapter:ZRe,mergeConfig:XRe}=Qn;class Rf extends Error{constructor(t,n,o,s,r){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=r,Object.setPrototypeOf(this,Rf.prototype)}}const BJ=e=>{var t,n;if(VJ(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,r=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",i=(s==null?void 0:s.code)||e.code,a=(s==null?void 0:s.details)||s;let l="UNKNOWN";return!o||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":o>=500?l="SERVER":o===Uu.UNAUTHORIZED||o===Uu.FORBIDDEN?l="AUTH":o===Uu.UNPROCESSABLE_ENTITY||o===Uu.BAD_REQUEST?l="VALIDATION":o>=Uu.BAD_REQUEST&&(l="CLIENT"),new Rf(r,o,i,a,l)}return e instanceof Error?new Rf(e.message,void 0,void 0,void 0,"UNKNOWN"):new Rf("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};let $J=class extends Error{},Ya=class extends $J{constructor(){super("Zone is an abstract class")}},hO=class{get type(){throw new Ya}get name(){throw new Ya}get ianaName(){return this.name}get isUniversal(){throw new Ya}offsetName(t,n){throw new Ya}formatOffset(t,n){throw new Ya}offset(t){throw new Ya}equals(t){throw new Ya}get isValid(){throw new Ya}};const NS=new Map;function HJ(e){let t=NS.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"}),NS.set(e,t)),t}const GJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function UJ(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function WJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=GJ[r];r==="era"?o[a]=i:iv(a)||(o[a]=parseInt(i,10))}return o}const LS=new Map;let zJ=class FR extends hO{static create(t){let n=LS.get(t);return n===void 0&&LS.set(t,n=new FR(t)),n}static resetCache(){LS.clear(),NS.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=FR.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return YJ(t,n,o,this.name)}formatOffset(t,n){return lv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=HJ(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?WJ(o,n):UJ(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=qJ({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},VS=null,jJ=class zp extends hO{static get utcInstance(){return VS===null&&(VS=new zp(0)),VS}static instance(t){return t===0?zp.utcInstance:new zp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new zp(pO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${lv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${lv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return lv(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 iv(e){return typeof e>"u"}function av(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function fO(e){if(!(iv(e)||e===null||e===""))return parseInt(e,10)}function KJ(e){if(!(iv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function qJ(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 YJ(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function pO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function lv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${av(n,2)}:${av(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${av(n,2)}${av(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const gO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ku(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function qu(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function mO(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=fO(t[n+s]);return[o,null,n+s]}}const vO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,ZJ=`(?:${vO.source}?(?:\\[(${gO.source})\\])?)?`,yO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,wO=RegExp(`${yO.source}${ZJ}`),BS=RegExp(`(?:[Tt]${wO.source})?`),XJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,JJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,QJ=/(\d{4})-?(\d{3})/,eQ=mO("weekYear","weekNumber","weekDay"),tQ=mO("year","ordinal"),nQ=/(\d{4})-(\d\d)-(\d\d)/,CO=RegExp(`${yO.source} ?(?:${vO.source}|(${gO.source}))?`),oQ=RegExp(`(?: ${CO.source})?`);function Yu(e,t,n){const o=e[t];return iv(o)?n:fO(o)}function sQ(e,t){return[{year:Yu(e,t),month:Yu(e,t+1,1),day:Yu(e,t+2,1)},null,t+3]}function Zu(e,t){return[{hours:Yu(e,t,0),minutes:Yu(e,t+1,0),seconds:Yu(e,t+2,0),milliseconds:KJ(e[t+3])},null,t+4]}function Df(e,t){const n=!e[t]&&!e[t+1],o=pO(e[t+1],e[t+2]),s=n?null:jJ.instance(o);return[{},s,t+3]}function Tf(e,t){const n=e[t]?zJ.create(e[t]):null;return[{},n,t+1]}Ku(XJ,BS),Ku(JJ,BS),Ku(QJ,BS),Ku(wO),qu(sQ,Zu,Df,Tf),qu(eQ,Zu,Df,Tf),qu(tQ,Zu,Df,Tf),qu(Zu,Df,Tf),qu(Zu),Ku(nQ,oQ),Ku(CO),qu(Zu,Df,Tf);function bO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function SO(e,t,n,o,s,r,i){try{var a=e[r](i),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(o,s)}function $S(e){return function(){var t=this,n=arguments;return new Promise(function(o,s){var r=e.apply(t,n);function i(l){SO(r,o,s,i,a,"next",l)}function a(l){SO(r,o,s,i,a,"throw",l)}i(void 0)})}}function HS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rQ(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,RO(o.key),o)}}function GS(e,t,n){return t&&rQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iQ(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=uQ(e))||t){n&&(e=n);var o=0,s=function(){};return{s,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
152
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,r=l},f:function(){try{i||n.return==null||n.return()}finally{if(a)throw r}}}}function US(e,t,n){return(t=RO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function _O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EO(Object(n),!0).forEach(function(o){US(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function aQ(e,t){if(e==null)return{};var n,o,s=lQ(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function lQ(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function uc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(f,p,g,v){var w=p&&p.prototype instanceof a?p:a,S=Object.create(w.prototype);return Ms(S,"_invoke",function(b,C,_){var E,I,T,P=0,M=_||[],D=!1,F={p:0,n:0,v:e,a:O,f:O.bind(e,4),d:function(k,x){return E=k,I=0,T=e,F.n=x,i}};function O(k,x){for(I=k,T=x,t=0;!D&&P&&!$&&t<M.length;t++){var $,W=M[t],Q=F.p,ae=W[2];k>3?($=ae===x)&&(T=W[(I=W[4])?5:(I=3,3)],W[4]=W[5]=e):W[0]<=Q&&(($=k<2&&Q<W[1])?(I=0,F.v=x,F.n=W[1]):Q<ae&&($=k<3||W[0]>x||x>ae)&&(W[4]=k,W[5]=x,F.n=ae,I=0))}if($||k>1)return i;throw D=!0,x}return function(k,x,$){if(P>1)throw TypeError("Generator is already running");for(D&&x===1&&O(x,$),I=x,T=$;(t=I<2?e:T)||!D;){E||(I?I<3?(I>1&&(F.n=-1),O(I,T)):F.n=T:F.v=T);try{if(P=2,E){if(I||(k="next"),t=E[k]){if(!(t=t.call(E,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,I<2&&(I=0)}else I===1&&(t=E.return)&&t.call(E),I<2&&(T=TypeError("The iterator does not provide a '"+k+"' method"),I=1);E=e}else if((t=(D=F.n<0)?T:b.call(C,F))!==i)break}catch(W){E=e,I=1,T=W}finally{P=1}}return{value:t,done:D}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(Ms(t={},o,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,c):(f.__proto__=c,Ms(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=c,Ms(d,"constructor",c),Ms(c,"constructor",l),l.displayName="GeneratorFunction",Ms(c,s,"GeneratorFunction"),Ms(d),Ms(d,s,"Generator"),Ms(d,o,function(){return this}),Ms(d,"toString",function(){return"[object Generator]"}),(uc=function(){return{w:r,m:h}})()}function Ms(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}Ms=function(r,i,a,l){function c(u,d){Ms(r,u,function(h){return this._invoke(u,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(c("next",0),c("throw",1),c("return",2))},Ms(e,t,n,o)}function cQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RO(e){var t=cQ(e,"string");return typeof t=="symbol"?t:t+""}function uQ(e,t){if(e){if(typeof e=="string")return bO(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bO(e,t):void 0}}var dQ=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"],hQ=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};HS(this,e),this.accessTokenKey=o.accessTokenKey||"access_token",this.refreshTokenKey=o.refreshTokenKey||"refresh_token",this.domain=o.domain,this.path=o.path||"/",this.secure=(t=o.secure)!==null&&t!==void 0?t:!0,this.sameSite=o.sameSite||"lax",this.canSetTokens=(n=o.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=o.cookieParser}return GS(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=iQ(o),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(i=i.trim(),i.startsWith(n+"=")){var a=i.substring(n.length+1);return this.cookieParser?this.cookieParser(a,n):decodeURIComponent(a)}}}catch(l){s.e(l)}finally{s.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(n){if(!this.canSetTokens||typeof document>"u"){console.warn("CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}var o=this.domain?"; domain=".concat(this.domain):"",s=this.secure?"; secure":"",r="; samesite=".concat(this.sameSite),i="",a="";if(n.expires_in&&typeof n.expires_in=="number"){var l=new Date;l.setTime(l.getTime()+n.expires_in*1e3),i=";expires=".concat(l.toUTCString())}var c=this.getExpiresInRefreshToken();if(sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refresh token",n),console.log("[DEBUG] refresh token expires_in value",c)),c){var u=new Date;u.setTime(u.getTime()+Number(c)*1e3),a=";expires=".concat(u.toUTCString())}if(n.access_token||n.token){var d=n.access_token||n.token,h="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(d),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(i);document.cookie=h}if(n.refresh_token_expires_in&&typeof n.refresh_token_expires_in=="number"){var f=new Date;f.setTime(f.getTime()+n.refresh_token_expires_in*1e3),i=";expires=".concat(f.toUTCString())}if(n.refresh_token){sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refesh token set to",n.refresh_token),console.log("[DEBUG] refresh token expires_in set to",a));var p="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(n.refresh_token),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(a);document.cookie=p}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),fQ=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";HS(this,e),US(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return GS(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(n){console.error("Failed to create BroadcastChannel, falling back to storage events:",n),this.channel=null}}},{key:"broadcastEvent",value:function(n){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={type:n,data:s,timestamp:Date.now()};this.channel?this.channel.postMessage(r):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(r)),setTimeout(function(){return localStorage.removeItem(o.storageKey)},100))}},{key:"onEvent",value:function(n){var o=this;return this.channel?this.channel.onmessage=function(s){n(s.data)}:typeof window<"u"&&window.addEventListener("storage",function(s){if(s.key===o.storageKey&&s.newValue)try{var r=JSON.parse(s.newValue);n(r)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){o.channel?o.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),pQ=function(){function e(t){var n=this;HS(this,e),US(this,"currentAttempt",0),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new fQ,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){console.log("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(o){console.error("Token refresh failed:",o)},this.onTokenInvalid=t.onTokenInvalid||function(){console.log("Token is invalid or cannot be refreshed");var o=new Error("No refresh token available");n.onRefreshFailure(o),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"})}}return GS(e,[{key:"initCrossTabListener",value:function(){var n=this;this.authStateManager.onEvent(function(o){o.type==="auth:logout"&&(console.log("Received logout event:",o.data),o.data&&o.data.sourceInstanceId!==n.instanceId?(console.log("Logout event from different tab, executing logout handlers"),n.onCrossTabLogout?(console.log("Executing onCrossTabLogout with reason: ".concat(o.data.reason||"cross_tab_logout")),n.onCrossTabLogout(o.data.reason||"cross_tab_logout")):typeof n.onLogout=="function"?(console.log("Executing legacy onLogout with reason: ".concat(o.data.reason)),n.onLogout(o.data.reason)):console.warn("No logout handler defined for cross-tab events")):console.log("Ignoring self-generated logout event"))})}},{key:"handleTokenRefresh",value:function(){var t=$S(uc().m(function o(){var s=this,r,i,a,l;return uc().w(function(c){for(;;)switch(c.p=c.n){case 0:if(r=this.tokenStorage.getRefreshToken(),sessionStorage.getItem("APP_DEBUG")&&console.log("[DEBUG] on handle token refresh",r),r){c.n=1;break}return console.log("No refresh token available"),this.onTokenInvalid(),c.a(2,!1);case 1:return this.currentAttempt=0,c.p=2,c.n=3,this.executeWithRetry(function(){return console.log("Refresh attempt ".concat(s.currentAttempt+1,"/").concat(s.maxRetries)),s.refreshTokenFn(s.tokenStorage.getRefreshToken())});case 3:if(i=c.v,!(!i||!i.access_token&&!i.token)){c.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return i.token&&!i.access_token&&(i.access_token=i.token),console.log("Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(i),this.onRefreshSuccess(i),c.a(2,!0);case 5:return c.p=5,l=c.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((a=l)===null||a===void 0?void 0:a.message)||"Token refresh failed after maximum retries"}),c.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=$S(uc().m(function o(s){var r,i,a;return uc().w(function(l){for(;;)switch(l.p=l.n){case 0:return l.p=0,l.n=1,s();case 1:return l.a(2,l.v);case 2:if(l.p=2,a=l.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){l.n=3;break}throw console.log("Maximum retry attempts (".concat(this.maxRetries,") reached")),a;case 3:return r=a.response&&a.response.status===425,i=r?this.getRetryAfterDelay(a):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),console.log("Retry in ".concat(i,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),l.n=4,new Promise(function(c){return setTimeout(c,i)});case 4:return l.a(2,this.executeWithRetry(s))}},o,this,[[0,2]])}));function n(o){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(n){if(n.response&&n.response.headers){var o=n.response.headers["retry-after"];if(o){var s=parseInt(o,10);if(!isNaN(s))return s*1e3;var r=new Date(o);if(!isNaN(r.getTime()))return r.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";console.log("Broadcasting logout event with reason: ".concat(n)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,timestamp:Date.now()})}}])}();function gQ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=n.tokenExpiredDetection,s=o===void 0?function(u){var d;return((d=u.response)===null||d===void 0?void 0:d.status)===401}:o,r=n.retryStatusCodes,i=r===void 0?[401,425]:r,a=n.tokenHeaderFormatter,l=a===void 0?function(u){return"Bearer ".concat(u)}:a,c=null;e.interceptors.response.use(function(u){return u},function(){var u=$S(uc().m(function d(h){var f,p,g,v,w,S,b,C,_;return uc().w(function(E){for(;;)switch(E.p=E.n){case 0:if(v=h.config,v){E.n=1;break}return E.a(2,Promise.reject(h));case 1:if(!v._retry){E.n=2;break}return E.a(2,Promise.reject(h));case 2:if(w=(f=h.response)===null||f===void 0?void 0:f.status,!(!w||!i.includes(w)||!s(h))){E.n=3;break}return E.a(2,Promise.reject(h));case 3:if(S=((p=v.url)===null||p===void 0?void 0:p.includes("refresh-token"))||((g=v.url)===null||g===void 0?void 0:g.includes("refreshToken")),!S){E.n=4;break}return E.a(2,Promise.reject(h));case 4:return v._retry=!0,E.p=5,c?console.log("Using existing refresh promise"):(console.log("Starting token refresh"),c=t.handleTokenRefresh()),E.n=6,c;case 6:if(b=E.v,c=null,b){E.n=7;break}return console.log("Token refresh failed"),E.a(2,Promise.reject(h));case 7:return C=t.tokenStorage.getAccessToken(),C&&(v.headers.Authorization=l(C)),console.log("Retrying original request with new token"),E.a(2,e(v));case 8:return E.p=8,_=E.v,console.error("Error during refresh:",_),c=null,E.a(2,Promise.reject(h))}},d,null,[[5,8]])}));return function(d){return u.apply(this,arguments)}}()),e.interceptors.request.use(function(u){if(u.headers.Authorization)return u;var d=t.tokenStorage.getAccessToken();return d&&(u.headers.Authorization=l(d)),u},function(u){return Promise.reject(u)})}function mQ(e){var t=e.accessTokenKey,n=e.refreshTokenKey,o=e.domain,s=e.path,r=e.secure,i=e.sameSite,a=e.canSetTokens,l=e.cookieParser,c=aQ(e,dQ),u=new hQ({accessTokenKey:t,refreshTokenKey:n,domain:o,path:s,secure:r,sameSite:i,canSetTokens:a,cookieParser:l});return new pQ(_O(_O({},c),{},{storage:u}))}var Ro=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Ro||{});Ro.review,Ro.review_take,Ro.review_scene,Ro.review_rendition,Ro.review_frame,Ro.review_rendition_comment,Ro.review_comment,Ro.scene_hub,Ro.hub_rendition,Ro.hub_comment,Ro.people_insight,Ro.people_detail,Ro.project,Ro.woohoo,Ro.update,Ro.core,Ro.project_focusMode;const cv={accessToken:"account.token",refreshToken:"account.refresh_token"},DO={baseUrl:"BASE_URL",cookieDomain:"BASE_DOMAIN_COOKIE"},TO="/refresh-token",vQ=3e5,yQ="*",IO={Accept:"application/json","Content-Type":"application/json"},wQ="undefined",CQ="No access token found",dc={badRequest:400,unauthorized:401,tooEarly:425},bQ=[dc.unauthorized,dc.tooEarly,dc.badRequest],SQ={maxRetries:5,retryDelay:500,backoffFactor:1.5},EQ="unauthenticated",_Q="invalid_token",RQ="refresh_token_expired",DQ={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},TQ="Session refreshed successfully",IQ="Session expired. Please log in again.",xQ=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},FQ=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==dc.badRequest?!1:xQ((n=e.response)==null?void 0:n.data)===_Q},PQ=()=>{},xO=e=>sessionStorage.getItem(e)||"",WS=()=>{const e=Fm.get(cv.accessToken);return e&&e!==wQ?e:null},kQ=()=>!!Fm.get(cv.refreshToken),AQ=()=>{const e=window.location.origin,t=xO(DO.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class zS{constructor(t,n=PQ,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=mQ({accessTokenKey:cv.accessToken,refreshTokenKey:cv.refreshToken,domain:xO(DO.cookieDomain)||void 0,secure:window.location.protocol==="https:",sameSite:"lax",refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(TQ,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(IQ,"error"),this.handleAuthExpired()},onCrossTabLogout:()=>this.handleAuthExpired(),...SQ});this.handler=t,gQ(this.client,t,{retryStatusCodes:[...bQ],tokenExpiredDetection:zS.isTokenExpired})}refreshAccessToken(){return!this.handler||!kQ()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var i,a;const n=(i=t==null?void 0:t.response)==null?void 0:i.status;if(n===dc.tooEarly)return!0;const{error:o,details:s={}}=((a=t==null?void 0:t.response)==null?void 0:a.data)??{},r=typeof o=="string"?o:o==null?void 0:o.key;return n===dc.badRequest||n!==dc.unauthorized||typeof o=="string"||r!==EQ?!1:Object.keys(s).length===0||s.reason===RQ}async refresh(t){const n=await this.client.post(TO,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return console.log("Refreshing tokens:",{tokens:o,res:n}),{access_token:o.access_token,refresh_token:o.refresh_token,expires_in:o.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(DQ,AQ())}}class OQ{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=Qn.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??vQ,headers:{...IO,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,o){return this.request({...o,method:"POST",url:t,data:n})}put(t,n,o){return this.request({...o,method:"PUT",url:t,data:n})}patch(t,n,o){return this.request({...o,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:o,requireToken:s}=this.options;typeof n=="function"&&(t.baseURL=n());const r=t.url===TO,i=r?WS():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(CQ);t.headers.set("Accept-Language",yQ),t.headers.has("Content-Type")||t.headers.set("Content-Type",IO["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),i&&t.headers.set("Authorization",`Bearer ${i}`);for(const[a,l]of Object.entries((o==null?void 0:o(t))??{}))t.headers.set(a,l);return t})}async resolveAccessToken(){const t=WS();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),WS())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:o,onError:s}=this.options;t&&(this.tokenRefresher=new zS(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(FQ(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const MQ=5,NQ=1e3,LQ=3,VQ="default",BQ=e=>new URL(e,"http://localhost").pathname;class $Q{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??MQ,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??NQ}async run(t,n){const o=this.resolveGroup(t);await this.acquire(o);try{return await n()}finally{this.release(o)}}resolveGroup(t){const n=BQ(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:VQ;let r=this.groups.get(s);return r||(r={limit:(o==null?void 0:o.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(s,r)),r}acquire(t){return new Promise(n=>{const o=()=>{t.ongoing++,n()};t.ongoing<t.limit?o():t.queue.push(o)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const HQ=(e,t)=>{const n=new $Q(t),o=Qn.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},GQ=(e,{maxRetries:t=LQ}={})=>{e.interceptors.response.use(void 0,async n=>{var a,l;const o=n.config;if(((a=n.response)==null?void 0:a.status)!==429||!o)return Promise.reject(n);const s=(o._retryCount??0)+1;if(s>t)return Promise.reject(n);o._retryCount=s;const r=Number.parseInt(String(((l=n.response.headers)==null?void 0:l["retry-after"])??""),10),i=Number.isNaN(r)?2**s*1e3:r*1e3;return await new Promise(c=>setTimeout(c,i)),e.request(o)})},UQ=6e4,WQ="/start",zQ=(e=WQ)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;console.log("Redirecting to auth URL:",n),window.location.replace(n)};function jQ(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class KQ{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>jQ("API_BASE_URL","");this.callbackFunc=t,this.api=new OQ({baseURL:i,timeout:UQ,requireToken:!0,onAuthExpired:zQ,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&HQ(this.axios,o),s!==!1&&GQ(this.axios,s)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(s,String(i))):typeof r=="object"?n.append(s,JSON.stringify(r)):n.append(s,String(r)))});const o=n.toString();return o?`?${o}`:""}async send(t,n,{params:o,data:s,options:r}={}){try{const i=o?this.buildQueryParams(o):"",a={...r,method:t,url:`${this.buildUrl(n)}${i}`};return s!==void 0&&(a.data=s),(await this.axios.request(a)).data}catch(i){throw BJ(i)}}get(t="",n,o){return this.send("GET",t,{params:n,options:o})}post(t="",n,o,s){return this.send("POST",t,{params:n,data:o,options:s})}put(t="",n,o){return this.send("PUT",t,{data:n,options:o})}patch(t="",n,o){return this.send("PATCH",t,{data:n,options:o})}delete(t="",n,o){return this.send("DELETE",t,{data:n,options:o})}}const qQ=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),YQ=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)};class FO extends KQ{constructor(t,n,o){const s=n==null?void 0:n.domainApi,r=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(o,{concurrency:{rules:[{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2$/,limit:1},{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2\/metrics$/,limit:5}]}}),this.events=Object.create(null);const a=qQ({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([c,u])=>{const d=c;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=u)}),this.apiConfig=l}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(r){console.error(`Error in event listener for ${t}:`,r)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:r,responseType:i,autoDownload:a=!0}){var u,d;const l=this.buildHeaders(s);let c;try{if(c=await this.axios.request({method:t,url:n,params:o,data:s,headers:l,responseType:i}),(((u=c.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const f=((d=c.headers)==null?void 0:d["content-disposition"])||"",p=f.includes("filename=")?f.split("filename=")[1]:"exported_items.xlsx";a&&(console.log("Auto-downloading Excel file:",p,a),YQ(c.data,p))}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:c,success:!0}),c.data}catch(h){throw console.error("API Request Error:",h),h.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:h,success:!1,apiCode:r,res:h==null?void 0:h.response}),h}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,r])=>{o=o.replace(`{${s}}`,String(r))}),o}async request(t,n,o={}){const{url:s,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:i,path:a,params:o.params,payload:o.payload,code:r,responseType:o.responseType,autoDownload:o.autoDownload})}async getAllItem_cursor(t){var r;const n=t.workspaceId,o={entity_ids:((r=t.entityIds)==null?void 0:r.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:o||1,name_like:s||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const r={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:r})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return o.length||(delete s.item_ids,s.entity_id=t.entityId),this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){var s;const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return((s=t.itemIds)==null?void 0:s.length)==0&&(o.entity_id=t.entityId,delete o.item_ids),this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const r={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:r})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s}){const r={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:r})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:r,filterParams:i}){const a={item_ids:n,start_date:o,due_date:s,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,r={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=s):(r.item_ids=n,r.entity_id=void 0),r}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:r}){const i={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:r}=t,i={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:r}=t,i={item_ids:o,template_flow_status_id:s};return o.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:1,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:s})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:0,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:s})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:r,clear:i}=t,a={item_ids:o,metric_id:s,metric_value:r,clear:i??(r==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n,o=!0){return console.log("Downloading template for entity:",n,"autoDownload:",o),this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:r,entity_ids:i}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const ZQ=(e,t,n,o,s,r,i)=>{const{apiServices:a}=Zn(n,o),l=V(!1),c=()=>{l.value=!0},u=()=>{vt(()=>{setTimeout(()=>{l.value=!1},500)})},d=q(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),h=yn("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();try{const w={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?w.clear=1:w.value=g,d.value?(delete w.itemIds,w.entityId=String(o.entityId)):w.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(w));(S==null?void 0:S.message)=="Done"&&t(p)}catch(w){console.error("Error during bulk metric update:",w)}u()}}},XQ=Ct(st({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=EA(),o=V([]),s=e,r=t,i=V([]),a=V(null),l=W=>{var ee,X,N;const Q=o.value.findIndex(z=>z.id===W.id);a.value=Q;const ae=(ee=i.value[Q])==null?void 0:ee.$el;(X=_.value)==null||X.scrollTo(Q*30),ae&&ae.scrollIntoView({behavior:"smooth",block:"center"}),c(Q),(N=i.value[Q])==null||N.show()},c=W=>{a.value=W,i.value.forEach((Q,ae)=>{ae!==W&&Q&&Q.hide()})},u=V(""),d=()=>{u.value="",i.value.forEach(W=>{W==null||W.hide()}),a.value=null},h=q(()=>s.selectedIds||[]),f=q(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=yn("isSelectAll",V(!1)),g=yn("bulkUpdate",V(!1)),v=V(null),{handleUpdate:w,isUpdating:S}=ZQ(f,W=>{var Q;r("update",W),d(),(Q=v.value)==null||Q.hide()},!1,s,g,p),b=async W=>{var Q;r("update-start");try{await w(W),r("update-completed")}catch{r("update-failed"),(Q=v.value)==null||Q.open()}},C=W=>{d(),vt(()=>{var Q;(Q=_.value)==null||Q.focus()})},_=V(null),E=(W,Q)=>{var ae;W?(ae=_.value)==null||ae.focus():d(),W&&Q!==W&&$("")},I=V(!0),T=V(!0),{apiServices:P}=Zn(!1,s),M=async(W,Q,ae)=>{var ee;try{return ae?T.value=!0:I.value=!0,await((ee=P.value)==null?void 0:ee.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:W,query:Q,per_page:10}))}catch(X){throw console.error("Failed to fetch metric list:",X),X}finally{I.value=!1,T.value=!1}},D=V(0),F=V(!0),O=W=>({id:String(W.id),label:String(W.name),value:String(W.id),description:W.morpheme_value?`${String(W.morpheme_value)}`:"",type:n.checkEditType(W),metricConfig:W}),k=W=>W.filter(Q=>!Q.formula).filter(Q=>{var ae;return((ae=Q==null?void 0:Q.auth_permission)==null?void 0:ae.permission)==2}).map(O),x=async()=>{D.value+=1;const W=await M(D.value,u.value,!0);if(W&&W.data){const Q=k(W.data);o.value=[...o.value,...Q],F.value=W.meta.last_page!=W.meta.current_page}else F.value=!1},$=async W=>{u.value=W,D.value=1;try{const Q=await M(D.value,u.value);Q&&Q.data?(o.value=k(Q.data),F.value=Q.meta.last_page!=Q.meta.current_page):o.value=[]}catch{o.value=[]}};return(W,Q)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:v,isUpdating:H(S),disabled:s.disabled||H(S),onOnVisibleChange:E},{trigger:he(({hide:ae,disabled:ee})=>[ue(at,{variant:s.variant,loading:H(S),disabled:ee,onEscape:ae},{default:he(()=>[ue(lt,{src:"SquareRootVariable",class:"icon"}),Q[1]||(Q[1]=Qe(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({isVisible:ae,popupRef:ee,hide:X})=>[Ke(ue(na,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:o.value,loading:I.value,"loading-more":T.value,"selected-id":void 0,"has-more":F.value,onSearch:$,onSelect:l,onLoadMore:Q[0]||(Q[0]=()=>x()),onCancel:X},{item:he(({item:N,index:z,selectedIndex:ne})=>[ue(pX,{ref:pe=>i.value[z]=pe,label:N.label,type:N.type,morpheme:N.description||"",onFocusOnSearch:C,onOpen:pe=>c(z),attachTo:ee,config:N.metricConfig,onHandleUpdate:b,class:te(["metric-update-item",{selected:a.value===z||ne===z}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":he(()=>[...Q[2]||(Q[2]=[me("div",{style:{width:"250px"}},null,-1)])]),"empty-list":he(()=>[...Q[3]||(Q[3]=[Qe("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[Ks,ae]])]),default:he(()=>[Q[4]||(Q[4]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-a645d131"]]),uv=rc("bulkUpdate",()=>{const e=V(Ft.UNCHECK),t=ds({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=ds({isBulkUpdating:!1});function r(u){s.isBulkUpdating=u}const i=V({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(Ft.CHECKED)}}}),JQ={class:"status-label"},PO=Ct(st({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Yt,o=e,s=t,r=a=>{s("select",a)},i=a=>new Pn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(K(),ie("div",{class:te(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[me("div",{class:"status-color",style:cn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),Ke((K(),ie("div",JQ,[Dt(a.$slots,"label",{},()=>[Qe(ht(e.status.name),1)],!0)])),[[H(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),QQ=["innerHTML"],kO=Ct(st({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,r=n,i=V([]),a=V(!1),l=V(!1),c=V(null),u=V(o.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=q(()=>{var O;return(O=s.value)==null?void 0:O.id});q(()=>!!(s.id||s.ids&&s.ids.length>0));const g=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),v=q(()=>{const O=new Set;return s.id&&O.add(String(s.id)),s.ids&&s.ids.forEach(k=>{k&&O.add(String(k))}),Array.from(O)}),w=yn("bulkUpdate",!1),{apiServices:S}=Zn(!w,s),b=uv(),{selectionStatus:C}=ns(b),_=yn("filterParams",null),E=async(O=o.INITIAL_PAGE,k="",x=!1)=>{var $,W,Q,ae;x?l.value=!0:a.value=!0,c.value=null;try{const ee={workspaceId:String(s.workspaceId),itemIds:v.value,page:O,perPage:o.PER_PAGE,name_like:k.trim(),..._||{},entityId:String(s.entityId)};if((($=S.value)==null?void 0:$.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const X=await((W=S.value)==null?void 0:W.getAssignableStatus(ee));if(!(X!=null&&X.data)){x||(i.value=[]),d.value=!1;return}const N=X.data.map(g);i.value=x?[...i.value,...N]:N,h.value=((Q=X.meta)==null?void 0:Q.total)??X.data.length,d.value=!((ae=X.meta)!=null&&ae.on_last_page),u.value=O}catch(ee){console.error("Error fetching statuses:",ee),c.value="Failed to load statuses",x||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},I=xr(async O=>{f.value=O,u.value=o.INITIAL_PAGE,await E(o.INITIAL_PAGE,O,!1)},li),T=async()=>{!d.value||l.value||await E(u.value+1,f.value,!0)},P=()=>{var O;r("cancel"),(O=s.params)==null||O.api.stopEditing()},M=async O=>{var k,x,$;try{const W={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(O.value),entityId:String(s.entityId),filterParams:_!=null&&_.value?_==null?void 0:_.value:void 0};if(C.value==Ft.CHECKED&&w&&(W.itemIds=void 0,W.entityId=String(s.entityId)),r("start-update"),!await S.value.updateItemStatus(W))throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:C.value==Ft.CHECKED&&w,data:{id:O.id,name:O.label,color:O.color}}),s.params&&((x=s.params)==null||x.node.setData({...(k=s.params)==null?void 0:k.node.data,status:{id:O.id,name:O.label,color:O.color}}),($=s.params)==null||$.api.stopEditing()),r("finish-update")}catch(W){console.error("Error updating status:",W),c.value="Failed to update status",r("error",c.value)}},D=q(()=>i.value.map(O=>({...O})));tt([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{E()},{deep:!0,immediate:!0});const F=V(null);return Qt(()=>{vt(()=>{var O;(O=F.value)==null||O.focus()})}),t({refresh:()=>E(o.INITIAL_PAGE,f.value,!1),loadMore:T,focus:()=>{var O;return(O=F.value)==null?void 0:O.focus()}}),(O,k)=>{var x;return K(),Ue(na,Wt({ref_key:"popupRef",ref:F},s,{"selected-id":(x=s.value)==null?void 0:x.id,options:D.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:H(I),onSelect:M,onLoadMore:T,onCancel:P,onClose:P}),{item:he(({item:$,selectedIndex:W,isSelected:Q,handleItemHover:ae,getHighlightedLabel:ee,query:X,idx:N})=>[(K(),Ue(PO,{key:$.value,status:$.data,selected:Q($),onMouseover:z=>ae(N),onSelect:z=>M($),hovered:N===W},{label:he(()=>[X?(K(),ie("span",{key:0,class:te([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:ee($.label)},null,10,QQ)):(K(),ie("span",{key:1,class:te(O.$style["item-label"]),style:{flex:"1"}},ht($.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"}}]]),eee=st({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,o=q(()=>{const f=oo();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=V(!1),i=V(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}finally{s("update-completed")}},l=q(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));Jr("bulkUpdate",!0);const c=f=>{var p,g;r.value=!1,f?(s("update-completed"),(p=i.value)==null||p.destroy()):(s("update-failed"),(g=i.value)==null||g.open())},u=V(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return tt(()=>n.ids,()=>{}),(f,p)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:he(({hide:g,disabled:v})=>[ue(at,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:he(()=>[ue(lt,{src:"Square",class:"icon"}),p[2]||(p[2]=Qe(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({hide:g})=>[ue(kO,Wt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:he(()=>[p[3]||(p[3]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tee={style:{"max-width":"225px","line-height":"14px"}},nee={style:{"max-width":"100px","line-height":"14px"}},oee=Ct(st({__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=Yt,o=ko,s=e,r=t,i=uv(),{handelSelectAll:a}=i,{selectionStatus:l}=ns(i),c=q(()=>l.value===Ft.CHECKED),u=q(()=>s.selectRowData.map(ve=>ve.id)),d=q(()=>s.selectRowData.length>0);Jr("bulkUpdate",d),Jr("isSelectAll",c);const h=({itemIds:ve,data:we,isUpdateAll:re})=>{const U=s.gridApi;[...ve].forEach(oe=>{if(!U){console.error("Grid API is undefined");return}const Re=U.getRowNode(oe);if(Re&&!Re.data.isLocked){const G={...Re.data,status:we};Re.setData(G)}})},f=q(()=>s.selectRowData),p=({itemIds:ve,data:we})=>{const re=s.gridApi;if(!re){console.error("Grid API is undefined");return}ve.forEach(U=>{const ge=re.getRowNode(U);if(ge){const oe=ge.data.dateRange||[null,null];"startDate"in we&&we.startDate!==void 0&&(oe[0]=we.startDate?new Date(we.startDate):null),"dueDate"in we&&we.dueDate!==void 0&&(oe[1]=we.dueDate?new Date(we.dueDate):null);const Re={...ge.data,dateRange:oe};ge.setData(Re)}}),r("updated")},g=q(()=>s.selectRowData.map(ve=>ve.id)),v=ve=>{const we=s.gridApi,{id:re,value:U}=ve;if(!we){console.error("Grid API is undefined");return}g.value.forEach(ge=>{const oe=we.getRowNode(ge);if(oe){const Re={...oe.data,[`metric_${re}`]:U};oe.setData(Re)}}),r("updated")},w=["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=()=>{r("unselect")},C=vS(),{userPermissions:_}=ns(C),E=q(()=>_.value.includes(yS)),I=q(()=>{if(!E.value){console.error("User does not have permission to open review.");return}if(l.value==Ft.CHECKED)return es({type:"review_take",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url;const ve=s.selectRowData.map(re=>re.id).join(",");return es({type:"review_multiple_scenes",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:ve}}).url}),T=ve=>{const{assignees:we,type:re}=ve,U=s.gridApi;if(!U){console.error("Grid API is not available for bulk update.");return}s.selectRowData.map(oe=>{const Re=U.getRowNode(oe.id);if(!Re)return null;const G=Re.data.assignees||[];let Y=[];switch(re){case"add":{const de=new Set(G.map(xe=>xe.id)),ke=we.filter(xe=>!de.has(xe.id));Y=[...G,...ke];break}case"overwrite":{Y=we;break}case"remove":{const de=new Set(we.map(ke=>ke.id));Y=G.filter(ke=>!de.has(ke.id));break}case"removeAll":{Y=[];break}}return{...Re.data,assignees:Y}}).filter(oe=>oe!==null).forEach(oe=>{const Re=U.getRowNode(oe.id);Re&&Re.setData(oe)})},{apiServices:P}=Zn(!1,s),M=async()=>{var U;const ve=s.selectRowData.map(ge=>ge.id),we=s.gridApi;if(!we){console.error("Grid API is not available for bulk delete.");return}const re=await((U=P.value)==null?void 0:U.bulkDeleteItems(k.value));(re==null?void 0:re.message)=="Done"&&(ve.forEach(ge=>{const oe=we.getRowNode(ge);if(oe){const Re={...oe.data,isDeleted:!0,disabled:!0};oe.setData(Re)}}),we.deselectAll())},D=V(null),F=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id);if(!s.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const re=await((U=P.value)==null?void 0:U.bulkUnarchiveItems(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to unarchive items."),(ge=D.value)==null||ge.open();return}$(ve,"isArchived",!1),(oe=D.value)==null||oe.hide()},O=yn("filterParams",void 0),k=q(()=>({workspaceId:String(s.workspaceId),itemIds:d.value&&c.value?[]:s.selectRowData.map(ve=>ve.id),entityId:s.entityId,filterParams:O!=null&&O.value?O.value:void 0})),x=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id);if(!s.gridApi){console.error("Grid API is not available for bulk archive.");return}const re=await((U=P.value)==null?void 0:U.bulkArchiveItems(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to archive items."),(ge=D.value)==null||ge.open();return}$(ve,"isArchived",!0),(oe=D.value)==null||oe.hide()},$=(ve,we,re)=>{const U=s.gridApi;if(!U){console.error("Grid API is not available for bulk update.");return}const ge=ve.map(oe=>{const Re=U.getRowNode(oe);if(Re){const G={...Re.data,[we]:re};Re.setData(G)}return Re}).filter(oe=>oe!=null);U.redrawRows({rowNodes:ge})},W=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id),we=s.gridApi;if(!we){console.error("Grid API is not available for bulk thumbnail deletion.");return}const re=await((U=P.value)==null?void 0:U.deleteThumbnail(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to delete thumbnails."),(ge=D.value)==null||ge.open();return}ve.forEach(Re=>{const G=we.getRowNode(Re);if(G){const Y={...G.data,thumbnail:null};G.setData(Y)}}),(oe=D.value)==null||oe.hide()},Q=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id),we=s.gridApi;if(!we){console.error("Grid API is not available for bulk rendition deletion.");return}const re=await((U=P.value)==null?void 0:U.deleteRendition(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to delete renditions."),(ge=D.value)==null||ge.open();return}ve.forEach(Re=>{const G=we.getRowNode(Re);if(G){const Y={...G.data,rendition:null};G.setData(Y)}}),(oe=D.value)==null||oe.hide()},ae=V(!1),ee=V(null),X=async ve=>{var we,re;try{switch(z.value=!0,ae.value=!0,ve.id){case"unarchive":await F();break;case"delete":await M();break;case"archive":await x();break;case"delete-thumbnail":await W();break;case"delete-rendition":await Q();break;default:console.error("Unknown action:",ve.id),ae.value=!1;break}}catch(U){console.error("Error performing action:",U),(we=D.value)==null||we.open()}finally{(re=ee.value)==null||re.focus(),vt(()=>{z.value=!1,ae.value=!1})}},N=(ve,we)=>{var re;!ve&&we&&((re=ee.value)==null||re.focus())},z=V(!0),ne=ve=>{vt(()=>{z.value=ve})};tt(()=>s.selectRowData,ve=>{z.value=!1},{deep:!0,immediate:!0});const pe=q(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:w,disabled:z.value,ids:l.value==Ft.CHECKED?[]:u.value}));return(ve,we)=>Ke((K(),ie("div",{class:te(ve.$style["bulk-update-action"])},[me("div",{class:te(ve.$style["left-actions"])},[me("div",{class:te(ve.$style["selection-track"])},[ue(at,{class:te(ve.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),H(l)==H(Ft).INDETERMINATE?(K(),ie("span",{key:0,class:te(ve.$style["selected-count"])},ht(e.selectRowData.length)+" selected ",3)):Xe("",!0),H(l)==H(Ft).CHECKED?(K(),ie("span",{key:1,class:te(ve.$style["selected-count"]),style:{"line-height":"14px"}},[we[12]||(we[12]=Qe(' All in " ',-1)),Ke((K(),ie("span",tee,[Qe(ht(e.takeName),1)])),[[H(n),{content:e.takeName}]]),we[13]||(we[13]=Qe(' " ',-1))],2)):Xe("",!0),!e.loading&&H(l)==H(Ft).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(K(),Ue(at,{key:2,variant:"secondary",onHandleClick:H(a)},{default:he(()=>[me("span",{class:te(ve.$style["selected-count"]),style:{"line-height":"14px"}},[we[14]||(we[14]=Qe(' Select all in " ',-1)),Ke((K(),ie("span",nee,[Qe(ht(e.takeName),1)])),[[H(n),{content:e.takeName}]]),we[15]||(we[15]=Qe(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Xe("",!0),me("span",{class:te(ve.$style.divider)},null,2)],2),ue(eee,Wt(pe.value,{onUpdated:h,onUpdateStart:we[0]||(we[0]=re=>z.value=!0),onUpdateCompleted:we[1]||(we[1]=re=>ne(!1)),onUpdateFailed:we[2]||(we[2]=re=>ne(!1)),"selected-all":H(l)==H(Ft).CHECKED}),null,16,["selected-all"]),ue(HZ,Wt({onUpdate:T,onUpdateStart:we[3]||(we[3]=re=>z.value=!0),onUpdateCompleted:we[4]||(we[4]=re=>ne(!1)),onUpdateFailed:we[5]||(we[5]=re=>ne(!1)),"selected-all":H(l)==H(Ft).CHECKED},pe.value),null,16,["selected-all"]),ue(eX,Wt({"row-selected":f.value,"selected-all":H(l)==H(Ft).CHECKED},pe.value,{onUpdated:p,onUpdateStart:we[6]||(we[6]=re=>z.value=!0),onUpdateCompleted:we[7]||(we[7]=re=>ne(!1)),onUpdateFailed:we[8]||(we[8]=re=>ne(!1))}),null,16,["row-selected","selected-all"]),ue(XQ,{disabled:z.value,onUpdate:v,onUpdateStart:we[9]||(we[9]=re=>z.value=!0),onUpdateCompleted:we[10]||(we[10]=re=>ne(!1)),onUpdateFailed:we[11]||(we[11]=re=>ne(!1)),selectedIds:u.value,"workspace-id":e.workspaceId,variant:w,"entity-id":e.entityId,"selected-all":H(l)==H(Ft).CHECKED},null,8,["disabled","selectedIds","workspace-id","entity-id","selected-all"]),me("span",{class:te(ve.$style.divider)},null,2),Ke((K(),ie("div",null,[E.value?(K(),Ue(at,{key:0,class:te(ve.$style["action-button"]),variant:[...w,"icon"],href:I.value,disabled:s.selectRowData.length>40&&H(l)!=H(Ft).CHECKED},{default:he(()=>[ue(lt,{src:"PenRuler",class:te(ve.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Xe("",!0)])),[[H(n),s.selectRowData.length<=40||H(l)==H(Ft).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),me("span",{class:te(ve.$style.divider)},null,2),ue(yf,{ref_key:"wrapperRef",ref:D,isUpdating:z.value,disabled:z.value,onOnVisibleChange:N},{trigger:he(({hide:re,toggle:U,isVisible:ge,disabled:oe})=>[Ke((K(),Ue(at,{onEscape:re,actived:ge,ref_key:"moreActionRef",ref:ee,class:te(ve.$style["action-button"]),variant:["secondary","icon"],loading:ae.value,disabled:oe||z.value,onClick:kt(U,["stop"])},{default:he(()=>[ue(lt,{src:"EllipsisVertical",class:te(ve.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[H(o),"99999"],[H(n),{content:"More actions"}]])]),popup:he(({isVisible:re,hide:U})=>[(K(),ie(It,null,Fn(S,(ge,oe)=>ue(ic,Wt({clickable:!0,key:ge.id},{ref_for:!0},ge,{show:re,style:{borderLeft:0},"focus-index":"99999."+oe,onClick:()=>{X(ge)},onEscape:U}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[Ks,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1m5lx_1","left-actions":"_left-actions_1m5lx_19","right-actions":"_right-actions_1m5lx_20","selection-track":"_selection-track_1m5lx_25","btn-close":"_btn-close_1m5lx_31","close-icon":"_close-icon_1m5lx_37","selected-count":"_selected-count_1m5lx_41",divider:"_divider_1m5lx_47","more-button":"_more-button_1m5lx_52",dropdown:"_dropdown_1m5lx_56","dropdown-content":"_dropdown-content_1m5lx_59",delete:"_delete_1m5lx_82","icon-btn":"_icon-btn_1m5lx_89","selected-list":"_selected-list_1m5lx_93"}}]]),Za=Ct(st({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=Ts,n=Yt,o=e,s=q(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=Co(s),i=q(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=q(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=ue(Gh,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});hC(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=q(()=>o.value===void 0);return(c,u)=>Ke((K(),Ue(_o,Wt(H(r),{ref:"displayWrapperRef"}),{default:he(()=>[me("span",{class:te(c.$style["item-table-label-renderer"])},ht(o.value||"-"),3)]),_:1},16)),[[H(t),{isLoading:l.value||!i.value}],[H(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),see=["placeholder","maxlength"],ree={key:0,class:"wrapper-suffix"},iee=Ct(st({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Ts,s=Yt,r=e,i=n,a=V(r.value),l=V(null),c=V(null),u=V(r.value||""),d=V(!1),h=V(!1),f=q(()=>{var D;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((D=r.value)==null?void 0:D.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=Co(f),v=()=>u.value!==a.value,w=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const D=l.value.value;if(!v()){d.value=!1;return}a.value=D,i("update:value",D),i("enter",D),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():w(),i("blur",u.value))},C=D=>{var F;if(D.key==="ArrowLeft"||D.key==="ArrowRight"){D.stopPropagation();return}D.ctrlKey&&(D.key=="a"||D.key=="A")?(D.stopPropagation(),(F=l.value)==null||F.select()):D.key==="Enter"?(D.preventDefault(),D.stopPropagation(),S()):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation(),w())},_=()=>{a.value=r.value,u.value=r.value,d.value=!0,vt(()=>{var D,F;(D=l.value)==null||D.click(),(F=l.value)==null||F.focus()})},E=()=>{var D;d.value?w():(D=l.value)==null||D.blur(),i("blur",u.value)},I={focus:()=>{_()}};Qt(()=>{var F;const D=(F=c.value)==null?void 0:F.$el;D&&(D.__sceneNameEditor=I)}),qn(()=>{const D=c.value;D&&delete D.__sceneNameEditor});const T=V(null),P=V(null);t({focus:_,blur:()=>{var D;return(D=l.value)==null?void 0:D.blur()},save:S,cancel:w,focusEditButton:()=>{vt(()=>{var D;(D=T.value)==null||D.focus()})},focusCancelButton:()=>{vt(()=>{var D;(D=P.value)==null||D.focus()})},startEdit:_});const M=q(()=>r.value===void 0);return bS(c,()=>{d.value&&b()}),(D,F)=>Ke((K(),Ue(H(_o),Wt(H(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),tu({default:he(()=>[d.value?Xe("",!0):Dt(D.$slots,"default",{key:0,isEditting:d.value,isHover:H(g)},()=>[Ke((K(),ie("span",{class:te(D.$style["label-renderer"])},[Qe(ht(u.value),1)],2)),[[H(s),{content:u.value||void 0}]])]),Ke(me("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":F[0]||(F[0]=O=>u.value=O),class:te(D.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:C,onBlur:b},null,42,see),[[Ks,d.value],[QT,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:he(({hovered:O,focused:k})=>[O?(K(),ie("div",ree,[O&&!k?Ke((K(),Ue(at,{key:0,variant:["icon","secondary"],size:24,onClick:kt(_,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:T,onKeydown:[jn(kt(_,["prevent","stop"]),["enter"]),jn(kt(E,["prevent","stop"]),["escape"])]},{default:he(()=>[ue(H(lt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[H(s),"Edit"]]):Xe("",!0)])):Xe("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[H(o),{isLoading:M.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),aee=["tabindex"],AO=Ct(st({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Yt,s=Ts,r=e,i=n,a=V(r.value),l=V(r.value),c=V(null),u=V(null),d=yn("bulkUpdate",!1),{apiServices:h}=Zn(!d,r),f=q(()=>{var ee;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((ee=a==null?void 0:a.value)==null?void 0:ee.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=Co(f),g=q(()=>{const ee=un.getInstance().getItem("ws.code"),X=un.getInstance().getItem("BASE_URL"),N=ee||r.workspaceId;return es({type:"scene_hub",config:{baseDomain:X,ws_code:N,scene_id:String(r.id)}}).url}),v=q(()=>{var ee,X,N;return((X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.state)==0||((N=r.data)==null?void 0:N.isDeleted)==!0}),w=q(()=>r.readOnly||E.value),S=q(()=>{var ee,X,N,z,ne;return((ee=r.data)==null?void 0:ee.isDeleted)==!0||((N=(X=r.data)==null?void 0:X.isProcessing)==null?void 0:N.state)==0||((ne=(z=r.data)==null?void 0:z.isProcessing)==null?void 0:ne.state)==1}),b=q(()=>{var ee,X;return(X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.message}),C=q(()=>{var ee;return((ee=r.data)==null?void 0:ee.isArchived)==1}),_=q(()=>{var ee;return((ee=r.data)==null?void 0:ee.isLocked)==1}),E=q(()=>r.value===void 0),I=q(()=>{var ee,X;return((X=(ee=r.data)==null?void 0:ee.permissions)==null?void 0:X.has_edit_permission)==1}),T=async ee=>{var X,N,z,ne,pe,ve,we,re,U,ge;a.value=ee,p.value=!1;try{const oe=await((N=(X=h.value)==null?void 0:X.updateSceneName)==null?void 0:N.call(X,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),Re=Fm.get(oP)||"UTC";if(oe){const G=aP(oe,Re),Y={...r.data,...G};(z=r.params)==null||z.api.clearFocusedCell();const de=((pe=(ne=r.params)==null?void 0:ne.column)==null?void 0:pe.getColId())||"",ke=((we=(ve=r.params)==null?void 0:ve.node)==null?void 0:we.rowIndex)||0;(re=r.params)==null||re.api.setFocusedCell(ke,de),(ge=(U=r.params)==null?void 0:U.node)==null||ge.setData(Y),l.value=a.value,i("enter")}else a.value=l.value}catch(oe){console.error("Failed to update scene name:",oe),a.value=l.value}},P={focus:()=>{p.value=!0,vt(()=>{var ee;return(ee=u.value)==null?void 0:ee.focus()})},startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}},M=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;tt(()=>r.value,ee=>{a.value=ee,l.value=ee}),Qt(()=>{const ee=M();ee&&(ee.__sceneNameEditor=P)}),qn(()=>{const ee=u.value,X=ee&&"$el"in ee?ee.$el:ee;X&&delete X.__sceneNameEditor});const D=mf(),{openSceneHub:F}=D,O=ee=>{try{if(ee.ctrlKey||ee.metaKey){window.open(g.value,"_blank");return}F(String(r.id))}catch{window.open(g.value,"_blank")}finally{Q()}},k=()=>{setTimeout(()=>{ae.value=!0,x.value=0,vt(()=>{var ee;(ee=$.value)==null||ee.focus()})},300)},x=V(-1),$=V(null);t({focus:k,trigerFocus:k,startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}});const W=ee=>{if(ee.key==="Enter"){ee.preventDefault(),O(ee);return}if(ee.key==="Escape"){ee.preventDefault(),Q();return}ee.key==="Tab"&&(ee.preventDefault(),ee.stopPropagation(),ee.stopImmediatePropagation(),vt(()=>{var X;(X=u.value)==null||X.focusEditButton()}))},Q=()=>{var N,z,ne,pe,ve,we;ae.value=!1,x.value=-1,(N=r.params)==null||N.api.clearFocusedCell();const ee=((ne=(z=r.params)==null?void 0:z.column)==null?void 0:ne.getColId())||"",X=((ve=(pe=r.params)==null?void 0:pe.node)==null?void 0:ve.rowIndex)||0;(we=r.params)==null||we.api.setFocusedCell(X,ee)},ae=V(!1);return(ee,X)=>Ke((K(),Ue(iee,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":w.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":X[0]||(X[0]=N=>a.value=N),id:`scene-name-${r.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ae.value,onBlur:Q},{default:he(({isHover:N,isEditting:z})=>[Ke(me("div",{class:te(ee.$style["scene-name-display"])},[Ke((K(),ie("a",{tabindex:x.value,ref_key:"nameRef",ref:$,onClick:kt(O,["prevent"]),onKeydown:W,target:"_blank",class:te(ee.$style["scene-name-text"]),style:{lineHeight:"28px"}},[Qe(ht(a.value),1)],42,aee)),[[H(o),{content:a.value,delay:[1e3,0]}]]),w.value||!N&&!z&&!w.value?(K(),ie(It,{key:0},[_.value?Ke((K(),ie("div",{key:0,class:te([ee.$style["icon-processing"],ee.$style.isLocked])},[ue(lt,{src:"Lock",color:I.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[H(o),{content:I.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Xe("",!0),C.value?Ke((K(),ie("div",{key:1,class:te([ee.$style["icon-processing"],ee.$style.archived])},[ue(lt,{src:"BoxArchive"})],2)),[[H(o),{content:"Archived",delay:[1e3,0]}]]):Xe("",!0),S.value?Ke((K(),ie("div",{key:2,class:te([ee.$style["icon-processing"],ee.$style.processing,v.value&&ee.$style["icon-red"]])},[ue(lt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[H(o),b.value]]):Xe("",!0)],64)):Xe("",!0)],2),[[Ks,!H(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[H(s),{isLoading:E.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),jS=Ct(st({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick","open"],setup(e,{expose:t,emit:n}){const o=ko,s=V([]),r=e,i=V(null),a=q(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=q(()=>{let w=[];return typeof r.variant=="string"?w.push(r.variant):Array.isArray(r.variant)&&(w=[...r.variant]),[...w,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=yo({toggleOnClick:!0,offset:[0,0],onShow:()=>c("open")});function v(w){c("select",w),u()}return mh(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),tt(d,w=>{var S;w&&((S=p.value)==null||S.focus())}),(w,S)=>(K(),ie("div",{class:te(w.$style["button-dropdown-wrapper"]),style:cn({"--button-size":a.value})},[me("div",{class:te(w.$style["button-group"])},[Dt(w.$slots,"prefix"),me("div",{ref_key:"triggerRef",ref:f,class:te(H(d)?w.$style.open:"")},[Dt(w.$slots,"triggerDropdown",{open:H(d)},()=>[r.readOnly?Xe("",!0):Ke((K(),Ue(at,{key:0,onEscape:H(u),ref_key:"mainButton",ref:i,actived:H(d),class:te(w.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:he(()=>[Dt(w.$slots,"iconDropdown",{},()=>[ue(lt,{class:te(w.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[H(o),e.tabIndex]])])],2)],2),me("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:te(w.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(K(!0),ie(It,null,Fn(e.options,(b,C)=>Ke((K(),Ue(ic,Wt({ref_for:!0,ref:_=>s.value[C]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:kt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:he(()=>[Qe(ht(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[H(o),`${e.tabIndex}.${C}`]])),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"}}]]),If=Ct(st({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Yt,o=e,s=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},i=q(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(K(),ie("div",{class:te(a.$style["close-wrapper"])},[e.disableRemove?Xe("",!0):(K(),ie("div",{key:0,class:te(a.$style["close-button"])},[Ke((K(),Ue(at,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:he(()=>[ue(lt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[H(n),i.value]])],2)),Dt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),lee=Ct(st({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=Yt,n=Ts,o=e,{isEditing:s}=$u(o),r=V(o.value),i=V(null),a=V(null),{apiServices:l}=Zn(!0,o),c=V(!0),u=()=>{c.value=o.value===void 0};gh(()=>{u()}),Qt(()=>{u()}),tt(()=>o.value,T=>{u()});const d=q(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=Co(d),p=q(()=>{var T;return((T=r.value)==null?void 0:T.slice(0,o.maxVisible))||[]}),g=q(()=>{var T;return Math.max(0,(((T=r.value)==null?void 0:T.length)||0)-o.maxVisible)}),v=q(()=>{var T;return g.value<=0?"":((T=r.value)==null?void 0:T.slice(o.maxVisible).map(P=>P.name).join(", "))||""}),w=q(()=>p.value.map(T=>({id:T.id,name:T.name,initial:T.initial,avatarId:T.id,profile_image:T.profile_image,color:T.color,size:24,user:T}))),S=q(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));tt(()=>o.value,T=>{r.value=T},{immediate:!0,deep:!0});const b=async T=>{var M,D,F;await I(T)&&(r.value=(M=r.value)==null?void 0:M.filter(O=>O.id!==T),(F=o.params)==null||F.node.setData({...(D=o.params)==null?void 0:D.node.data,assignees:r.value}))},C=T=>{var M;const P=un.getInstance().getItem("ws.code");return((M=l.value)==null?void 0:M.getUserInformation(P,T))||Promise.resolve(null)},{id:_}=ag(o),E=T=>{var M,D;const P=(D=(M=o.params)==null?void 0:M.api)==null?void 0:D.getRowNode(String(_.value));P==null||P.setDataValue("assignees",rb(T.assignees))},{removeAssignee:I}=Om({...o,entityId:o.entityId,updateRowData:E,value:o.value,errorCallback:()=>{}});return(T,P)=>Ke((K(),Ue(_o,Wt(H(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:he(()=>{var M;return[me("div",{class:te(T.$style.assigneeGroupRenderer)},[((M=r.value)==null?void 0:M.length)===0?(K(),Ue(lt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:cn(S.value)},null,8,["style"])):Xe("",!0),(K(!0),ie(It,null,Fn(w.value,D=>(K(),Ue(If,{key:D.id,"disable-remove":o.readOnly||o.disabled,onClear:F=>b(D.id),style:{marginLeft:"0"}},{default:he(()=>[ue(Gu,{user:D.user,"show-profile":!0,apiUpdateFunction:C,class:te(T.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((K(),ie("div",{key:1,class:te(T.$style["extra-avatars"])},[Qe(" +"+ht(g.value),1)],2)),[[H(t),v.value]]):Xe("",!0)],2)]}),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),cee=Ct(st({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var E,I;const t=Yt,n=Ts,o=Hb(),s=e,r=V(null),i=V(null),{isEditing:a}=$u(s),l=T=>{if(T){if(typeof T=="string")return T;if(T instanceof Date)return T.toISOString()}},c=q(()=>s.value===void 0),u=q(()=>{var T;return(T=s.data)==null?void 0:T.isStarted}),d=q(()=>{var T;return(T=s.data)==null?void 0:T.isCompleted}),h=q(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=q(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=q(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=Co(p),{startDate:v,endDate:w,startClasses:S,endClasses:b,fullStartDate:C,fullEndDate:_}=V7({start:l((E=s.value)==null?void 0:E[0]),end:l((I=s.value)==null?void 0:I[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(T,P)=>Ke((K(),Ue(_o,Wt(H(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:he(()=>[c.value?Xe("",!0):(K(),ie("div",{key:0,class:te(T.$style.dateRangeRenderer)},[h.value?Xe("",!0):(K(),Ue(lt,{key:0,src:"Calendar",class:te(T.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(K(),ie(It,{key:1},[Ke((K(),ie("span",{class:te([T.$style.dateLabelDisplay,...H(S).map(M=>T.$style[M])])},[Qe(ht(H(v)),1)],2)),[[H(t),H(C)]]),P[0]||(P[0]=me("span",null,"→",-1)),Ke((K(),ie("span",{class:te([T.$style.dateLabelDisplay,...H(b).map(M=>T.$style[M])])},[Qe(ht(H(w)),1)],2)),[[H(t),H(_)]])],64)):Xe("",!0)],2))]),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),uee=st({__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:Hb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=V(null);Qt(()=>{vt(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var w;(w=s.params)==null||w.api.stopEditing(),r("closed")},a=w=>`${bt.fromJSDate(w,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async w=>{await v({startDate:w[0]?a(w[0]):null,dueDate:w[1]?a(w[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async w=>{await v({startDate:w?a(w):null})},h=async w=>{await v({dueDate:w?a(w):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=yn("bulkUpdate",!1),{apiServices:g}=Zn(!p,s),v=async w=>{var S,b,C,_,E;try{const I=(S=o.value)==null?void 0:S.getValues(),T=await((C=(b=g.value)==null?void 0:b.changeDate)==null?void 0:C.call(b,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:w.startDate,dueDate:w.dueDate}));T!=null&&T.message&&((E=s.params)==null||E.node.setData({...(_=s.params)==null?void 0:_.node.data,dateRange:I==null?void 0:I.dateRange}))}catch(I){console.error("Failed to update scene name:",I)}};return t({focus:()=>{vt(()=>{var w;(w=o.value)==null||w.focus()})}}),(w,S)=>(K(),Ue(Ym,Wt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),dee=Ct(st({__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),o=V(0);let s=null;Qt(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),Ol(()=>{s&&n.value&&s.unobserve(n.value)});const r=q(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(K(),ie("div",{class:te(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[me("div",{class:te(i.$style["item-header"])},[me("div",{class:te(i.$style["item-header__left"])},[Dt(i.$slots,"header-left",{},()=>[me("h1",{class:te(i.$style["item-header__title"])},[Dt(i.$slots,"title",{},()=>[a[0]||(a[0]=Qe("Items",-1))])],2)])],2),me("div",{class:te(i.$style["item-header__spacer"])},null,2),me("div",{class:te(i.$style["item-header__actions"])},[Dt(i.$slots,"header-actions")],2)],2),Dt(i.$slots,"grid",{availableHeight:r.value}),me("div",{class:te(i.$style.footer)},[Dt(i.$slots,"footer")],2),Dt(i.$slots,"new-row"),Dt(i.$slots,"bulk-update-actions"),Dt(i.$slots,"snackbar"),Dt(i.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),OO=Ct(st({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=ko,s=e,r=q(()=>(s==null?void 0:s.workspaceId)||""),i=q(()=>(s==null?void 0:s.entityId)||""),a=()=>{var k,x,$;return($=(k=s.params)==null?void 0:k.api)==null?void 0:$.getCellRendererInstances({columns:["options"],rowNodes:(x=s.params)!=null&&x.node?[s.params.node]:[]})[0]},l=()=>{var x,$,W,Q;const k=a();($=(x=k==null?void 0:k.componsenExposed)==null?void 0:x.blur)==null||$.call(x),(Q=(W=k==null?void 0:k.container)==null?void 0:W.parentElement)==null||Q.classList.remove("ag-cell-focus")},c=()=>{var $,W,Q;(W=($=s.params)==null?void 0:$.api)==null||W.stopEditing(),l();const k=`scene-name-${s.id}`,x=document.getElementById(k);(Q=x==null?void 0:x.__sceneNameEditor)==null||Q.startEdit()},{apiServices:u}=Zn(!0,s),d=q(()=>{var k;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:(k=s.data)==null?void 0:k.permissions}}),h=k=>{var $,W,Q,ae,ee,X;let x=(W=($=s.params)==null?void 0:$.api)==null?void 0:W.getRowNode(String(s.id));if(x){const N={...x.data,isDeleted:k==="deleted",isArchived:k==="archived"?!0:x.data.isArchived,isLocked:k==="locked"?!0:x.data.isLocked,disabled:!1};k=="deleted"&&(N.isLocked=!1,N.disabled=!0),k=="unarchived"&&(N.isArchived=!1),(ae=(Q=s.params)==null?void 0:Q.api)==null||ae.redrawRows({rowNodes:[x]}),x.setData(N),(X=(ee=s.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[x]})}},f=mf(),{openSceneHub:p}=f,g=()=>{vt(()=>{var $,W,Q,ae,ee,X;const k=((W=($=s.params)==null?void 0:$.node)==null?void 0:W.rowIndex)||0,x=((ae=(Q=s.params)==null?void 0:Q.column)==null?void 0:ae.getColId())||"";(X=(ee=s.params)==null?void 0:ee.api)==null||X.setFocusedCell(k,x)})};q(()=>{var x,$;const k=($=(x=s.params)==null?void 0:x.api)==null?void 0:$.getRowNode(String(s.id));return k==null?void 0:k.data});const{options:v}=yZ(d,h,c,p,g),w=n,S=()=>{var k,x,$,W,Q,ae;console.trace("Focusing current cell for row:",s.id),(ae=(k=s.params)==null?void 0:k.api)==null||ae.setFocusedCell((($=(x=s.params)==null?void 0:x.node)==null?void 0:$.rowIndex)||0,((Q=(W=s.params)==null?void 0:W.column)==null?void 0:Q.getColId())||"")},b=q(()=>{var k;return(k=s.params)==null?void 0:k.api}),C=(k,x)=>{var $,W,Q,ae,ee,X,N,z;if(w("actionExecuted",k),k.id=="copy-link"){(ee=b.value)==null||ee.startEditingCell({rowIndex:(W=($=s.params)==null?void 0:$.node)==null?void 0:W.rowIndex,colKey:(ae=(Q=s.params)==null?void 0:Q.column)==null?void 0:ae.getColId()});return}else{if(k.id!=="copy-link"&&((X=b.value)==null||X.stopEditing()),k.id==="rename")(N=b.value)==null||N.stopEditing(),(z=b.value)==null||z.clearFocusedCell(),l();else if(k.id==="copy-link"){const ne=document.getElementById(x);setTimeout(()=>{var pe,ve,we;(we=(ve=(pe=ne==null?void 0:ne.__vueParentComponent)==null?void 0:pe.exposed)==null?void 0:ve.focus)==null||we.call(ve)},300)}else if(["delete-rendition","delete-thumbnail"].includes(k.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var ne,pe;(pe=(ne=s.params)==null?void 0:ne.api)==null||pe.clearFocusedCell()},300)}},_=()=>{var k,x;(x=(k=s.params)==null?void 0:k.api)==null||x.stopEditing()},E=k=>{var x,$,W,Q;return k==="archive"?!(($=(x=s.params)==null?void 0:x.data)!=null&&$.isArchived):k==="unarchive"?(Q=(W=s.params)==null?void 0:W.data)==null?void 0:Q.isArchived:!0},I=q(()=>v.value.map(k=>({...k,options:k.options.filter(x=>!x.hide&&E(x.id))})).filter(k=>k.options.length>0)),T=V({}),P=V(null),M=q(()=>{var x,$;if(s.focusableIndex)return s.focusableIndex;const k=($=(x=s.params)==null?void 0:x.api)==null?void 0:$.getRowNode(String(s.id));return`${((k==null?void 0:k.rowIndex)??0)+10}`}),D=(k,x)=>`${M.value}.${k*10+x}`,F=(k,x)=>{if(x&&"focus"in x){T.value[k]=x;return}delete T.value[k]},O=k=>{k.preventDefault(),k.stopPropagation(),k.stopImmediatePropagation()};return Qt(()=>{var k;(k=P.value)==null||k.focus()}),t({focus(){var $;const k=`${M.value}.0`,x=T.value[k];x&&x.focus?x.focus():($=P.value)==null||$.focus()}}),(k,x)=>Ke((K(),ie("div",{onKeydown:O,class:te([k.$style["more-option-section"],{[k.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:P,tabindex:"0",role:"menu"},[(K(!0),ie(It,null,Fn(I.value,($,W)=>(K(),ie("div",{key:$.id,style:cn({"--g-number":Math.min($.options.length,4),"--g-size":$.type==="column"?"36px":"auto"}),class:te([k.$style["option-block"],k.$style[$.type]])},[(K(!0),ie(It,null,Fn($.options,(Q,ae)=>(K(),ie("div",{key:Q.id,class:te(k.$style["option-item"])},[ue(fee,{layer:s.layer,"scene-id":String(s.id),option:Q,type:$.type,onActionExecuted:ee=>C(ee,`more-action-${ee.id}-${s.id}`),focusableIndex:D(W,ae),ref_for:!0,ref:ee=>F(D(W,ae),ee),onHandleHide:_,id:`more-action-${Q.id}-${s.id}`,label:Q.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[H(o),M.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"}}]]),hee={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},fee=Ct(st({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=ko,s=Yt,r=e,i=V(!1),a=V(!1),l=(T,P)=>{if(!P){p();return}const M=P.target;M.closest(".tippy-content")||M.closest(".tippy-box")||M.closest("[data-tippy-root]")||M.closest(".option-item")||p()},c=V(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=yo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async T=>{var P,M;if(!a.value){a.value=!0;try{await((M=(P=r.option).action)==null?void 0:M.call(P,T)),g("actionExecuted",r.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,i.value=!1}}},w=async T=>{var P,M;if(T.preventDefault(),T.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((M=(P=r.option).action)==null?void 0:M.call(P,T)),g("actionExecuted",r.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},S=T=>{g("actionExecuted",T),p()},b=T=>{T.key==="Escape"&&p()},C=T=>({row:"small",column:"medium",block:"small"})[T]||"medium",_=T=>{const P=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...P],column:["menu-item",...P],block:["secondary",...P]}[T]||[]},E=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{vt(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{w(new MouseEvent("click"))}});const I=T=>{var P;T.stopPropagation(),T.preventDefault(),i.value=!1,(P=u.value)==null||P.focus()};return(T,P)=>{var M;return Ke((K(),ie("div",{ref_key:"wrapperRef",ref:c,class:te(T.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:kt(w,["stop","prevent"])},[Ke((K(),Ue(at,{ref_key:"triggerRef",ref:u,class:te(T.$style["option-item"]),disabled:e.option.disabled||a.value,actived:H(f)||i.value,size:C(e.type),variant:_(e.type),onClick:kt(w,["stop","prevent"]),onKeydown:b,onEscape:E,label:e.option.label},{prefix:he(()=>[e.option.icon?(K(),ie("div",hee,[ue(lt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Xe("",!0)]),suffix:he(()=>[e.option.subMenu?(K(),Ue(lt,{key:0,src:"Play",source:"remote"})):Xe("",!0),e.option.isDanger&&i.value?(K(),ie("div",{key:1,class:te(T.$style["confirm-action"])},[Ke((K(),Ue(at,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:I},{default:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[H(o),`${r.focusableIndex}.0`],[H(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((K(),Ue(at,{variant:["danger","primary","icon"],size:"small",onClick:kt(v,["stop","prevent"]),onEscape:P[0]||(P[0]=D=>i.value=!1)},{default:he(()=>[ue(lt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${r.focusableIndex}.1`],[H(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[H(o),r.focusableIndex]]),e.option.subMenu?(K(),ie("div",{key:0,ref_key:"popupRef",ref:d,class:te(T.$style["submenu-container"])},[ue(OO,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((M=e.option)==null?void 0:M.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Xe("",!0)],2)),[[H(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),MO=(e,t)=>{const n=V(Number(e.value.value)),o=q(()=>e.value.metricConfig),s=q(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),r=17,i=q(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:s,metricConfig:o,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},pee=["aria-label"],NO=Ct(st({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=Ts,o=Yt,s=e,r=ig(!1),i=V(null),a=V(null),{isEditing:l}=$u(s),c=q(()=>{var x,$;return{value:s.value,metricConfig:(($=(x=s.params)==null?void 0:x.colDef)==null?void 0:$.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=MO(c,r),f=q(()=>{var $,W;let x=!1;if(["number","formula"].includes(d.value.metric_type.code)){const Q=Number(s.value),ae=Number(($=d.value)==null?void 0:$.format_value);Number.isFinite(ae)&&ae>=0&&(x=(((W=Q.toString().split(".")[1])==null?void 0:W.length)||0)>ae)}return x}),p=q(()=>{var x;return!!((x=d.value)!=null&&x.morpheme_value)||u.value.isEmpty||f.value}),g=q(()=>{var W,Q,ae;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const x=P.value,$=(W=d.value)==null?void 0:W.morpheme_type;return $==="prefix"?`${((Q=d.value)==null?void 0:Q.morpheme_value)||""} ${x}`.trim():$==="suffix"?`${x} ${((ae=d.value)==null?void 0:ae.morpheme_value)||""}`.trim():x}),v=q(()=>{const{format_type:x,format_value:$}=d.value;if(x==="dropdown"&&typeof $=="string"&&$.startsWith("["))try{return JSON.parse($)}catch{return[]}return[]}),w=q(()=>({disabled:s.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!T.value,readOnly:s.readOnly||T.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=Co(w),C=(x,$,W="en-US")=>new Intl.NumberFormat(W,{minimumFractionDigits:$,maximumFractionDigits:$}).format(x),_=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const x=s.value,{format_type:$,format_value:W,mapping:Q}=d.value;if(Q&&typeof Q=="object"&&!Array.isArray(Q)){const ae=Q[`!${x}`];if(ae)return ae}if($==="dropdown"){const ae=v.value.find(ee=>String(ee.name)===String(x));if(ae)return ae.name}if(typeof x=="string"){const ae=Number(x);return Number.isNaN(ae)?x:x.replace(/[.-]/g,"").length>16?E(x,W):E(ae,W)}return typeof x=="number"?E(x,W):String(x)}),E=(x,$)=>{const W=Number.parseInt(String($)||"2",10),Q=Number.isFinite(W)&&W>=0?W:2;try{if(typeof x=="string"){const ae=x.split("."),ee=ae[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=ae[1]?ae[1].substring(0,Q).padEnd(Q,"0"):"0".repeat(Q);return Q>0?`${ee}.${X}`:ee}return C(x,Q)}catch(ae){return console.error("Error formatting metric value:",ae,{num:x,decimals:Q}),String(x)}},I=(x,$)=>{const W=Number.parseInt(String($)||"2",10),Q=Number.isFinite(W)&&W>=0?W:2;try{if(typeof x=="string"){const ae=x.split("."),ee=ae[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=ae[1]?ae[1].length:0,N=Math.max(Q,X),z=ae[1]?ae[1].padEnd(N,"0"):"0".repeat(N);return N>0?`${ee}.${z}`:ee}return new Intl.NumberFormat("en-US",{minimumFractionDigits:Q,maximumFractionDigits:20}).format(x)}catch(ae){return console.error("Error formatting exact metric value:",ae,{num:x,decimals:Q}),String(x)}},T=q(()=>{var x;return((x=d.value)==null?void 0:x.metric_type.code)==="formula"}),P=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const x=s.value,{format_type:$,format_value:W,mapping:Q}=d.value;if(Q&&typeof Q=="object"&&!Array.isArray(Q)){const ae=Q[`!${x}`];if(ae)return ae}if($==="dropdown"){const ae=v.value.find(ee=>String(ee.name)===String(x));if(ae)return ae.name}if(typeof x=="string"){const ae=Number(x);return Number.isNaN(ae)?x:x.replace(/[.-]/g,"").length>16?I(x,W):I(ae,W)}return typeof x=="number"?I(x,W):String(x)}),{tooltip:M}=fP(""),D=async x=>{x.stopPropagation(),x.preventDefault(),x.stopImmediatePropagation();try{await navigator.clipboard.writeText(P.value),M.value="Copied",setTimeout(()=>{M.value="Copy"},3e3)}catch($){console.error("Failed to copy text:",$),M.value="Copy failed",setTimeout(()=>{M.value="Copy"},3e3)}};tt(()=>s.value,(x,$)=>{const W=Number(x);Number.isFinite(W)&&W!==h.value?h.value=W:x==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const O=()=>{r.value=!0},k=()=>{r.value=!1};return(x,$)=>Ke((K(),Ue(_o,Wt(H(S),{onMouseenter:O,style:{"--icon-size":"24px"},onMouseleave:k,ref_key:"wrapperRef",ref:a,actived:H(l),bordered:!0}),{suffix:he(()=>[s.disabled?Xe("",!0):(K(),ie("div",{key:0,class:te([x.$style.suffix,"wrapper-suffix"])},[r.value&&!H(u).isEmpty&&!H(u).isError?Ke((K(),Ue(at,{key:0,variant:["icon","secondary"],size:24,onClick:kt(D,["prevent","stop"])},{default:he(()=>[ue(lt,{src:"Copy",source:"remote",size:12})]),_:1})),[[H(o),{content:H(M),hideOnClick:!1,contentClass:"extra-padding"}]]):Xe("",!0)],2))]),default:he(()=>[me("div",{class:te(x.$style["metric-wrapper"]),"aria-label":H(d).format_value||void 0},[me("div",{class:te([x.$style["metric-content"],s.disabled?x.$style.disabled:""])},[!H(u).isError&&H(u).isEmpty?(K(),ie(It,{key:0},[H(u).pendingCalculation?Ke((K(),ie("span",{key:0,class:te(x.$style["metric-empty"])},[...$[0]||($[0]=[Qe(" - ",-1)])],2)),[[H(o),"Can’t calculate yet. Complete required fields."]]):H(u).isEmpty?(K(),ie("span",{key:1,class:te(x.$style["metric-empty"])}," - ",2)):Xe("",!0)],64)):Xe("",!0),H(u).isError?Ke((K(),ie("div",{key:1,class:te(x.$style["metric-error"])},[...$[1]||($[1]=[Qe(" Error ",-1)])],2)),[[H(o),"Something went wrong. Review formula, inputs and retry."]]):Xe("",!0),!H(u).isEmpty&&!H(u).isError?Ke((K(),ie("span",{key:2,class:te([x.$style["metric-value"],H(b)?x.$style.hovered:"",{[x.$style.disabled]:s.disabled}])},[Qe(ht(_.value),1)],2)),[[H(o),{content:g.value,bypassOverflowCheck:p.value}]]):Xe("",!0)],2)],10,pee)]),_:1},16,["actived"])),[[H(n),{isLoading:H(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_lu0ag_1","metric-content":"_metric-content_lu0ag_5",disabled:"_disabled_lu0ag_15","metric-value":"_metric-value_lu0ag_19",hovered:"_hovered_lu0ag_19","metric-error":"_metric-error_lu0ag_23","with-morpheme":"_with-morpheme_lu0ag_38","with-formula-icon":"_with-formula-icon_lu0ag_41","metric-value--number":"_metric-value--number_lu0ag_47","metric-value--currency":"_metric-value--currency_lu0ag_47","metric-value--percentage":"_metric-value--percentage_lu0ag_47","metric-morpheme":"_metric-morpheme_lu0ag_51","metric-empty":"_metric-empty_lu0ag_64","metric-icon":"_metric-icon_lu0ag_71"}}]]),gee={key:0,style:{color:"#6b6b6b"}},mee=Ct(st({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue","open"],setup(e,{expose:t,emit:n}){const o=Yt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},r={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},a={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},l=e,c={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=q(()=>{var k,x;if(l.headerType)return l.headerType;if(((x=(k=l.params)==null?void 0:k.column)==null?void 0:x.getColId()).includes("metric"))return"default";const O=l.headerType??l.params.column.getColId();return c[O]||"default"}),d=V(),h=()=>{var O,k,x;const F=(k=(O=l.params)==null?void 0:O.column)==null?void 0:k.getColDef();if((x=F.colId)!=null&&x.includes("metric")){if(F.context.is_primary==1)return"primary";if(F.context.is_point_metric==1)return"secondary"}};mh(()=>{d.value=h()}),Qt(()=>{d.value=h()});const f=q(()=>{var F,O;return((O=(F=l.params)==null?void 0:F.column.getColDef().context)==null?void 0:O.morpheme_value)||void 0}),p=q(()=>{var F;return(F=l.params)==null?void 0:F.displayName}),g=q(()=>{let F=[];switch(u.value){case"dateRange":F=Object.values(s).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break;case"date":F=Object.values(r).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break;case"number":F=Object.values(i).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break;default:F=Object.values(a).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break}return w.value!=="none"&&F.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),F}),v=q(()=>String(w.value).endsWith("asc")?"SortUp":String(w.value).endsWith("desc")?"SortDown":"Sort"),w=V(l.modelValue??"none"),S=F=>{if(D.value){D.value=!1;return}E("update:modelValue",F),E("sort-changed",F)},b=F=>{w.value=F},C=xr(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let F;w.value==="none"?F="asc":w.value==="asc"?F="desc":F="none",w.value=F}else{const F=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],k=(F.indexOf(w.value)+1)%F.length;w.value=F[k]}},li),_=q(()=>{if(w.value==="none")return"No sorting applied";const F=g.value.find(O=>O.value===w.value);return(F==null?void 0:F.label)||""}),E=n,I=q(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(w.value!=="none")return"var(--primary-color-hover)"});tt(()=>l.modelValue,F=>{F!=w.value&&(w.value=F)}),tt(w,F=>{F!==l.modelValue&&S(F)});const T=V(w.value);tt(()=>w.value,F=>{T.value=F});const P=F=>{var $,W;if(l.readOnly||l.disabled)return;let O=0;F.key==="ArrowDown"?O=1:F.key==="ArrowUp"&&(O=-1);const k=g.value.findIndex(Q=>Q.value===T.value),x=g.value.length;if(F.key==="Enter"||F.key===" ")F.preventDefault(),w.value=T.value,($=M.value)==null||$.hide();else if(O!==0){F.preventDefault();let Q=(k+O+x)%x;T.value=g.value[Q].value}else F.key==="Escape"&&((W=M.value)==null||W.hide())},M=V(null);Qt(()=>{var F,O;(O=(F=M.value)==null?void 0:F.$el)==null||O.addEventListener("keydown",P)}),Ol(()=>{var F,O;(O=(F=M.value)==null?void 0:F.$el)==null||O.removeEventListener("keydown",P)});const D=V(!1);return t({setDefaultSort:F=>{w.value=F?F.direction:"none",D.value=!0},clear:()=>{w.value="none"}}),(F,O)=>(K(),Ue(jS,{ref_key:"dropdownRef",ref:M,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:O[0]||(O[0]=k=>F.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:H(C),onSelect:O[1]||(O[1]=k=>b(k))},{prefix:he(()=>[ue(at,{variant:["text"],onClick:H(C),size:"small"},{default:he(()=>[Ke((K(),ie("b",null,[Qe(ht(p.value),1)])),[[H(o),{content:p.value}]]),f.value?(K(),ie("small",gee," ("+ht(f.value)+") ",1)):Xe("",!0),d.value=="primary"?Ke((K(),ie("div",{key:1,class:te(F.$style["icon-metric"])},[ue(lt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[H(o),"Woohoo metric"]]):Xe("",!0),d.value=="secondary"?Ke((K(),ie("div",{key:2,class:te(F.$style["icon-metric"])},[ue(lt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[H(o),"Point Metric"]]):Xe("",!0)]),_:1},8,["onClick"])]),iconDropdown:he(()=>[Ke(ue(lt,{src:v.value,source:"remote",color:I.value},null,8,["src","color"]),[[H(o),_.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),vee=["disabled","readonly","checked","indeterminate"],LO=Ct(st({__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=Yt,o=ko,s=e,r=t,i=q(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=q(()=>s.allowIndeterminate?[Ft.UNCHECK,Ft.INDETERMINATE,Ft.CHECKED]:[Ft.UNCHECK,Ft.CHECKED]),l=q(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case Ft.UNCHECK:return s.tooltipText.unchecked;case Ft.INDETERMINATE:return s.tooltipText.indeterminate;case Ft.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=V(typeof s.modelValue=="boolean"?s.modelValue?Ft.CHECKED:Ft.UNCHECK:s.modelValue),d=q(()=>({checked:u.value===Ft.CHECKED,indeterminate:u.value===Ft.INDETERMINATE,none:u.value===Ft.UNCHECK})),h=q(()=>s.disabled||s.readOnly);return tt(()=>u.value,f=>{r("update:modelValue",f===Ft.CHECKED)}),(f,p)=>Ke((K(),ie("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:te([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:cn({"--input-size":i.value})},null,46,vee)),[[H(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[H(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),yee=Ct(st({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=Yt,o=uv(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=ns(o),a=V(new Set);tt(i,C=>{s(C)},{immediate:!0});const l=q(()=>i.value!==Ft.UNCHECK),c=q(()=>({checked:i.value===Ft.CHECKED,indeterminate:i.value===Ft.INDETERMINATE,UNCHECK:i.value===Ft.UNCHECK})),u=q(()=>({[Ft.UNCHECK]:"Click to select all",[Ft.INDETERMINATE]:"Click to clear selection",[Ft.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=q(()=>{const C=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&C.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),C}),h=C=>({selected:C.getSelectedRows().length,total:r.value.total,loaded:r.value.loaded}),f=({api:C,state:_})=>{if(C)if(_===Ft.UNCHECK)C.deselectAll(),a.value.clear(),i.value=_;else if(_===Ft.CHECKED){const E=new Set;C.forEachNode(I=>{I.isSelected()&&E.add(I.id||"")}),a.value=E,C.forEachNode(I=>I.setSelected(!0)),i.value=_}else C.forEachNode(E=>E.setSelected(!0)),i.value=_},p=()=>{var E;const C=(E=t.params)==null?void 0:E.api;if(!C){console.error("[HeaderCheckbox] There is no API available");return}const _={[Ft.UNCHECK]:Ft.INDETERMINATE,[Ft.INDETERMINATE]:Ft.UNCHECK,[Ft.CHECKED]:Ft.UNCHECK};f({api:C,state:_[i.value]})},g=C=>{var I;const _=(I=t.params)==null?void 0:I.api;if(!_){console.error("no api");return}const E={INDETERMINATE:Ft.INDETERMINATE,GLOBAL:Ft.CHECKED,UNCHECK:Ft.UNCHECK};f({api:_,state:E[C]})},v=xr(C=>{const{selected:_,total:E}=h(C);if(E==0){i.value=Ft.UNCHECK;return}_===E?i.value=Ft.CHECKED:_===0?i.value=Ft.UNCHECK:i.value=Ft.INDETERMINATE},300);let w=[];const S=C=>{v(C)};Qt(()=>{var T;const C=(T=t.params)==null?void 0:T.api;if(!C)return;const _=P=>v(P.api),E=()=>S(C),I=()=>S(C);C.addEventListener("selectionChanged",_),C.addEventListener("rowDataUpdated",E),C.addEventListener("modelUpdated",E),w=[()=>C.removeEventListener("selectionChanged",_),()=>C.removeEventListener("rowDataUpdated",E),()=>C.removeEventListener("modelUpdated",I)]}),qn(()=>{w.forEach(C=>C())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(C,_)=>(K(),Ue(jS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:he(()=>[Ke((K(),Ue(LO,{"tab-index":"8",id:b,disabled:t.disabled,key:H(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:H(i),"onUpdate:modelValue":_[0]||(_[0]=E=>mn(i)?i.value=E:null),onChange:p,"aria-label":H(i)===H(Ft).CHECKED?"All items selected":"Select visible items",class:te(C.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[H(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),VO=Ct(st({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=Ts,n=Yt,o=e,{isEditing:s}=$u(o),r=V(null),i=V(null),a=q(()=>o.value),l=q(()=>a.value===void 0),c=q(()=>{var g,v;return((g=a.value)==null?void 0:g.name)||((v=a.value)==null?void 0:v.label)||"No status"}),u=q(()=>{var g;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:RK((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:d,isHover:h}=Co(u),f=q(()=>{var g;return((g=a.value)==null?void 0:g.color)||"#fff"}),p=q(()=>new Pn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((K(),Ue(H(_o),Wt(H(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!H(s)&&!H(h)||!a.value?"#f3f5f8":void 0}}),{default:he(()=>[l.value?Xe("",!0):(K(),ie("div",{key:0,class:te({[g.$style["status-renderer"]]:!0,[g.$style["has-status"]]:a.value,[g.$style["has-suffix"]]:!!g.$slots.suffix})},[a.value?(K(),ie(It,{key:0},[Ke((K(),ie("div",{class:te(g.$style["status-renderer__status-name"])},[Qe(ht(c.value),1)],2)),[[H(n),{content:c.value,delay:[1e3,0]}]]),Dt(g.$slots,"suffix")],64)):(K(),ie(It,{key:1},[me("div",{class:te(g.$style["status-renderer__color-code"])},null,2),v[0]||(v[0]=me("span",{style:{color:"#a6a6a6"}},"No status",-1)),Dt(g.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[H(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_k5c36_1","has-status":"_has-status_k5c36_9","has-suffix":"_has-suffix_k5c36_12","status-renderer__color-code":"_status-renderer__color-code_k5c36_22","status-renderer__status-name":"_status-renderer__status-name_k5c36_33"}}]]),KS=Ct(st({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},minWidth:{default:"300px"},popupIndex:{default:109},showCloseBtn:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,s=q(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=W7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),c=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};Qt(()=>{document.addEventListener("keydown",c)}),qn(()=>{document.removeEventListener("keydown",c)}),t({show:i,hide:a,isVisible:l});const u=n;return tt(()=>l.value,d=>{u(d?"shown":"hidden")}),(d,h)=>{const f=eu("tooltip");return K(),ie("div",{ref_key:"popupRef",ref:r,class:te(d.$style.popupContainer)},[me("div",{class:te(d.$style.popupWrapper)},[me("div",{class:te(d.$style.header)},[Dt(d.$slots,"header",{},()=>[me("span",{class:te(d.$style["header-title"])},ht(e.popupName),3)]),o.showCloseBtn?Ke((K(),Ue(at,{key:0,variant:["icon","text"],onClick:H(a),"aria-label":"Close popup",size:"small"},{default:he(()=>[ue(lt,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Xe("",!0)],2),me("div",{class:te(d.$style.body)},[Dt(d.$slots,"default")],2),d.$slots.footer?(K(),ie("div",{key:0,class:te(d.$style.footer)},[Dt(d.$slots,"footer")],2)):Xe("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1986t_1",popupWrapper:"_popupWrapper_1986t_9",popupFadeIn:"_popupFadeIn_1986t_1",header:"_header_1986t_24","header-title":"_header-title_1986t_34",body:"_body_1986t_43",footer:"_footer_1986t_48"}}]]),wee={...{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 Cee extends Error{}class Xa extends Cee{constructor(){super("Zone is an abstract class")}}class BO{get type(){throw new Xa}get name(){throw new Xa}get ianaName(){return this.name}get isUniversal(){throw new Xa}offsetName(t,n){throw new Xa}formatOffset(t,n){throw new Xa}offset(t){throw new Xa}equals(t){throw new Xa}get isValid(){throw new Xa}}const qS=new Map;function bee(e){let t=qS.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"}),qS.set(e,t)),t}const See={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Eee(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function _ee(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=See[r];r==="era"?o[a]=i:hv(a)||(o[a]=parseInt(i,10))}return o}const YS=new Map;class dv extends BO{static create(t){let n=YS.get(t);return n===void 0&&YS.set(t,n=new dv(t)),n}static resetCache(){YS.clear(),qS.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=dv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Tee(t,n,o,this.name)}formatOffset(t,n){return pv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=bee(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?_ee(o,n):Eee(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=Dee({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let ZS=null;class Xu extends BO{static get utcInstance(){return ZS===null&&(ZS=new Xu(0)),ZS}static instance(t){return t===0?Xu.utcInstance:new Xu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Xu(HO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${pv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${pv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return pv(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 hv(e){return typeof e>"u"}function fv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function $O(e){if(!(hv(e)||e===null||e===""))return parseInt(e,10)}function Ree(e){if(!(hv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Dee(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 Tee(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function HO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function pv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${fv(n,2)}:${fv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${fv(n,2)}${fv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const GO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ju(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function Qu(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function UO(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=$O(t[n+s]);return[o,null,n+s]}}const WO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Iee=`(?:${WO.source}?(?:\\[(${GO.source})\\])?)?`,zO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jO=RegExp(`${zO.source}${Iee}`),XS=RegExp(`(?:[Tt]${jO.source})?`),xee=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Fee=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Pee=/(\d{4})-?(\d{3})/,kee=UO("weekYear","weekNumber","weekDay"),Aee=UO("year","ordinal"),Oee=/(\d{4})-(\d\d)-(\d\d)/,KO=RegExp(`${zO.source} ?(?:${WO.source}|(${GO.source}))?`),Mee=RegExp(`(?: ${KO.source})?`);function ed(e,t,n){const o=e[t];return hv(o)?n:$O(o)}function Nee(e,t){return[{year:ed(e,t),month:ed(e,t+1,1),day:ed(e,t+2,1)},null,t+3]}function td(e,t){return[{hours:ed(e,t,0),minutes:ed(e,t+1,0),seconds:ed(e,t+2,0),milliseconds:Ree(e[t+3])},null,t+4]}function xf(e,t){const n=!e[t]&&!e[t+1],o=HO(e[t+1],e[t+2]),s=n?null:Xu.instance(o);return[{},s,t+3]}function Ff(e,t){const n=e[t]?dv.create(e[t]):null;return[{},n,t+1]}Ju(xee,XS),Ju(Fee,XS),Ju(Pee,XS),Ju(jO),Qu(Nee,td,xf,Ff),Qu(kee,td,xf,Ff),Qu(Aee,td,xf,Ff),Qu(td,xf,Ff),Qu(td),Ju(Oee,Mee),Ju(KO),Qu(td,xf,Ff);function nd(e){"@babel/helpers - typeof";return nd=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},nd(e)}var Do=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Do||{});Do.review,Do.review_take,Do.review_scene,Do.review_rendition,Do.review_frame,Do.review_rendition_comment,Do.review_comment,Do.scene_hub,Do.hub_rendition,Do.hub_comment,Do.people_insight,Do.people_detail,Do.project,Do.woohoo,Do.update,Do.core,Do.project_focusMode;var JS=null;function Lee(e){JS=e}function gv(){if(!JS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return JS}function qO(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=gv();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function Vee(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&nd(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function Bee(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function YO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function ZO(e,t){if(!e||nd(e)!=="object")return null;try{var n=gv();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var w,S=t.toUpperCase();v=(w=p[g])===null||w===void 0||(w=w.errorMessages)===null||w===void 0||(w=w[S])===null||w===void 0||(w=w.validation_rules)===null||w===void 0?void 0:w[c]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[c]}if(v&&typeof v=="string")return Vee(v,a,u,d)}catch(C){console.error("Error in validation rules",C)}}}}catch(C){return console.error("Error in getValidationErrorMessage:",C),null}return null}function $ee(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return qO();var n=e.code,o=e.error,s=e.details,r=e.message;if(YO(s)&&s){var i=ZO(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=gv();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(o&&nd(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(o.key),f=gv(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var w=v;return s!=null&&s.context&&(w=Bee(w,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",w)),n!==""?"[".concat(n,"] ").concat(w," ").concat(t):"".concat(w," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&nd(o)!=="object"&&YO(s)){var S=ZO(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):qO()}const oa=rc("toast",()=>{const e=l=>{var c;if((l==null?void 0:l.apiCode)==="offline")s({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const u=$ee((c=l==null?void 0:l.res)==null?void 0:c.data);s({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=V([]),n=(l,c)=>{const u=wee[l];if(u){const d=u[c];if(d){s({id:l,type:c,message:d});return}}else s({id:l,type:c,message:l})},o=new Map,s=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{r(u.id),o.delete(u.id)},c);o.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function r(l){t.value=t.value.filter(u=>u.id!==l);const c=o.get(l);c&&(clearTimeout(c.timeoutId),o.delete(l))}function i(l){const c=o.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=o.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{r(l),o.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:s,removeNotification:r,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:i,resumeAutoDismiss:a}}),Hee=["onMouseenter","onMouseleave"],Gee=["innerHTML"],Uee=["innerHTML"],Wee=["data-tooltip"],zee={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},jee=Ct(st({__name:"Snackbar",setup(e){const t=Yt,n=IW,o=oa(),{removeNotification:s}=o,{notifications:r}=ns(o),i=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=V(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(K(),Ue(dW,{name:"list",tag:"div",class:te(["notification-center",f.$style["notification-wrapper"]])},{default:he(()=>[(K(!0),ie(It,null,Fn(H(r),g=>{var v;return Ke((K(),ie("div",{key:g.id,class:te([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:w=>d(g.id),onMouseleave:w=>h(g.id)},[me("p",{class:te(f.$style.snackbar__message)},[me("span",{class:te(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(K(),Ue(lt,{key:0,src:"CircleCheck",source:"remote"})):Xe("",!0),!g.icon&&g.type=="interactive"?(K(),Ue(lt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(K(),Ue(lt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(K(),ie("i",{key:3,class:te(f.$style["icon-draw"]),innerHTML:g.icon},null,10,Gee)):g.icon&&!i(g.icon)?(K(),Ue(lt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)],2),me("span",{class:te(f.$style["error-message"])},[me("span",{class:te(f.$style.message),innerHTML:g.message},null,10,Uee)],2)],2),g.actions?(K(),ie("div",{key:0,class:te(f.$style["actions-notification"]),"data-notification":"true"},[(K(!0),ie(It,null,Fn(g.actions,w=>(K(),Ue(at,Wt({key:w.label},{ref_for:!0},w,{onClick:kt(w.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:he(()=>[w.btnIcon?(K(),Ue(lt,{key:0,src:w.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)]),_:2},1040,["onClick"]))),128))],2)):Xe("",!0),g.type!=="interactive"?Ke((K(),ie("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ue(at,{variant:"secondary",onClick:w=>c(g.message),class:te(f.$style["copy-btn"])},{prefix:he(()=>[ue(lt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Wee)),[[H(t),a.value]]):Xe("",!0),g.type=="interactive"?Ke((K(),ie("div",zee,[ue(at,{variant:"tertiary",onClick:w=>H(s)(g.id),class:te(f.$style["close-btn"]),size:18},{default:he(()=>[ue(lt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[H(t),"Close"]]):Xe("",!0)],42,Hee)),[[H(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_jf7je_1","notification-item":"_notification-item_jf7je_15","notification--success":"_notification--success_jf7je_30","notification--error":"_notification--error_jf7je_36","close-btn":"_close-btn_jf7je_42","notification--info":"_notification--info_jf7je_45","notification--warning":"_notification--warning_jf7je_52","notification--interactive":"_notification--interactive_jf7je_59","snackbar-type":"_snackbar-type_jf7je_67",snackbar__message:"_snackbar__message_jf7je_76",message:"_message_jf7je_89","error-message":"_error-message_jf7je_97",snackbar__icon:"_snackbar__icon_jf7je_103","actions-notification":"_actions-notification_jf7je_112","icon-draw":"_icon-draw_jf7je_120","copy-btn":"_copy-btn_jf7je_128"}}]]);/*!
|
|
152
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,r=l},f:function(){try{i||n.return==null||n.return()}finally{if(a)throw r}}}}function US(e,t,n){return(t=RO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function _O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EO(Object(n),!0).forEach(function(o){US(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function aQ(e,t){if(e==null)return{};var n,o,s=lQ(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function lQ(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function uc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(f,p,g,v){var w=p&&p.prototype instanceof a?p:a,S=Object.create(w.prototype);return Ms(S,"_invoke",function(b,C,_){var E,I,T,P=0,M=_||[],D=!1,F={p:0,n:0,v:e,a:O,f:O.bind(e,4),d:function(k,x){return E=k,I=0,T=e,F.n=x,i}};function O(k,x){for(I=k,T=x,t=0;!D&&P&&!$&&t<M.length;t++){var $,W=M[t],Q=F.p,ae=W[2];k>3?($=ae===x)&&(T=W[(I=W[4])?5:(I=3,3)],W[4]=W[5]=e):W[0]<=Q&&(($=k<2&&Q<W[1])?(I=0,F.v=x,F.n=W[1]):Q<ae&&($=k<3||W[0]>x||x>ae)&&(W[4]=k,W[5]=x,F.n=ae,I=0))}if($||k>1)return i;throw D=!0,x}return function(k,x,$){if(P>1)throw TypeError("Generator is already running");for(D&&x===1&&O(x,$),I=x,T=$;(t=I<2?e:T)||!D;){E||(I?I<3?(I>1&&(F.n=-1),O(I,T)):F.n=T:F.v=T);try{if(P=2,E){if(I||(k="next"),t=E[k]){if(!(t=t.call(E,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,I<2&&(I=0)}else I===1&&(t=E.return)&&t.call(E),I<2&&(T=TypeError("The iterator does not provide a '"+k+"' method"),I=1);E=e}else if((t=(D=F.n<0)?T:b.call(C,F))!==i)break}catch(W){E=e,I=1,T=W}finally{P=1}}return{value:t,done:D}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(Ms(t={},o,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,c):(f.__proto__=c,Ms(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=c,Ms(d,"constructor",c),Ms(c,"constructor",l),l.displayName="GeneratorFunction",Ms(c,s,"GeneratorFunction"),Ms(d),Ms(d,s,"Generator"),Ms(d,o,function(){return this}),Ms(d,"toString",function(){return"[object Generator]"}),(uc=function(){return{w:r,m:h}})()}function Ms(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}Ms=function(r,i,a,l){function c(u,d){Ms(r,u,function(h){return this._invoke(u,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(c("next",0),c("throw",1),c("return",2))},Ms(e,t,n,o)}function cQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RO(e){var t=cQ(e,"string");return typeof t=="symbol"?t:t+""}function uQ(e,t){if(e){if(typeof e=="string")return bO(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bO(e,t):void 0}}var dQ=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"],hQ=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};HS(this,e),this.accessTokenKey=o.accessTokenKey||"access_token",this.refreshTokenKey=o.refreshTokenKey||"refresh_token",this.domain=o.domain,this.path=o.path||"/",this.secure=(t=o.secure)!==null&&t!==void 0?t:!0,this.sameSite=o.sameSite||"lax",this.canSetTokens=(n=o.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=o.cookieParser}return GS(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=iQ(o),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(i=i.trim(),i.startsWith(n+"=")){var a=i.substring(n.length+1);return this.cookieParser?this.cookieParser(a,n):decodeURIComponent(a)}}}catch(l){s.e(l)}finally{s.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(n){if(!this.canSetTokens||typeof document>"u"){console.warn("CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}var o=this.domain?"; domain=".concat(this.domain):"",s=this.secure?"; secure":"",r="; samesite=".concat(this.sameSite),i="",a="";if(n.expires_in&&typeof n.expires_in=="number"){var l=new Date;l.setTime(l.getTime()+n.expires_in*1e3),i=";expires=".concat(l.toUTCString())}var c=this.getExpiresInRefreshToken();if(sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refresh token",n),console.log("[DEBUG] refresh token expires_in value",c)),c){var u=new Date;u.setTime(u.getTime()+Number(c)*1e3),a=";expires=".concat(u.toUTCString())}if(n.access_token||n.token){var d=n.access_token||n.token,h="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(d),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(i);document.cookie=h}if(n.refresh_token_expires_in&&typeof n.refresh_token_expires_in=="number"){var f=new Date;f.setTime(f.getTime()+n.refresh_token_expires_in*1e3),i=";expires=".concat(f.toUTCString())}if(n.refresh_token){sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refesh token set to",n.refresh_token),console.log("[DEBUG] refresh token expires_in set to",a));var p="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(n.refresh_token),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(a);document.cookie=p}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),fQ=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";HS(this,e),US(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return GS(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(n){console.error("Failed to create BroadcastChannel, falling back to storage events:",n),this.channel=null}}},{key:"broadcastEvent",value:function(n){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={type:n,data:s,timestamp:Date.now()};this.channel?this.channel.postMessage(r):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(r)),setTimeout(function(){return localStorage.removeItem(o.storageKey)},100))}},{key:"onEvent",value:function(n){var o=this;return this.channel?this.channel.onmessage=function(s){n(s.data)}:typeof window<"u"&&window.addEventListener("storage",function(s){if(s.key===o.storageKey&&s.newValue)try{var r=JSON.parse(s.newValue);n(r)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){o.channel?o.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),pQ=function(){function e(t){var n=this;HS(this,e),US(this,"currentAttempt",0),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new fQ,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){console.log("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(o){console.error("Token refresh failed:",o)},this.onTokenInvalid=t.onTokenInvalid||function(){console.log("Token is invalid or cannot be refreshed");var o=new Error("No refresh token available");n.onRefreshFailure(o),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"})}}return GS(e,[{key:"initCrossTabListener",value:function(){var n=this;this.authStateManager.onEvent(function(o){o.type==="auth:logout"&&(console.log("Received logout event:",o.data),o.data&&o.data.sourceInstanceId!==n.instanceId?(console.log("Logout event from different tab, executing logout handlers"),n.onCrossTabLogout?(console.log("Executing onCrossTabLogout with reason: ".concat(o.data.reason||"cross_tab_logout")),n.onCrossTabLogout(o.data.reason||"cross_tab_logout")):typeof n.onLogout=="function"?(console.log("Executing legacy onLogout with reason: ".concat(o.data.reason)),n.onLogout(o.data.reason)):console.warn("No logout handler defined for cross-tab events")):console.log("Ignoring self-generated logout event"))})}},{key:"handleTokenRefresh",value:function(){var t=$S(uc().m(function o(){var s=this,r,i,a,l;return uc().w(function(c){for(;;)switch(c.p=c.n){case 0:if(r=this.tokenStorage.getRefreshToken(),sessionStorage.getItem("APP_DEBUG")&&console.log("[DEBUG] on handle token refresh",r),r){c.n=1;break}return console.log("No refresh token available"),this.onTokenInvalid(),c.a(2,!1);case 1:return this.currentAttempt=0,c.p=2,c.n=3,this.executeWithRetry(function(){return console.log("Refresh attempt ".concat(s.currentAttempt+1,"/").concat(s.maxRetries)),s.refreshTokenFn(s.tokenStorage.getRefreshToken())});case 3:if(i=c.v,!(!i||!i.access_token&&!i.token)){c.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return i.token&&!i.access_token&&(i.access_token=i.token),console.log("Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(i),this.onRefreshSuccess(i),c.a(2,!0);case 5:return c.p=5,l=c.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((a=l)===null||a===void 0?void 0:a.message)||"Token refresh failed after maximum retries"}),c.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=$S(uc().m(function o(s){var r,i,a;return uc().w(function(l){for(;;)switch(l.p=l.n){case 0:return l.p=0,l.n=1,s();case 1:return l.a(2,l.v);case 2:if(l.p=2,a=l.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){l.n=3;break}throw console.log("Maximum retry attempts (".concat(this.maxRetries,") reached")),a;case 3:return r=a.response&&a.response.status===425,i=r?this.getRetryAfterDelay(a):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),console.log("Retry in ".concat(i,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),l.n=4,new Promise(function(c){return setTimeout(c,i)});case 4:return l.a(2,this.executeWithRetry(s))}},o,this,[[0,2]])}));function n(o){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(n){if(n.response&&n.response.headers){var o=n.response.headers["retry-after"];if(o){var s=parseInt(o,10);if(!isNaN(s))return s*1e3;var r=new Date(o);if(!isNaN(r.getTime()))return r.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";console.log("Broadcasting logout event with reason: ".concat(n)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,timestamp:Date.now()})}}])}();function gQ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=n.tokenExpiredDetection,s=o===void 0?function(u){var d;return((d=u.response)===null||d===void 0?void 0:d.status)===401}:o,r=n.retryStatusCodes,i=r===void 0?[401,425]:r,a=n.tokenHeaderFormatter,l=a===void 0?function(u){return"Bearer ".concat(u)}:a,c=null;e.interceptors.response.use(function(u){return u},function(){var u=$S(uc().m(function d(h){var f,p,g,v,w,S,b,C,_;return uc().w(function(E){for(;;)switch(E.p=E.n){case 0:if(v=h.config,v){E.n=1;break}return E.a(2,Promise.reject(h));case 1:if(!v._retry){E.n=2;break}return E.a(2,Promise.reject(h));case 2:if(w=(f=h.response)===null||f===void 0?void 0:f.status,!(!w||!i.includes(w)||!s(h))){E.n=3;break}return E.a(2,Promise.reject(h));case 3:if(S=((p=v.url)===null||p===void 0?void 0:p.includes("refresh-token"))||((g=v.url)===null||g===void 0?void 0:g.includes("refreshToken")),!S){E.n=4;break}return E.a(2,Promise.reject(h));case 4:return v._retry=!0,E.p=5,c?console.log("Using existing refresh promise"):(console.log("Starting token refresh"),c=t.handleTokenRefresh()),E.n=6,c;case 6:if(b=E.v,c=null,b){E.n=7;break}return console.log("Token refresh failed"),E.a(2,Promise.reject(h));case 7:return C=t.tokenStorage.getAccessToken(),C&&(v.headers.Authorization=l(C)),console.log("Retrying original request with new token"),E.a(2,e(v));case 8:return E.p=8,_=E.v,console.error("Error during refresh:",_),c=null,E.a(2,Promise.reject(h))}},d,null,[[5,8]])}));return function(d){return u.apply(this,arguments)}}()),e.interceptors.request.use(function(u){if(u.headers.Authorization)return u;var d=t.tokenStorage.getAccessToken();return d&&(u.headers.Authorization=l(d)),u},function(u){return Promise.reject(u)})}function mQ(e){var t=e.accessTokenKey,n=e.refreshTokenKey,o=e.domain,s=e.path,r=e.secure,i=e.sameSite,a=e.canSetTokens,l=e.cookieParser,c=aQ(e,dQ),u=new hQ({accessTokenKey:t,refreshTokenKey:n,domain:o,path:s,secure:r,sameSite:i,canSetTokens:a,cookieParser:l});return new pQ(_O(_O({},c),{},{storage:u}))}var Ro=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Ro||{});Ro.review,Ro.review_take,Ro.review_scene,Ro.review_rendition,Ro.review_frame,Ro.review_rendition_comment,Ro.review_comment,Ro.scene_hub,Ro.hub_rendition,Ro.hub_comment,Ro.people_insight,Ro.people_detail,Ro.project,Ro.woohoo,Ro.update,Ro.core,Ro.project_focusMode;const cv={accessToken:"account.token",refreshToken:"account.refresh_token"},DO={baseUrl:"BASE_URL",cookieDomain:"BASE_DOMAIN_COOKIE"},TO="/refresh-token",vQ=3e5,yQ="*",IO={Accept:"application/json","Content-Type":"application/json"},wQ="undefined",CQ="No access token found",dc={badRequest:400,unauthorized:401,tooEarly:425},bQ=[dc.unauthorized,dc.tooEarly,dc.badRequest],SQ={maxRetries:5,retryDelay:500,backoffFactor:1.5},EQ="unauthenticated",_Q="invalid_token",RQ="refresh_token_expired",DQ={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},TQ="Session refreshed successfully",IQ="Session expired. Please log in again.",xQ=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},FQ=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==dc.badRequest?!1:xQ((n=e.response)==null?void 0:n.data)===_Q},PQ=()=>{},xO=e=>sessionStorage.getItem(e)||"",WS=()=>{const e=Fm.get(cv.accessToken);return e&&e!==wQ?e:null},kQ=()=>!!Fm.get(cv.refreshToken),AQ=()=>{const e=window.location.origin,t=xO(DO.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class zS{constructor(t,n=PQ,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=mQ({accessTokenKey:cv.accessToken,refreshTokenKey:cv.refreshToken,domain:xO(DO.cookieDomain)||void 0,secure:window.location.protocol==="https:",sameSite:"lax",refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(TQ,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(IQ,"error"),this.handleAuthExpired()},onCrossTabLogout:()=>this.handleAuthExpired(),...SQ});this.handler=t,gQ(this.client,t,{retryStatusCodes:[...bQ],tokenExpiredDetection:zS.isTokenExpired})}refreshAccessToken(){return!this.handler||!kQ()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var i,a;const n=(i=t==null?void 0:t.response)==null?void 0:i.status;if(n===dc.tooEarly)return!0;const{error:o,details:s={}}=((a=t==null?void 0:t.response)==null?void 0:a.data)??{},r=typeof o=="string"?o:o==null?void 0:o.key;return n===dc.badRequest||n!==dc.unauthorized||typeof o=="string"||r!==EQ?!1:Object.keys(s).length===0||s.reason===RQ}async refresh(t){const n=await this.client.post(TO,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return console.log("Refreshing tokens:",{tokens:o,res:n}),{access_token:o.access_token,refresh_token:o.refresh_token,expires_in:o.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(DQ,AQ())}}class OQ{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=Qn.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??vQ,headers:{...IO,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,o){return this.request({...o,method:"POST",url:t,data:n})}put(t,n,o){return this.request({...o,method:"PUT",url:t,data:n})}patch(t,n,o){return this.request({...o,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:o,requireToken:s}=this.options;typeof n=="function"&&(t.baseURL=n());const r=t.url===TO,i=r?WS():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(CQ);t.headers.set("Accept-Language",yQ),t.headers.has("Content-Type")||t.headers.set("Content-Type",IO["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),i&&t.headers.set("Authorization",`Bearer ${i}`);for(const[a,l]of Object.entries((o==null?void 0:o(t))??{}))t.headers.set(a,l);return t})}async resolveAccessToken(){const t=WS();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),WS())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:o,onError:s}=this.options;t&&(this.tokenRefresher=new zS(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(FQ(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const MQ=5,NQ=1e3,LQ=3,VQ="default",BQ=e=>new URL(e,"http://localhost").pathname;class $Q{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??MQ,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??NQ}async run(t,n){const o=this.resolveGroup(t);await this.acquire(o);try{return await n()}finally{this.release(o)}}resolveGroup(t){const n=BQ(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:VQ;let r=this.groups.get(s);return r||(r={limit:(o==null?void 0:o.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(s,r)),r}acquire(t){return new Promise(n=>{const o=()=>{t.ongoing++,n()};t.ongoing<t.limit?o():t.queue.push(o)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const HQ=(e,t)=>{const n=new $Q(t),o=Qn.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},GQ=(e,{maxRetries:t=LQ}={})=>{e.interceptors.response.use(void 0,async n=>{var a,l;const o=n.config;if(((a=n.response)==null?void 0:a.status)!==429||!o)return Promise.reject(n);const s=(o._retryCount??0)+1;if(s>t)return Promise.reject(n);o._retryCount=s;const r=Number.parseInt(String(((l=n.response.headers)==null?void 0:l["retry-after"])??""),10),i=Number.isNaN(r)?2**s*1e3:r*1e3;return await new Promise(c=>setTimeout(c,i)),e.request(o)})},UQ=6e4,WQ="/start",zQ=(e=WQ)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;console.log("Redirecting to auth URL:",n),window.location.replace(n)};function jQ(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class KQ{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>jQ("API_BASE_URL","");this.callbackFunc=t,this.api=new OQ({baseURL:i,timeout:UQ,requireToken:!0,onAuthExpired:zQ,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&HQ(this.axios,o),s!==!1&&GQ(this.axios,s)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(s,String(i))):typeof r=="object"?n.append(s,JSON.stringify(r)):n.append(s,String(r)))});const o=n.toString();return o?`?${o}`:""}async send(t,n,{params:o,data:s,options:r}={}){try{const i=o?this.buildQueryParams(o):"",a={...r,method:t,url:`${this.buildUrl(n)}${i}`};return s!==void 0&&(a.data=s),(await this.axios.request(a)).data}catch(i){throw BJ(i)}}get(t="",n,o){return this.send("GET",t,{params:n,options:o})}post(t="",n,o,s){return this.send("POST",t,{params:n,data:o,options:s})}put(t="",n,o){return this.send("PUT",t,{data:n,options:o})}patch(t="",n,o){return this.send("PATCH",t,{data:n,options:o})}delete(t="",n,o){return this.send("DELETE",t,{data:n,options:o})}}const qQ=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),YQ=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)};class FO extends KQ{constructor(t,n,o){const s=n==null?void 0:n.domainApi,r=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(o,{concurrency:{rules:[{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2$/,limit:1},{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2\/metrics$/,limit:5}]}}),this.events=Object.create(null);const a=qQ({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([c,u])=>{const d=c;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=u)}),this.apiConfig=l}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(r){console.error(`Error in event listener for ${t}:`,r)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:r,responseType:i,autoDownload:a=!0}){var u,d;const l=this.buildHeaders(s);let c;try{if(c=await this.axios.request({method:t,url:n,params:o,data:s,headers:l,responseType:i}),(((u=c.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const f=((d=c.headers)==null?void 0:d["content-disposition"])||"",p=f.includes("filename=")?f.split("filename=")[1]:"exported_items.xlsx";a&&YQ(c.data,p)}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:c,success:!0}),c.data}catch(h){throw console.error("API Request Error:",h),h.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:h,success:!1,apiCode:r,res:h==null?void 0:h.response}),h}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,r])=>{o=o.replace(`{${s}}`,String(r))}),o}async request(t,n,o={}){const{url:s,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:i,path:a,params:o.params,payload:o.payload,code:r,responseType:o.responseType,autoDownload:o.autoDownload})}async getAllItem_cursor(t){var r;const n=t.workspaceId,o={entity_ids:((r=t.entityIds)==null?void 0:r.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:o||1,name_like:s||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const r={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:r})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return o.length||(delete s.item_ids,s.entity_id=t.entityId),this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){var s;const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return((s=t.itemIds)==null?void 0:s.length)==0&&(o.entity_id=t.entityId,delete o.item_ids),this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const r={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:r})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s}){const r={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:r})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:r,filterParams:i}){const a={item_ids:n,start_date:o,due_date:s,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,r={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=s):(r.item_ids=n,r.entity_id=void 0),r}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:r}){const i={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:r}=t,i={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:r}=t,i={item_ids:o,template_flow_status_id:s};return o.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:1,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:s})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o}){const s={item_ids:n,status:0,entity_id:o};return!n||n.length===0?s.item_ids=void 0:s.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:s})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:r,clear:i}=t,a={item_ids:o,metric_id:s,metric_value:r,clear:i??(r==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n,o=!0){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:r,entity_ids:i}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const ZQ=(e,t,n,o,s,r,i)=>{const{apiServices:a}=Zn(n,o),l=V(!1),c=()=>{l.value=!0},u=()=>{vt(()=>{setTimeout(()=>{l.value=!1},500)})},d=q(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),h=yn("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();try{const w={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?w.clear=1:w.value=g,d.value?(delete w.itemIds,w.entityId=String(o.entityId)):w.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(w));(S==null?void 0:S.message)=="Done"&&t(p)}catch(w){console.error("Error during bulk metric update:",w)}u()}}},XQ=Ct(st({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=EA(),o=V([]),s=e,r=t,i=V([]),a=V(null),l=W=>{var ee,X,N;const Q=o.value.findIndex(z=>z.id===W.id);a.value=Q;const ae=(ee=i.value[Q])==null?void 0:ee.$el;(X=_.value)==null||X.scrollTo(Q*30),ae&&ae.scrollIntoView({behavior:"smooth",block:"center"}),c(Q),(N=i.value[Q])==null||N.show()},c=W=>{a.value=W,i.value.forEach((Q,ae)=>{ae!==W&&Q&&Q.hide()})},u=V(""),d=()=>{u.value="",i.value.forEach(W=>{W==null||W.hide()}),a.value=null},h=q(()=>s.selectedIds||[]),f=q(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=yn("isSelectAll",V(!1)),g=yn("bulkUpdate",V(!1)),v=V(null),{handleUpdate:w,isUpdating:S}=ZQ(f,W=>{var Q;r("update",W),d(),(Q=v.value)==null||Q.hide()},!1,s,g,p),b=async W=>{var Q;r("update-start");try{await w(W),r("update-completed")}catch{r("update-failed"),(Q=v.value)==null||Q.open()}},C=W=>{d(),vt(()=>{var Q;(Q=_.value)==null||Q.focus()})},_=V(null),E=(W,Q)=>{var ae;W?(ae=_.value)==null||ae.focus():d(),W&&Q!==W&&$("")},I=V(!0),T=V(!0),{apiServices:P}=Zn(!1,s),M=async(W,Q,ae)=>{var ee;try{return ae?T.value=!0:I.value=!0,await((ee=P.value)==null?void 0:ee.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:W,query:Q,per_page:10}))}catch(X){throw console.error("Failed to fetch metric list:",X),X}finally{I.value=!1,T.value=!1}},D=V(0),F=V(!0),O=W=>({id:String(W.id),label:String(W.name),value:String(W.id),description:W.morpheme_value?`${String(W.morpheme_value)}`:"",type:n.checkEditType(W),metricConfig:W}),k=W=>W.filter(Q=>!Q.formula).filter(Q=>{var ae;return((ae=Q==null?void 0:Q.auth_permission)==null?void 0:ae.permission)==2}).map(O),x=async()=>{D.value+=1;const W=await M(D.value,u.value,!0);if(W&&W.data){const Q=k(W.data);o.value=[...o.value,...Q],F.value=W.meta.last_page!=W.meta.current_page}else F.value=!1},$=async W=>{u.value=W,D.value=1;try{const Q=await M(D.value,u.value);Q&&Q.data?(o.value=k(Q.data),F.value=Q.meta.last_page!=Q.meta.current_page):o.value=[]}catch{o.value=[]}};return(W,Q)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:v,isUpdating:H(S),disabled:s.disabled||H(S),onOnVisibleChange:E},{trigger:he(({hide:ae,disabled:ee})=>[ue(at,{variant:s.variant,loading:H(S),disabled:ee,onEscape:ae},{default:he(()=>[ue(lt,{src:"SquareRootVariable",class:"icon"}),Q[1]||(Q[1]=Qe(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({isVisible:ae,popupRef:ee,hide:X})=>[Ke(ue(na,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:o.value,loading:I.value,"loading-more":T.value,"selected-id":void 0,"has-more":F.value,onSearch:$,onSelect:l,onLoadMore:Q[0]||(Q[0]=()=>x()),onCancel:X},{item:he(({item:N,index:z,selectedIndex:ne})=>[ue(pX,{ref:pe=>i.value[z]=pe,label:N.label,type:N.type,morpheme:N.description||"",onFocusOnSearch:C,onOpen:pe=>c(z),attachTo:ee,config:N.metricConfig,onHandleUpdate:b,class:te(["metric-update-item",{selected:a.value===z||ne===z}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":he(()=>[...Q[2]||(Q[2]=[me("div",{style:{width:"250px"}},null,-1)])]),"empty-list":he(()=>[...Q[3]||(Q[3]=[Qe("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[Ks,ae]])]),default:he(()=>[Q[4]||(Q[4]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-a645d131"]]),uv=rc("bulkUpdate",()=>{const e=V(Ft.UNCHECK),t=ds({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=ds({isBulkUpdating:!1});function r(u){s.isBulkUpdating=u}const i=V({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(Ft.CHECKED)}}}),JQ={class:"status-label"},PO=Ct(st({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Yt,o=e,s=t,r=a=>{s("select",a)},i=a=>new Pn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(K(),ie("div",{class:te(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[me("div",{class:"status-color",style:cn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),Ke((K(),ie("div",JQ,[Dt(a.$slots,"label",{},()=>[Qe(ht(e.status.name),1)],!0)])),[[H(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),QQ=["innerHTML"],kO=Ct(st({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,r=n,i=V([]),a=V(!1),l=V(!1),c=V(null),u=V(o.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=q(()=>{var O;return(O=s.value)==null?void 0:O.id});q(()=>!!(s.id||s.ids&&s.ids.length>0));const g=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),v=q(()=>{const O=new Set;return s.id&&O.add(String(s.id)),s.ids&&s.ids.forEach(k=>{k&&O.add(String(k))}),Array.from(O)}),w=yn("bulkUpdate",!1),{apiServices:S}=Zn(!w,s),b=uv(),{selectionStatus:C}=ns(b),_=yn("filterParams",null),E=async(O=o.INITIAL_PAGE,k="",x=!1)=>{var $,W,Q,ae;x?l.value=!0:a.value=!0,c.value=null;try{const ee={workspaceId:String(s.workspaceId),itemIds:v.value,page:O,perPage:o.PER_PAGE,name_like:k.trim(),..._||{},entityId:String(s.entityId)};if((($=S.value)==null?void 0:$.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const X=await((W=S.value)==null?void 0:W.getAssignableStatus(ee));if(!(X!=null&&X.data)){x||(i.value=[]),d.value=!1;return}const N=X.data.map(g);i.value=x?[...i.value,...N]:N,h.value=((Q=X.meta)==null?void 0:Q.total)??X.data.length,d.value=!((ae=X.meta)!=null&&ae.on_last_page),u.value=O}catch(ee){console.error("Error fetching statuses:",ee),c.value="Failed to load statuses",x||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},I=xr(async O=>{f.value=O,u.value=o.INITIAL_PAGE,await E(o.INITIAL_PAGE,O,!1)},li),T=async()=>{!d.value||l.value||await E(u.value+1,f.value,!0)},P=()=>{var O;r("cancel"),(O=s.params)==null||O.api.stopEditing()},M=async O=>{var k,x,$;try{const W={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(O.value),entityId:String(s.entityId),filterParams:_!=null&&_.value?_==null?void 0:_.value:void 0};if(C.value==Ft.CHECKED&&w&&(W.itemIds=void 0,W.entityId=String(s.entityId)),r("start-update"),!await S.value.updateItemStatus(W))throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:C.value==Ft.CHECKED&&w,data:{id:O.id,name:O.label,color:O.color}}),s.params&&((x=s.params)==null||x.node.setData({...(k=s.params)==null?void 0:k.node.data,status:{id:O.id,name:O.label,color:O.color}}),($=s.params)==null||$.api.stopEditing()),r("finish-update")}catch(W){console.error("Error updating status:",W),c.value="Failed to update status",r("error",c.value)}},D=q(()=>i.value.map(O=>({...O})));tt([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{E()},{deep:!0,immediate:!0});const F=V(null);return Qt(()=>{vt(()=>{var O;(O=F.value)==null||O.focus()})}),t({refresh:()=>E(o.INITIAL_PAGE,f.value,!1),loadMore:T,focus:()=>{var O;return(O=F.value)==null?void 0:O.focus()}}),(O,k)=>{var x;return K(),Ue(na,Wt({ref_key:"popupRef",ref:F},s,{"selected-id":(x=s.value)==null?void 0:x.id,options:D.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:H(I),onSelect:M,onLoadMore:T,onCancel:P,onClose:P}),{item:he(({item:$,selectedIndex:W,isSelected:Q,handleItemHover:ae,getHighlightedLabel:ee,query:X,idx:N})=>[(K(),Ue(PO,{key:$.value,status:$.data,selected:Q($),onMouseover:z=>ae(N),onSelect:z=>M($),hovered:N===W},{label:he(()=>[X?(K(),ie("span",{key:0,class:te([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:ee($.label)},null,10,QQ)):(K(),ie("span",{key:1,class:te(O.$style["item-label"]),style:{flex:"1"}},ht($.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"}}]]),eee=st({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,o=q(()=>{const f=oo();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=V(!1),i=V(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}finally{s("update-completed")}},l=q(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));Jr("bulkUpdate",!0);const c=f=>{var p,g;console.trace("handleUpdateCompleted called with success:",f),r.value=!1,f?(s("update-completed"),(p=i.value)==null||p.destroy()):(s("update-failed"),(g=i.value)==null||g.open())},u=V(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return tt(()=>n.ids,()=>{}),(f,p)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:he(({hide:g,disabled:v})=>[ue(at,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:he(()=>[ue(lt,{src:"Square",class:"icon"}),p[2]||(p[2]=Qe(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({hide:g})=>[ue(kO,Wt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:he(()=>[p[3]||(p[3]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tee={style:{"max-width":"225px","line-height":"14px"}},nee={style:{"max-width":"100px","line-height":"14px"}},oee=Ct(st({__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=Yt,o=ko,s=e,r=t,i=uv(),{handelSelectAll:a}=i,{selectionStatus:l}=ns(i),c=q(()=>l.value===Ft.CHECKED),u=q(()=>s.selectRowData.map(ve=>ve.id)),d=q(()=>s.selectRowData.length>0);Jr("bulkUpdate",d),Jr("isSelectAll",c);const h=({itemIds:ve,data:we,isUpdateAll:re})=>{const U=s.gridApi;[...ve].forEach(oe=>{if(!U){console.error("Grid API is undefined");return}const Re=U.getRowNode(oe);if(Re&&!Re.data.isLocked){const G={...Re.data,status:we};Re.setData(G)}})},f=q(()=>s.selectRowData),p=({itemIds:ve,data:we})=>{const re=s.gridApi;if(!re){console.error("Grid API is undefined");return}ve.forEach(U=>{const ge=re.getRowNode(U);if(ge){const oe=ge.data.dateRange||[null,null];"startDate"in we&&we.startDate!==void 0&&(oe[0]=we.startDate?new Date(we.startDate):null),"dueDate"in we&&we.dueDate!==void 0&&(oe[1]=we.dueDate?new Date(we.dueDate):null);const Re={...ge.data,dateRange:oe};ge.setData(Re)}}),r("updated")},g=q(()=>s.selectRowData.map(ve=>ve.id)),v=ve=>{const we=s.gridApi,{id:re,value:U}=ve;if(!we){console.error("Grid API is undefined");return}g.value.forEach(ge=>{const oe=we.getRowNode(ge);if(oe){const Re={...oe.data,[`metric_${re}`]:U};oe.setData(Re)}}),r("updated")},w=["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=()=>{r("unselect")},C=vS(),{userPermissions:_}=ns(C),E=q(()=>_.value.includes(yS)),I=q(()=>{if(!E.value){console.error("User does not have permission to open review.");return}if(l.value==Ft.CHECKED)return es({type:"review_take",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url;const ve=s.selectRowData.map(re=>re.id).join(",");return es({type:"review_multiple_scenes",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:ve}}).url}),T=ve=>{const{assignees:we,type:re}=ve,U=s.gridApi;if(!U){console.error("Grid API is not available for bulk update.");return}s.selectRowData.map(oe=>{const Re=U.getRowNode(oe.id);if(!Re)return null;const G=Re.data.assignees||[];let Y=[];switch(re){case"add":{const de=new Set(G.map(xe=>xe.id)),ke=we.filter(xe=>!de.has(xe.id));Y=[...G,...ke];break}case"overwrite":{Y=we;break}case"remove":{const de=new Set(we.map(ke=>ke.id));Y=G.filter(ke=>!de.has(ke.id));break}case"removeAll":{Y=[];break}}return{...Re.data,assignees:Y}}).filter(oe=>oe!==null).forEach(oe=>{const Re=U.getRowNode(oe.id);Re&&Re.setData(oe)})},{apiServices:P}=Zn(!1,s),M=async()=>{var U;const ve=s.selectRowData.map(ge=>ge.id),we=s.gridApi;if(!we){console.error("Grid API is not available for bulk delete.");return}const re=await((U=P.value)==null?void 0:U.bulkDeleteItems(k.value));(re==null?void 0:re.message)=="Done"&&(ve.forEach(ge=>{const oe=we.getRowNode(ge);if(oe){const Re={...oe.data,isDeleted:!0,disabled:!0};oe.setData(Re)}}),we.deselectAll())},D=V(null),F=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id);if(!s.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const re=await((U=P.value)==null?void 0:U.bulkUnarchiveItems(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to unarchive items."),(ge=D.value)==null||ge.open();return}$(ve,"isArchived",!1),(oe=D.value)==null||oe.hide()},O=yn("filterParams",void 0),k=q(()=>({workspaceId:String(s.workspaceId),itemIds:d.value&&c.value?[]:s.selectRowData.map(ve=>ve.id),entityId:s.entityId,filterParams:O!=null&&O.value?O.value:void 0})),x=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id);if(!s.gridApi){console.error("Grid API is not available for bulk archive.");return}const re=await((U=P.value)==null?void 0:U.bulkArchiveItems(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to archive items."),(ge=D.value)==null||ge.open();return}$(ve,"isArchived",!0),(oe=D.value)==null||oe.hide()},$=(ve,we,re)=>{const U=s.gridApi;if(!U){console.error("Grid API is not available for bulk update.");return}const ge=ve.map(oe=>{const Re=U.getRowNode(oe);if(Re){const G={...Re.data,[we]:re};Re.setData(G)}return Re}).filter(oe=>oe!=null);U.redrawRows({rowNodes:ge})},W=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id),we=s.gridApi;if(!we){console.error("Grid API is not available for bulk thumbnail deletion.");return}const re=await((U=P.value)==null?void 0:U.deleteThumbnail(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to delete thumbnails."),(ge=D.value)==null||ge.open();return}ve.forEach(Re=>{const G=we.getRowNode(Re);if(G){const Y={...G.data,thumbnail:null};G.setData(Y)}}),(oe=D.value)==null||oe.hide()},Q=async()=>{var U,ge,oe;const ve=s.selectRowData.map(Re=>Re.id),we=s.gridApi;if(!we){console.error("Grid API is not available for bulk rendition deletion.");return}const re=await((U=P.value)==null?void 0:U.deleteRendition(k.value));if((re==null?void 0:re.message)!="Done"){console.error("Failed to delete renditions."),(ge=D.value)==null||ge.open();return}ve.forEach(Re=>{const G=we.getRowNode(Re);if(G){const Y={...G.data,rendition:null};G.setData(Y)}}),(oe=D.value)==null||oe.hide()},ae=V(!1),ee=V(null),X=async ve=>{var we,re;try{switch(z.value=!0,ae.value=!0,ve.id){case"unarchive":await F();break;case"delete":await M();break;case"archive":await x();break;case"delete-thumbnail":await W();break;case"delete-rendition":await Q();break;default:console.error("Unknown action:",ve.id),ae.value=!1;break}}catch(U){console.error("Error performing action:",U),(we=D.value)==null||we.open()}finally{(re=ee.value)==null||re.focus(),vt(()=>{z.value=!1,ae.value=!1})}},N=(ve,we)=>{var re;!ve&&we&&((re=ee.value)==null||re.focus())},z=V(!0),ne=ve=>{vt(()=>{z.value=ve})};tt(()=>s.selectRowData,ve=>{z.value=!1},{deep:!0,immediate:!0});const pe=q(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:w,disabled:z.value,ids:l.value==Ft.CHECKED?[]:u.value}));return(ve,we)=>Ke((K(),ie("div",{class:te(ve.$style["bulk-update-action"])},[me("div",{class:te(ve.$style["left-actions"])},[me("div",{class:te(ve.$style["selection-track"])},[ue(at,{class:te(ve.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),H(l)==H(Ft).INDETERMINATE?(K(),ie("span",{key:0,class:te(ve.$style["selected-count"])},ht(e.selectRowData.length)+" selected ",3)):Xe("",!0),H(l)==H(Ft).CHECKED?(K(),ie("span",{key:1,class:te(ve.$style["selected-count"]),style:{"line-height":"14px"}},[we[12]||(we[12]=Qe(' All in " ',-1)),Ke((K(),ie("span",tee,[Qe(ht(e.takeName),1)])),[[H(n),{content:e.takeName}]]),we[13]||(we[13]=Qe(' " ',-1))],2)):Xe("",!0),!e.loading&&H(l)==H(Ft).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(K(),Ue(at,{key:2,variant:"secondary",onHandleClick:H(a)},{default:he(()=>[me("span",{class:te(ve.$style["selected-count"]),style:{"line-height":"14px"}},[we[14]||(we[14]=Qe(' Select all in " ',-1)),Ke((K(),ie("span",nee,[Qe(ht(e.takeName),1)])),[[H(n),{content:e.takeName}]]),we[15]||(we[15]=Qe(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Xe("",!0),me("span",{class:te(ve.$style.divider)},null,2)],2),ue(eee,Wt(pe.value,{onUpdated:h,onUpdateStart:we[0]||(we[0]=re=>z.value=!0),onUpdateCompleted:we[1]||(we[1]=re=>ne(!1)),onUpdateFailed:we[2]||(we[2]=re=>ne(!1)),"selected-all":H(l)==H(Ft).CHECKED}),null,16,["selected-all"]),ue(HZ,Wt({onUpdate:T,onUpdateStart:we[3]||(we[3]=re=>z.value=!0),onUpdateCompleted:we[4]||(we[4]=re=>ne(!1)),onUpdateFailed:we[5]||(we[5]=re=>ne(!1)),"selected-all":H(l)==H(Ft).CHECKED},pe.value),null,16,["selected-all"]),ue(eX,Wt({"row-selected":f.value,"selected-all":H(l)==H(Ft).CHECKED},pe.value,{onUpdated:p,onUpdateStart:we[6]||(we[6]=re=>z.value=!0),onUpdateCompleted:we[7]||(we[7]=re=>ne(!1)),onUpdateFailed:we[8]||(we[8]=re=>ne(!1))}),null,16,["row-selected","selected-all"]),ue(XQ,{disabled:z.value,onUpdate:v,onUpdateStart:we[9]||(we[9]=re=>z.value=!0),onUpdateCompleted:we[10]||(we[10]=re=>ne(!1)),onUpdateFailed:we[11]||(we[11]=re=>ne(!1)),selectedIds:u.value,"workspace-id":e.workspaceId,variant:w,"entity-id":e.entityId,"selected-all":H(l)==H(Ft).CHECKED},null,8,["disabled","selectedIds","workspace-id","entity-id","selected-all"]),me("span",{class:te(ve.$style.divider)},null,2),Ke((K(),ie("div",null,[E.value?(K(),Ue(at,{key:0,class:te(ve.$style["action-button"]),variant:[...w,"icon"],href:I.value,disabled:s.selectRowData.length>40&&H(l)!=H(Ft).CHECKED},{default:he(()=>[ue(lt,{src:"PenRuler",class:te(ve.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Xe("",!0)])),[[H(n),s.selectRowData.length<=40||H(l)==H(Ft).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),me("span",{class:te(ve.$style.divider)},null,2),ue(yf,{ref_key:"wrapperRef",ref:D,isUpdating:z.value,disabled:z.value,onOnVisibleChange:N},{trigger:he(({hide:re,toggle:U,isVisible:ge,disabled:oe})=>[Ke((K(),Ue(at,{onEscape:re,actived:ge,ref_key:"moreActionRef",ref:ee,class:te(ve.$style["action-button"]),variant:["secondary","icon"],loading:ae.value,disabled:oe||z.value,onClick:kt(U,["stop"])},{default:he(()=>[ue(lt,{src:"EllipsisVertical",class:te(ve.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[H(o),"99999"],[H(n),{content:"More actions"}]])]),popup:he(({isVisible:re,hide:U})=>[(K(),ie(It,null,Fn(S,(ge,oe)=>ue(ic,Wt({clickable:!0,key:ge.id},{ref_for:!0},ge,{show:re,style:{borderLeft:0},"focus-index":"99999."+oe,onClick:()=>{X(ge)},onEscape:U}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[Ks,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1m5lx_1","left-actions":"_left-actions_1m5lx_19","right-actions":"_right-actions_1m5lx_20","selection-track":"_selection-track_1m5lx_25","btn-close":"_btn-close_1m5lx_31","close-icon":"_close-icon_1m5lx_37","selected-count":"_selected-count_1m5lx_41",divider:"_divider_1m5lx_47","more-button":"_more-button_1m5lx_52",dropdown:"_dropdown_1m5lx_56","dropdown-content":"_dropdown-content_1m5lx_59",delete:"_delete_1m5lx_82","icon-btn":"_icon-btn_1m5lx_89","selected-list":"_selected-list_1m5lx_93"}}]]),Za=Ct(st({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=Ts,n=Yt,o=e,s=q(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=Co(s),i=q(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=q(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=ue(Gh,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});hC(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=q(()=>o.value===void 0);return(c,u)=>Ke((K(),Ue(_o,Wt(H(r),{ref:"displayWrapperRef"}),{default:he(()=>[me("span",{class:te(c.$style["item-table-label-renderer"])},ht(o.value||"-"),3)]),_:1},16)),[[H(t),{isLoading:l.value||!i.value}],[H(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),see=["placeholder","maxlength"],ree={key:0,class:"wrapper-suffix"},iee=Ct(st({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Ts,s=Yt,r=e,i=n,a=V(r.value),l=V(null),c=V(null),u=V(r.value||""),d=V(!1),h=V(!1),f=q(()=>{var D;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((D=r.value)==null?void 0:D.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=Co(f),v=()=>u.value!==a.value,w=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const D=l.value.value;if(!v()){d.value=!1;return}a.value=D,i("update:value",D),i("enter",D),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():w(),i("blur",u.value))},C=D=>{var F;if(D.key==="ArrowLeft"||D.key==="ArrowRight"){D.stopPropagation();return}D.ctrlKey&&(D.key=="a"||D.key=="A")?(D.stopPropagation(),(F=l.value)==null||F.select()):D.key==="Enter"?(D.preventDefault(),D.stopPropagation(),S()):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation(),w())},_=()=>{a.value=r.value,u.value=r.value,d.value=!0,vt(()=>{var D,F;(D=l.value)==null||D.click(),(F=l.value)==null||F.focus()})},E=()=>{var D;d.value?w():(D=l.value)==null||D.blur(),i("blur",u.value)},I={focus:()=>{_()}};Qt(()=>{var F;const D=(F=c.value)==null?void 0:F.$el;D&&(D.__sceneNameEditor=I)}),qn(()=>{const D=c.value;D&&delete D.__sceneNameEditor});const T=V(null),P=V(null);t({focus:_,blur:()=>{var D;return(D=l.value)==null?void 0:D.blur()},save:S,cancel:w,focusEditButton:()=>{vt(()=>{var D;(D=T.value)==null||D.focus()})},focusCancelButton:()=>{vt(()=>{var D;(D=P.value)==null||D.focus()})},startEdit:_});const M=q(()=>r.value===void 0);return bS(c,()=>{d.value&&b()}),(D,F)=>Ke((K(),Ue(H(_o),Wt(H(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),tu({default:he(()=>[d.value?Xe("",!0):Dt(D.$slots,"default",{key:0,isEditting:d.value,isHover:H(g)},()=>[Ke((K(),ie("span",{class:te(D.$style["label-renderer"])},[Qe(ht(u.value),1)],2)),[[H(s),{content:u.value||void 0}]])]),Ke(me("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":F[0]||(F[0]=O=>u.value=O),class:te(D.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:C,onBlur:b},null,42,see),[[Ks,d.value],[QT,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:he(({hovered:O,focused:k})=>[O?(K(),ie("div",ree,[O&&!k?Ke((K(),Ue(at,{key:0,variant:["icon","secondary"],size:24,onClick:kt(_,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:T,onKeydown:[jn(kt(_,["prevent","stop"]),["enter"]),jn(kt(E,["prevent","stop"]),["escape"])]},{default:he(()=>[ue(H(lt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[H(s),"Edit"]]):Xe("",!0)])):Xe("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[H(o),{isLoading:M.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),aee=["tabindex"],AO=Ct(st({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Yt,s=Ts,r=e,i=n,a=V(r.value),l=V(r.value),c=V(null),u=V(null),d=yn("bulkUpdate",!1),{apiServices:h}=Zn(!d,r),f=q(()=>{var ee;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((ee=a==null?void 0:a.value)==null?void 0:ee.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=Co(f),g=q(()=>{const ee=un.getInstance().getItem("ws.code"),X=un.getInstance().getItem("BASE_URL"),N=ee||r.workspaceId;return es({type:"scene_hub",config:{baseDomain:X,ws_code:N,scene_id:String(r.id)}}).url}),v=q(()=>{var ee,X,N;return((X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.state)==0||((N=r.data)==null?void 0:N.isDeleted)==!0}),w=q(()=>r.readOnly||E.value),S=q(()=>{var ee,X,N,z,ne;return((ee=r.data)==null?void 0:ee.isDeleted)==!0||((N=(X=r.data)==null?void 0:X.isProcessing)==null?void 0:N.state)==0||((ne=(z=r.data)==null?void 0:z.isProcessing)==null?void 0:ne.state)==1}),b=q(()=>{var ee,X;return(X=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:X.message}),C=q(()=>{var ee;return((ee=r.data)==null?void 0:ee.isArchived)==1}),_=q(()=>{var ee;return((ee=r.data)==null?void 0:ee.isLocked)==1}),E=q(()=>r.value===void 0),I=q(()=>{var ee,X;return((X=(ee=r.data)==null?void 0:ee.permissions)==null?void 0:X.has_edit_permission)==1}),T=async ee=>{var X,N,z,ne,pe,ve,we,re,U,ge;a.value=ee,p.value=!1;try{const oe=await((N=(X=h.value)==null?void 0:X.updateSceneName)==null?void 0:N.call(X,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),Re=Fm.get(oP)||"UTC";if(oe){const G=aP(oe,Re),Y={...r.data,...G};(z=r.params)==null||z.api.clearFocusedCell();const de=((pe=(ne=r.params)==null?void 0:ne.column)==null?void 0:pe.getColId())||"",ke=((we=(ve=r.params)==null?void 0:ve.node)==null?void 0:we.rowIndex)||0;(re=r.params)==null||re.api.setFocusedCell(ke,de),(ge=(U=r.params)==null?void 0:U.node)==null||ge.setData(Y),l.value=a.value,i("enter")}else a.value=l.value}catch(oe){console.error("Failed to update scene name:",oe),a.value=l.value}},P={focus:()=>{p.value=!0,vt(()=>{var ee;return(ee=u.value)==null?void 0:ee.focus()})},startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}},M=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;tt(()=>r.value,ee=>{a.value=ee,l.value=ee}),Qt(()=>{const ee=M();ee&&(ee.__sceneNameEditor=P)}),qn(()=>{const ee=u.value,X=ee&&"$el"in ee?ee.$el:ee;X&&delete X.__sceneNameEditor});const D=mf(),{openSceneHub:F}=D,O=ee=>{try{if(ee.ctrlKey||ee.metaKey){window.open(g.value,"_blank");return}F(String(r.id))}catch{window.open(g.value,"_blank")}finally{Q()}},k=()=>{setTimeout(()=>{ae.value=!0,x.value=0,vt(()=>{var ee;(ee=$.value)==null||ee.focus()})},300)},x=V(-1),$=V(null);t({focus:k,trigerFocus:k,startEdit:()=>{var ee;(ee=u.value)==null||ee.startEdit()}});const W=ee=>{if(ee.key==="Enter"){ee.preventDefault(),O(ee);return}if(ee.key==="Escape"){ee.preventDefault(),Q();return}ee.key==="Tab"&&(ee.preventDefault(),ee.stopPropagation(),ee.stopImmediatePropagation(),vt(()=>{var X;(X=u.value)==null||X.focusEditButton()}))},Q=()=>{var N,z,ne,pe,ve,we;ae.value=!1,x.value=-1,(N=r.params)==null||N.api.clearFocusedCell();const ee=((ne=(z=r.params)==null?void 0:z.column)==null?void 0:ne.getColId())||"",X=((ve=(pe=r.params)==null?void 0:pe.node)==null?void 0:ve.rowIndex)||0;(we=r.params)==null||we.api.setFocusedCell(X,ee)},ae=V(!1);return(ee,X)=>Ke((K(),Ue(iee,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":w.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":X[0]||(X[0]=N=>a.value=N),id:`scene-name-${r.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ae.value,onBlur:Q},{default:he(({isHover:N,isEditting:z})=>[Ke(me("div",{class:te(ee.$style["scene-name-display"])},[Ke((K(),ie("a",{tabindex:x.value,ref_key:"nameRef",ref:$,onClick:kt(O,["prevent"]),onKeydown:W,target:"_blank",class:te(ee.$style["scene-name-text"]),style:{lineHeight:"28px"}},[Qe(ht(a.value),1)],42,aee)),[[H(o),{content:a.value,delay:[1e3,0]}]]),w.value||!N&&!z&&!w.value?(K(),ie(It,{key:0},[_.value?Ke((K(),ie("div",{key:0,class:te([ee.$style["icon-processing"],ee.$style.isLocked])},[ue(lt,{src:"Lock",color:I.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[H(o),{content:I.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Xe("",!0),C.value?Ke((K(),ie("div",{key:1,class:te([ee.$style["icon-processing"],ee.$style.archived])},[ue(lt,{src:"BoxArchive"})],2)),[[H(o),{content:"Archived",delay:[1e3,0]}]]):Xe("",!0),S.value?Ke((K(),ie("div",{key:2,class:te([ee.$style["icon-processing"],ee.$style.processing,v.value&&ee.$style["icon-red"]])},[ue(lt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[H(o),b.value]]):Xe("",!0)],64)):Xe("",!0)],2),[[Ks,!H(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[H(s),{isLoading:E.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),jS=Ct(st({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick","open"],setup(e,{expose:t,emit:n}){const o=ko,s=V([]),r=e,i=V(null),a=q(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=q(()=>{let w=[];return typeof r.variant=="string"?w.push(r.variant):Array.isArray(r.variant)&&(w=[...r.variant]),[...w,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=yo({toggleOnClick:!0,offset:[0,0],onShow:()=>c("open")});function v(w){c("select",w),u()}return mh(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),tt(d,w=>{var S;w&&((S=p.value)==null||S.focus())}),(w,S)=>(K(),ie("div",{class:te(w.$style["button-dropdown-wrapper"]),style:cn({"--button-size":a.value})},[me("div",{class:te(w.$style["button-group"])},[Dt(w.$slots,"prefix"),me("div",{ref_key:"triggerRef",ref:f,class:te(H(d)?w.$style.open:"")},[Dt(w.$slots,"triggerDropdown",{open:H(d)},()=>[r.readOnly?Xe("",!0):Ke((K(),Ue(at,{key:0,onEscape:H(u),ref_key:"mainButton",ref:i,actived:H(d),class:te(w.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:he(()=>[Dt(w.$slots,"iconDropdown",{},()=>[ue(lt,{class:te(w.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[H(o),e.tabIndex]])])],2)],2),me("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:te(w.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(K(!0),ie(It,null,Fn(e.options,(b,C)=>Ke((K(),Ue(ic,Wt({ref_for:!0,ref:_=>s.value[C]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:kt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:he(()=>[Qe(ht(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[H(o),`${e.tabIndex}.${C}`]])),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"}}]]),If=Ct(st({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Yt,o=e,s=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},i=q(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(K(),ie("div",{class:te(a.$style["close-wrapper"])},[e.disableRemove?Xe("",!0):(K(),ie("div",{key:0,class:te(a.$style["close-button"])},[Ke((K(),Ue(at,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:he(()=>[ue(lt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[H(n),i.value]])],2)),Dt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),lee=Ct(st({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=Yt,n=Ts,o=e,{isEditing:s}=$u(o),r=V(o.value),i=V(null),a=V(null),{apiServices:l}=Zn(!0,o),c=V(!0),u=()=>{c.value=o.value===void 0};gh(()=>{u()}),Qt(()=>{u()}),tt(()=>o.value,T=>{u()});const d=q(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=Co(d),p=q(()=>{var T;return((T=r.value)==null?void 0:T.slice(0,o.maxVisible))||[]}),g=q(()=>{var T;return Math.max(0,(((T=r.value)==null?void 0:T.length)||0)-o.maxVisible)}),v=q(()=>{var T;return g.value<=0?"":((T=r.value)==null?void 0:T.slice(o.maxVisible).map(P=>P.name).join(", "))||""}),w=q(()=>p.value.map(T=>({id:T.id,name:T.name,initial:T.initial,avatarId:T.id,profile_image:T.profile_image,color:T.color,size:24,user:T}))),S=q(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));tt(()=>o.value,T=>{r.value=T},{immediate:!0,deep:!0});const b=async T=>{var M,D,F;await I(T)&&(r.value=(M=r.value)==null?void 0:M.filter(O=>O.id!==T),(F=o.params)==null||F.node.setData({...(D=o.params)==null?void 0:D.node.data,assignees:r.value}))},C=T=>{var M;const P=un.getInstance().getItem("ws.code");return((M=l.value)==null?void 0:M.getUserInformation(P,T))||Promise.resolve(null)},{id:_}=ag(o),E=T=>{var M,D;const P=(D=(M=o.params)==null?void 0:M.api)==null?void 0:D.getRowNode(String(_.value));P==null||P.setDataValue("assignees",rb(T.assignees))},{removeAssignee:I}=Om({...o,entityId:o.entityId,updateRowData:E,value:o.value,errorCallback:()=>{}});return(T,P)=>Ke((K(),Ue(_o,Wt(H(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:he(()=>{var M;return[me("div",{class:te(T.$style.assigneeGroupRenderer)},[((M=r.value)==null?void 0:M.length)===0?(K(),Ue(lt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:cn(S.value)},null,8,["style"])):Xe("",!0),(K(!0),ie(It,null,Fn(w.value,D=>(K(),Ue(If,{key:D.id,"disable-remove":o.readOnly||o.disabled,onClear:F=>b(D.id),style:{marginLeft:"0"}},{default:he(()=>[ue(Gu,{user:D.user,"show-profile":!0,apiUpdateFunction:C,class:te(T.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((K(),ie("div",{key:1,class:te(T.$style["extra-avatars"])},[Qe(" +"+ht(g.value),1)],2)),[[H(t),v.value]]):Xe("",!0)],2)]}),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),cee=Ct(st({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var E,I;const t=Yt,n=Ts,o=Hb(),s=e,r=V(null),i=V(null),{isEditing:a}=$u(s),l=T=>{if(T){if(typeof T=="string")return T;if(T instanceof Date)return T.toISOString()}},c=q(()=>s.value===void 0),u=q(()=>{var T;return(T=s.data)==null?void 0:T.isStarted}),d=q(()=>{var T;return(T=s.data)==null?void 0:T.isCompleted}),h=q(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=q(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=q(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=Co(p),{startDate:v,endDate:w,startClasses:S,endClasses:b,fullStartDate:C,fullEndDate:_}=V7({start:l((E=s.value)==null?void 0:E[0]),end:l((I=s.value)==null?void 0:I[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(T,P)=>Ke((K(),Ue(_o,Wt(H(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:he(()=>[c.value?Xe("",!0):(K(),ie("div",{key:0,class:te(T.$style.dateRangeRenderer)},[h.value?Xe("",!0):(K(),Ue(lt,{key:0,src:"Calendar",class:te(T.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(K(),ie(It,{key:1},[Ke((K(),ie("span",{class:te([T.$style.dateLabelDisplay,...H(S).map(M=>T.$style[M])])},[Qe(ht(H(v)),1)],2)),[[H(t),H(C)]]),P[0]||(P[0]=me("span",null,"→",-1)),Ke((K(),ie("span",{class:te([T.$style.dateLabelDisplay,...H(b).map(M=>T.$style[M])])},[Qe(ht(H(w)),1)],2)),[[H(t),H(_)]])],64)):Xe("",!0)],2))]),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),uee=st({__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:Hb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=V(null);Qt(()=>{vt(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var w;(w=s.params)==null||w.api.stopEditing(),r("closed")},a=w=>`${bt.fromJSDate(w,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async w=>{await v({startDate:w[0]?a(w[0]):null,dueDate:w[1]?a(w[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async w=>{await v({startDate:w?a(w):null})},h=async w=>{await v({dueDate:w?a(w):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=yn("bulkUpdate",!1),{apiServices:g}=Zn(!p,s),v=async w=>{var S,b,C,_,E;try{const I=(S=o.value)==null?void 0:S.getValues(),T=await((C=(b=g.value)==null?void 0:b.changeDate)==null?void 0:C.call(b,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:w.startDate,dueDate:w.dueDate}));T!=null&&T.message&&((E=s.params)==null||E.node.setData({...(_=s.params)==null?void 0:_.node.data,dateRange:I==null?void 0:I.dateRange}))}catch(I){console.error("Failed to update scene name:",I)}};return t({focus:()=>{vt(()=>{var w;(w=o.value)==null||w.focus()})}}),(w,S)=>(K(),Ue(Ym,Wt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),dee=Ct(st({__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),o=V(0);let s=null;Qt(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),Ol(()=>{s&&n.value&&s.unobserve(n.value)});const r=q(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(K(),ie("div",{class:te(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[me("div",{class:te(i.$style["item-header"])},[me("div",{class:te(i.$style["item-header__left"])},[Dt(i.$slots,"header-left",{},()=>[me("h1",{class:te(i.$style["item-header__title"])},[Dt(i.$slots,"title",{},()=>[a[0]||(a[0]=Qe("Items",-1))])],2)])],2),me("div",{class:te(i.$style["item-header__spacer"])},null,2),me("div",{class:te(i.$style["item-header__actions"])},[Dt(i.$slots,"header-actions")],2)],2),Dt(i.$slots,"grid",{availableHeight:r.value}),me("div",{class:te(i.$style.footer)},[Dt(i.$slots,"footer")],2),Dt(i.$slots,"new-row"),Dt(i.$slots,"bulk-update-actions"),Dt(i.$slots,"snackbar"),Dt(i.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),OO=Ct(st({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=ko,s=e,r=q(()=>(s==null?void 0:s.workspaceId)||""),i=q(()=>(s==null?void 0:s.entityId)||""),a=()=>{var k,x,$;return($=(k=s.params)==null?void 0:k.api)==null?void 0:$.getCellRendererInstances({columns:["options"],rowNodes:(x=s.params)!=null&&x.node?[s.params.node]:[]})[0]},l=()=>{var x,$,W,Q;const k=a();($=(x=k==null?void 0:k.componsenExposed)==null?void 0:x.blur)==null||$.call(x),(Q=(W=k==null?void 0:k.container)==null?void 0:W.parentElement)==null||Q.classList.remove("ag-cell-focus")},c=()=>{var $,W,Q;(W=($=s.params)==null?void 0:$.api)==null||W.stopEditing(),l();const k=`scene-name-${s.id}`,x=document.getElementById(k);(Q=x==null?void 0:x.__sceneNameEditor)==null||Q.startEdit()},{apiServices:u}=Zn(!0,s),d=q(()=>{var k;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:(k=s.data)==null?void 0:k.permissions}}),h=k=>{var $,W,Q,ae,ee,X;let x=(W=($=s.params)==null?void 0:$.api)==null?void 0:W.getRowNode(String(s.id));if(x){const N={...x.data,isDeleted:k==="deleted",isArchived:k==="archived"?!0:x.data.isArchived,isLocked:k==="locked"?!0:x.data.isLocked,disabled:!1};k=="deleted"&&(N.isLocked=!1,N.disabled=!0),k=="unarchived"&&(N.isArchived=!1),(ae=(Q=s.params)==null?void 0:Q.api)==null||ae.redrawRows({rowNodes:[x]}),x.setData(N),(X=(ee=s.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[x]})}},f=mf(),{openSceneHub:p}=f,g=()=>{vt(()=>{var $,W,Q,ae,ee,X;const k=((W=($=s.params)==null?void 0:$.node)==null?void 0:W.rowIndex)||0,x=((ae=(Q=s.params)==null?void 0:Q.column)==null?void 0:ae.getColId())||"";(X=(ee=s.params)==null?void 0:ee.api)==null||X.setFocusedCell(k,x)})};q(()=>{var x,$;const k=($=(x=s.params)==null?void 0:x.api)==null?void 0:$.getRowNode(String(s.id));return k==null?void 0:k.data});const{options:v}=yZ(d,h,c,p,g),w=n,S=()=>{var k,x,$,W,Q,ae;console.trace("Focusing current cell for row:",s.id),(ae=(k=s.params)==null?void 0:k.api)==null||ae.setFocusedCell((($=(x=s.params)==null?void 0:x.node)==null?void 0:$.rowIndex)||0,((Q=(W=s.params)==null?void 0:W.column)==null?void 0:Q.getColId())||"")},b=q(()=>{var k;return(k=s.params)==null?void 0:k.api}),C=(k,x)=>{var $,W,Q,ae,ee,X,N,z;if(w("actionExecuted",k),k.id=="copy-link"){(ee=b.value)==null||ee.startEditingCell({rowIndex:(W=($=s.params)==null?void 0:$.node)==null?void 0:W.rowIndex,colKey:(ae=(Q=s.params)==null?void 0:Q.column)==null?void 0:ae.getColId()});return}else{if(k.id!=="copy-link"&&((X=b.value)==null||X.stopEditing()),k.id==="rename")(N=b.value)==null||N.stopEditing(),(z=b.value)==null||z.clearFocusedCell(),l();else if(k.id==="copy-link"){const ne=document.getElementById(x);setTimeout(()=>{var pe,ve,we;(we=(ve=(pe=ne==null?void 0:ne.__vueParentComponent)==null?void 0:pe.exposed)==null?void 0:ve.focus)==null||we.call(ve)},300)}else if(["delete-rendition","delete-thumbnail"].includes(k.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var ne,pe;(pe=(ne=s.params)==null?void 0:ne.api)==null||pe.clearFocusedCell()},300)}},_=()=>{var k,x;(x=(k=s.params)==null?void 0:k.api)==null||x.stopEditing()},E=k=>{var x,$,W,Q;return k==="archive"?!(($=(x=s.params)==null?void 0:x.data)!=null&&$.isArchived):k==="unarchive"?(Q=(W=s.params)==null?void 0:W.data)==null?void 0:Q.isArchived:!0},I=q(()=>v.value.map(k=>({...k,options:k.options.filter(x=>!x.hide&&E(x.id))})).filter(k=>k.options.length>0)),T=V({}),P=V(null),M=q(()=>{var x,$;if(s.focusableIndex)return s.focusableIndex;const k=($=(x=s.params)==null?void 0:x.api)==null?void 0:$.getRowNode(String(s.id));return`${((k==null?void 0:k.rowIndex)??0)+10}`}),D=(k,x)=>`${M.value}.${k*10+x}`,F=(k,x)=>{if(x&&"focus"in x){T.value[k]=x;return}delete T.value[k]},O=k=>{k.preventDefault(),k.stopPropagation(),k.stopImmediatePropagation()};return Qt(()=>{var k;(k=P.value)==null||k.focus()}),t({focus(){var $;const k=`${M.value}.0`,x=T.value[k];x&&x.focus?x.focus():($=P.value)==null||$.focus()}}),(k,x)=>Ke((K(),ie("div",{onKeydown:O,class:te([k.$style["more-option-section"],{[k.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:P,tabindex:"0",role:"menu"},[(K(!0),ie(It,null,Fn(I.value,($,W)=>(K(),ie("div",{key:$.id,style:cn({"--g-number":Math.min($.options.length,4),"--g-size":$.type==="column"?"36px":"auto"}),class:te([k.$style["option-block"],k.$style[$.type]])},[(K(!0),ie(It,null,Fn($.options,(Q,ae)=>(K(),ie("div",{key:Q.id,class:te(k.$style["option-item"])},[ue(fee,{layer:s.layer,"scene-id":String(s.id),option:Q,type:$.type,onActionExecuted:ee=>C(ee,`more-action-${ee.id}-${s.id}`),focusableIndex:D(W,ae),ref_for:!0,ref:ee=>F(D(W,ae),ee),onHandleHide:_,id:`more-action-${Q.id}-${s.id}`,label:Q.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[H(o),M.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"}}]]),hee={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},fee=Ct(st({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=ko,s=Yt,r=e,i=V(!1),a=V(!1),l=(T,P)=>{if(!P){p();return}const M=P.target;M.closest(".tippy-content")||M.closest(".tippy-box")||M.closest("[data-tippy-root]")||M.closest(".option-item")||p()},c=V(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=yo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async T=>{var P,M;if(!a.value){a.value=!0;try{await((M=(P=r.option).action)==null?void 0:M.call(P,T)),g("actionExecuted",r.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,i.value=!1}}},w=async T=>{var P,M;if(T.preventDefault(),T.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((M=(P=r.option).action)==null?void 0:M.call(P,T)),g("actionExecuted",r.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},S=T=>{g("actionExecuted",T),p()},b=T=>{T.key==="Escape"&&p()},C=T=>({row:"small",column:"medium",block:"small"})[T]||"medium",_=T=>{const P=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...P],column:["menu-item",...P],block:["secondary",...P]}[T]||[]},E=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{vt(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{w(new MouseEvent("click"))}});const I=T=>{var P;T.stopPropagation(),T.preventDefault(),i.value=!1,(P=u.value)==null||P.focus()};return(T,P)=>{var M;return Ke((K(),ie("div",{ref_key:"wrapperRef",ref:c,class:te(T.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:kt(w,["stop","prevent"])},[Ke((K(),Ue(at,{ref_key:"triggerRef",ref:u,class:te(T.$style["option-item"]),disabled:e.option.disabled||a.value,actived:H(f)||i.value,size:C(e.type),variant:_(e.type),onClick:kt(w,["stop","prevent"]),onKeydown:b,onEscape:E,label:e.option.label},{prefix:he(()=>[e.option.icon?(K(),ie("div",hee,[ue(lt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Xe("",!0)]),suffix:he(()=>[e.option.subMenu?(K(),Ue(lt,{key:0,src:"Play",source:"remote"})):Xe("",!0),e.option.isDanger&&i.value?(K(),ie("div",{key:1,class:te(T.$style["confirm-action"])},[Ke((K(),Ue(at,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:I},{default:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[H(o),`${r.focusableIndex}.0`],[H(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((K(),Ue(at,{variant:["danger","primary","icon"],size:"small",onClick:kt(v,["stop","prevent"]),onEscape:P[0]||(P[0]=D=>i.value=!1)},{default:he(()=>[ue(lt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${r.focusableIndex}.1`],[H(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[H(o),r.focusableIndex]]),e.option.subMenu?(K(),ie("div",{key:0,ref_key:"popupRef",ref:d,class:te(T.$style["submenu-container"])},[ue(OO,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((M=e.option)==null?void 0:M.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Xe("",!0)],2)),[[H(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),MO=(e,t)=>{const n=V(Number(e.value.value)),o=q(()=>e.value.metricConfig),s=q(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),r=17,i=q(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:s,metricConfig:o,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},pee=["aria-label"],NO=Ct(st({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=Ts,o=Yt,s=e,r=ig(!1),i=V(null),a=V(null),{isEditing:l}=$u(s),c=q(()=>{var x,$;return{value:s.value,metricConfig:(($=(x=s.params)==null?void 0:x.colDef)==null?void 0:$.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=MO(c,r),f=q(()=>{var $,W;let x=!1;if(["number","formula"].includes(d.value.metric_type.code)){const Q=Number(s.value),ae=Number(($=d.value)==null?void 0:$.format_value);Number.isFinite(ae)&&ae>=0&&(x=(((W=Q.toString().split(".")[1])==null?void 0:W.length)||0)>ae)}return x}),p=q(()=>{var x;return!!((x=d.value)!=null&&x.morpheme_value)||u.value.isEmpty||f.value}),g=q(()=>{var W,Q,ae;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const x=P.value,$=(W=d.value)==null?void 0:W.morpheme_type;return $==="prefix"?`${((Q=d.value)==null?void 0:Q.morpheme_value)||""} ${x}`.trim():$==="suffix"?`${x} ${((ae=d.value)==null?void 0:ae.morpheme_value)||""}`.trim():x}),v=q(()=>{const{format_type:x,format_value:$}=d.value;if(x==="dropdown"&&typeof $=="string"&&$.startsWith("["))try{return JSON.parse($)}catch{return[]}return[]}),w=q(()=>({disabled:s.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!T.value,readOnly:s.readOnly||T.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=Co(w),C=(x,$,W="en-US")=>new Intl.NumberFormat(W,{minimumFractionDigits:$,maximumFractionDigits:$}).format(x),_=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const x=s.value,{format_type:$,format_value:W,mapping:Q}=d.value;if(Q&&typeof Q=="object"&&!Array.isArray(Q)){const ae=Q[`!${x}`];if(ae)return ae}if($==="dropdown"){const ae=v.value.find(ee=>String(ee.name)===String(x));if(ae)return ae.name}if(typeof x=="string"){const ae=Number(x);return Number.isNaN(ae)?x:x.replace(/[.-]/g,"").length>16?E(x,W):E(ae,W)}return typeof x=="number"?E(x,W):String(x)}),E=(x,$)=>{const W=Number.parseInt(String($)||"2",10),Q=Number.isFinite(W)&&W>=0?W:2;try{if(typeof x=="string"){const ae=x.split("."),ee=ae[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=ae[1]?ae[1].substring(0,Q).padEnd(Q,"0"):"0".repeat(Q);return Q>0?`${ee}.${X}`:ee}return C(x,Q)}catch(ae){return console.error("Error formatting metric value:",ae,{num:x,decimals:Q}),String(x)}},I=(x,$)=>{const W=Number.parseInt(String($)||"2",10),Q=Number.isFinite(W)&&W>=0?W:2;try{if(typeof x=="string"){const ae=x.split("."),ee=ae[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),X=ae[1]?ae[1].length:0,N=Math.max(Q,X),z=ae[1]?ae[1].padEnd(N,"0"):"0".repeat(N);return N>0?`${ee}.${z}`:ee}return new Intl.NumberFormat("en-US",{minimumFractionDigits:Q,maximumFractionDigits:20}).format(x)}catch(ae){return console.error("Error formatting exact metric value:",ae,{num:x,decimals:Q}),String(x)}},T=q(()=>{var x;return((x=d.value)==null?void 0:x.metric_type.code)==="formula"}),P=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const x=s.value,{format_type:$,format_value:W,mapping:Q}=d.value;if(Q&&typeof Q=="object"&&!Array.isArray(Q)){const ae=Q[`!${x}`];if(ae)return ae}if($==="dropdown"){const ae=v.value.find(ee=>String(ee.name)===String(x));if(ae)return ae.name}if(typeof x=="string"){const ae=Number(x);return Number.isNaN(ae)?x:x.replace(/[.-]/g,"").length>16?I(x,W):I(ae,W)}return typeof x=="number"?I(x,W):String(x)}),{tooltip:M}=fP(""),D=async x=>{x.stopPropagation(),x.preventDefault(),x.stopImmediatePropagation();try{await navigator.clipboard.writeText(P.value),M.value="Copied",setTimeout(()=>{M.value="Copy"},3e3)}catch($){console.error("Failed to copy text:",$),M.value="Copy failed",setTimeout(()=>{M.value="Copy"},3e3)}};tt(()=>s.value,(x,$)=>{const W=Number(x);Number.isFinite(W)&&W!==h.value?h.value=W:x==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const O=()=>{r.value=!0},k=()=>{r.value=!1};return(x,$)=>Ke((K(),Ue(_o,Wt(H(S),{onMouseenter:O,style:{"--icon-size":"24px"},onMouseleave:k,ref_key:"wrapperRef",ref:a,actived:H(l),bordered:!0}),{suffix:he(()=>[s.disabled?Xe("",!0):(K(),ie("div",{key:0,class:te([x.$style.suffix,"wrapper-suffix"])},[r.value&&!H(u).isEmpty&&!H(u).isError?Ke((K(),Ue(at,{key:0,variant:["icon","secondary"],size:24,onClick:kt(D,["prevent","stop"])},{default:he(()=>[ue(lt,{src:"Copy",source:"remote",size:12})]),_:1})),[[H(o),{content:H(M),hideOnClick:!1,contentClass:"extra-padding"}]]):Xe("",!0)],2))]),default:he(()=>[me("div",{class:te(x.$style["metric-wrapper"]),"aria-label":H(d).format_value||void 0},[me("div",{class:te([x.$style["metric-content"],s.disabled?x.$style.disabled:""])},[!H(u).isError&&H(u).isEmpty?(K(),ie(It,{key:0},[H(u).pendingCalculation?Ke((K(),ie("span",{key:0,class:te(x.$style["metric-empty"])},[...$[0]||($[0]=[Qe(" - ",-1)])],2)),[[H(o),"Can’t calculate yet. Complete required fields."]]):H(u).isEmpty?(K(),ie("span",{key:1,class:te(x.$style["metric-empty"])}," - ",2)):Xe("",!0)],64)):Xe("",!0),H(u).isError?Ke((K(),ie("div",{key:1,class:te(x.$style["metric-error"])},[...$[1]||($[1]=[Qe(" Error ",-1)])],2)),[[H(o),"Something went wrong. Review formula, inputs and retry."]]):Xe("",!0),!H(u).isEmpty&&!H(u).isError?Ke((K(),ie("span",{key:2,class:te([x.$style["metric-value"],H(b)?x.$style.hovered:"",{[x.$style.disabled]:s.disabled}])},[Qe(ht(_.value),1)],2)),[[H(o),{content:g.value,bypassOverflowCheck:p.value}]]):Xe("",!0)],2)],10,pee)]),_:1},16,["actived"])),[[H(n),{isLoading:H(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_lu0ag_1","metric-content":"_metric-content_lu0ag_5",disabled:"_disabled_lu0ag_15","metric-value":"_metric-value_lu0ag_19",hovered:"_hovered_lu0ag_19","metric-error":"_metric-error_lu0ag_23","with-morpheme":"_with-morpheme_lu0ag_38","with-formula-icon":"_with-formula-icon_lu0ag_41","metric-value--number":"_metric-value--number_lu0ag_47","metric-value--currency":"_metric-value--currency_lu0ag_47","metric-value--percentage":"_metric-value--percentage_lu0ag_47","metric-morpheme":"_metric-morpheme_lu0ag_51","metric-empty":"_metric-empty_lu0ag_64","metric-icon":"_metric-icon_lu0ag_71"}}]]),gee={key:0,style:{color:"#6b6b6b"}},mee=Ct(st({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue","open"],setup(e,{expose:t,emit:n}){const o=Yt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},r={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},a={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},l=e,c={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=q(()=>{var k,x;if(l.headerType)return l.headerType;if(((x=(k=l.params)==null?void 0:k.column)==null?void 0:x.getColId()).includes("metric"))return"default";const O=l.headerType??l.params.column.getColId();return c[O]||"default"}),d=V(),h=()=>{var O,k,x;const F=(k=(O=l.params)==null?void 0:O.column)==null?void 0:k.getColDef();if((x=F.colId)!=null&&x.includes("metric")){if(F.context.is_primary==1)return"primary";if(F.context.is_point_metric==1)return"secondary"}};mh(()=>{d.value=h()}),Qt(()=>{d.value=h()});const f=q(()=>{var F,O;return((O=(F=l.params)==null?void 0:F.column.getColDef().context)==null?void 0:O.morpheme_value)||void 0}),p=q(()=>{var F;return(F=l.params)==null?void 0:F.displayName}),g=q(()=>{let F=[];switch(u.value){case"dateRange":F=Object.values(s).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break;case"date":F=Object.values(r).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break;case"number":F=Object.values(i).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break;default:F=Object.values(a).map(O=>({...O,selected:w.value===O.value,type:"text",hover:T.value===O.value}));break}return w.value!=="none"&&F.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),F}),v=q(()=>String(w.value).endsWith("asc")?"SortUp":String(w.value).endsWith("desc")?"SortDown":"Sort"),w=V(l.modelValue??"none"),S=F=>{if(D.value){D.value=!1;return}E("update:modelValue",F),E("sort-changed",F)},b=F=>{w.value=F},C=xr(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let F;w.value==="none"?F="asc":w.value==="asc"?F="desc":F="none",w.value=F}else{const F=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],k=(F.indexOf(w.value)+1)%F.length;w.value=F[k]}},li),_=q(()=>{if(w.value==="none")return"No sorting applied";const F=g.value.find(O=>O.value===w.value);return(F==null?void 0:F.label)||""}),E=n,I=q(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(w.value!=="none")return"var(--primary-color-hover)"});tt(()=>l.modelValue,F=>{F!=w.value&&(w.value=F)}),tt(w,F=>{F!==l.modelValue&&S(F)});const T=V(w.value);tt(()=>w.value,F=>{T.value=F});const P=F=>{var $,W;if(l.readOnly||l.disabled)return;let O=0;F.key==="ArrowDown"?O=1:F.key==="ArrowUp"&&(O=-1);const k=g.value.findIndex(Q=>Q.value===T.value),x=g.value.length;if(F.key==="Enter"||F.key===" ")F.preventDefault(),w.value=T.value,($=M.value)==null||$.hide();else if(O!==0){F.preventDefault();let Q=(k+O+x)%x;T.value=g.value[Q].value}else F.key==="Escape"&&((W=M.value)==null||W.hide())},M=V(null);Qt(()=>{var F,O;(O=(F=M.value)==null?void 0:F.$el)==null||O.addEventListener("keydown",P)}),Ol(()=>{var F,O;(O=(F=M.value)==null?void 0:F.$el)==null||O.removeEventListener("keydown",P)});const D=V(!1);return t({setDefaultSort:F=>{w.value=F?F.direction:"none",D.value=!0},clear:()=>{w.value="none"}}),(F,O)=>(K(),Ue(jS,{ref_key:"dropdownRef",ref:M,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:O[0]||(O[0]=k=>F.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:H(C),onSelect:O[1]||(O[1]=k=>b(k))},{prefix:he(()=>[ue(at,{variant:["text"],onClick:H(C),size:"small"},{default:he(()=>[Ke((K(),ie("b",null,[Qe(ht(p.value),1)])),[[H(o),{content:p.value}]]),f.value?(K(),ie("small",gee," ("+ht(f.value)+") ",1)):Xe("",!0),d.value=="primary"?Ke((K(),ie("div",{key:1,class:te(F.$style["icon-metric"])},[ue(lt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[H(o),"Woohoo metric"]]):Xe("",!0),d.value=="secondary"?Ke((K(),ie("div",{key:2,class:te(F.$style["icon-metric"])},[ue(lt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[H(o),"Point Metric"]]):Xe("",!0)]),_:1},8,["onClick"])]),iconDropdown:he(()=>[Ke(ue(lt,{src:v.value,source:"remote",color:I.value},null,8,["src","color"]),[[H(o),_.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),vee=["disabled","readonly","checked","indeterminate"],LO=Ct(st({__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=Yt,o=ko,s=e,r=t,i=q(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=q(()=>s.allowIndeterminate?[Ft.UNCHECK,Ft.INDETERMINATE,Ft.CHECKED]:[Ft.UNCHECK,Ft.CHECKED]),l=q(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case Ft.UNCHECK:return s.tooltipText.unchecked;case Ft.INDETERMINATE:return s.tooltipText.indeterminate;case Ft.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=V(typeof s.modelValue=="boolean"?s.modelValue?Ft.CHECKED:Ft.UNCHECK:s.modelValue),d=q(()=>({checked:u.value===Ft.CHECKED,indeterminate:u.value===Ft.INDETERMINATE,none:u.value===Ft.UNCHECK})),h=q(()=>s.disabled||s.readOnly);return tt(()=>u.value,f=>{r("update:modelValue",f===Ft.CHECKED)}),(f,p)=>Ke((K(),ie("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:te([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:cn({"--input-size":i.value})},null,46,vee)),[[H(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[H(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),yee=Ct(st({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=Yt,o=uv(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=ns(o),a=V(new Set);tt(i,C=>{s(C)},{immediate:!0});const l=q(()=>i.value!==Ft.UNCHECK),c=q(()=>({checked:i.value===Ft.CHECKED,indeterminate:i.value===Ft.INDETERMINATE,UNCHECK:i.value===Ft.UNCHECK})),u=q(()=>({[Ft.UNCHECK]:"Click to select all",[Ft.INDETERMINATE]:"Click to clear selection",[Ft.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=q(()=>{const C=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&C.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),C}),h=C=>({selected:C.getSelectedRows().length,total:r.value.total,loaded:r.value.loaded}),f=({api:C,state:_})=>{if(C)if(_===Ft.UNCHECK)C.deselectAll(),a.value.clear(),i.value=_;else if(_===Ft.CHECKED){const E=new Set;C.forEachNode(I=>{I.isSelected()&&E.add(I.id||"")}),a.value=E,C.forEachNode(I=>I.setSelected(!0)),i.value=_}else C.forEachNode(E=>E.setSelected(!0)),i.value=_},p=()=>{var E;const C=(E=t.params)==null?void 0:E.api;if(!C){console.error("[HeaderCheckbox] There is no API available");return}const _={[Ft.UNCHECK]:Ft.INDETERMINATE,[Ft.INDETERMINATE]:Ft.UNCHECK,[Ft.CHECKED]:Ft.UNCHECK};f({api:C,state:_[i.value]})},g=C=>{var I;const _=(I=t.params)==null?void 0:I.api;if(!_){console.error("no api");return}const E={INDETERMINATE:Ft.INDETERMINATE,GLOBAL:Ft.CHECKED,UNCHECK:Ft.UNCHECK};f({api:_,state:E[C]})},v=xr(C=>{const{selected:_,total:E}=h(C);if(E==0){i.value=Ft.UNCHECK;return}_===E?i.value=Ft.CHECKED:_===0?i.value=Ft.UNCHECK:i.value=Ft.INDETERMINATE},300);let w=[];const S=C=>{v(C)};Qt(()=>{var T;const C=(T=t.params)==null?void 0:T.api;if(!C)return;const _=P=>v(P.api),E=()=>S(C),I=()=>S(C);C.addEventListener("selectionChanged",_),C.addEventListener("rowDataUpdated",E),C.addEventListener("modelUpdated",E),w=[()=>C.removeEventListener("selectionChanged",_),()=>C.removeEventListener("rowDataUpdated",E),()=>C.removeEventListener("modelUpdated",I)]}),qn(()=>{w.forEach(C=>C())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(C,_)=>(K(),Ue(jS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:he(()=>[Ke((K(),Ue(LO,{"tab-index":"8",id:b,disabled:t.disabled,key:H(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:H(i),"onUpdate:modelValue":_[0]||(_[0]=E=>mn(i)?i.value=E:null),onChange:p,"aria-label":H(i)===H(Ft).CHECKED?"All items selected":"Select visible items",class:te(C.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[H(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),VO=Ct(st({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=Ts,n=Yt,o=e,{isEditing:s}=$u(o),r=V(null),i=V(null),a=q(()=>o.value),l=q(()=>a.value===void 0),c=q(()=>{var g,v;return((g=a.value)==null?void 0:g.name)||((v=a.value)==null?void 0:v.label)||"No status"}),u=q(()=>{var g;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:RK((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:d,isHover:h}=Co(u),f=q(()=>{var g;return((g=a.value)==null?void 0:g.color)||"#fff"}),p=q(()=>new Pn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((K(),Ue(H(_o),Wt(H(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!H(s)&&!H(h)||!a.value?"#f3f5f8":void 0}}),{default:he(()=>[l.value?Xe("",!0):(K(),ie("div",{key:0,class:te({[g.$style["status-renderer"]]:!0,[g.$style["has-status"]]:a.value,[g.$style["has-suffix"]]:!!g.$slots.suffix})},[a.value?(K(),ie(It,{key:0},[Ke((K(),ie("div",{class:te(g.$style["status-renderer__status-name"])},[Qe(ht(c.value),1)],2)),[[H(n),{content:c.value,delay:[1e3,0]}]]),Dt(g.$slots,"suffix")],64)):(K(),ie(It,{key:1},[me("div",{class:te(g.$style["status-renderer__color-code"])},null,2),v[0]||(v[0]=me("span",{style:{color:"#a6a6a6"}},"No status",-1)),Dt(g.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[H(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_k5c36_1","has-status":"_has-status_k5c36_9","has-suffix":"_has-suffix_k5c36_12","status-renderer__color-code":"_status-renderer__color-code_k5c36_22","status-renderer__status-name":"_status-renderer__status-name_k5c36_33"}}]]),KS=Ct(st({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},minWidth:{default:"300px"},popupIndex:{default:109},showCloseBtn:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,s=q(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=W7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),c=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};Qt(()=>{document.addEventListener("keydown",c)}),qn(()=>{document.removeEventListener("keydown",c)}),t({show:i,hide:a,isVisible:l});const u=n;return tt(()=>l.value,d=>{u(d?"shown":"hidden")}),(d,h)=>{const f=eu("tooltip");return K(),ie("div",{ref_key:"popupRef",ref:r,class:te(d.$style.popupContainer)},[me("div",{class:te(d.$style.popupWrapper)},[me("div",{class:te(d.$style.header)},[Dt(d.$slots,"header",{},()=>[me("span",{class:te(d.$style["header-title"])},ht(e.popupName),3)]),o.showCloseBtn?Ke((K(),Ue(at,{key:0,variant:["icon","text"],onClick:H(a),"aria-label":"Close popup",size:"small"},{default:he(()=>[ue(lt,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Xe("",!0)],2),me("div",{class:te(d.$style.body)},[Dt(d.$slots,"default")],2),d.$slots.footer?(K(),ie("div",{key:0,class:te(d.$style.footer)},[Dt(d.$slots,"footer")],2)):Xe("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1986t_1",popupWrapper:"_popupWrapper_1986t_9",popupFadeIn:"_popupFadeIn_1986t_1",header:"_header_1986t_24","header-title":"_header-title_1986t_34",body:"_body_1986t_43",footer:"_footer_1986t_48"}}]]),wee={...{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 Cee extends Error{}class Xa extends Cee{constructor(){super("Zone is an abstract class")}}class BO{get type(){throw new Xa}get name(){throw new Xa}get ianaName(){return this.name}get isUniversal(){throw new Xa}offsetName(t,n){throw new Xa}formatOffset(t,n){throw new Xa}offset(t){throw new Xa}equals(t){throw new Xa}get isValid(){throw new Xa}}const qS=new Map;function bee(e){let t=qS.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"}),qS.set(e,t)),t}const See={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Eee(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function _ee(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=See[r];r==="era"?o[a]=i:hv(a)||(o[a]=parseInt(i,10))}return o}const YS=new Map;class dv extends BO{static create(t){let n=YS.get(t);return n===void 0&&YS.set(t,n=new dv(t)),n}static resetCache(){YS.clear(),qS.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=dv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Tee(t,n,o,this.name)}formatOffset(t,n){return pv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=bee(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?_ee(o,n):Eee(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=Dee({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let ZS=null;class Xu extends BO{static get utcInstance(){return ZS===null&&(ZS=new Xu(0)),ZS}static instance(t){return t===0?Xu.utcInstance:new Xu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Xu(HO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${pv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${pv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return pv(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 hv(e){return typeof e>"u"}function fv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function $O(e){if(!(hv(e)||e===null||e===""))return parseInt(e,10)}function Ree(e){if(!(hv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Dee(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 Tee(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function HO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function pv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${fv(n,2)}:${fv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${fv(n,2)}${fv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const GO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ju(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function Qu(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function UO(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=$O(t[n+s]);return[o,null,n+s]}}const WO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Iee=`(?:${WO.source}?(?:\\[(${GO.source})\\])?)?`,zO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jO=RegExp(`${zO.source}${Iee}`),XS=RegExp(`(?:[Tt]${jO.source})?`),xee=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Fee=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Pee=/(\d{4})-?(\d{3})/,kee=UO("weekYear","weekNumber","weekDay"),Aee=UO("year","ordinal"),Oee=/(\d{4})-(\d\d)-(\d\d)/,KO=RegExp(`${zO.source} ?(?:${WO.source}|(${GO.source}))?`),Mee=RegExp(`(?: ${KO.source})?`);function ed(e,t,n){const o=e[t];return hv(o)?n:$O(o)}function Nee(e,t){return[{year:ed(e,t),month:ed(e,t+1,1),day:ed(e,t+2,1)},null,t+3]}function td(e,t){return[{hours:ed(e,t,0),minutes:ed(e,t+1,0),seconds:ed(e,t+2,0),milliseconds:Ree(e[t+3])},null,t+4]}function xf(e,t){const n=!e[t]&&!e[t+1],o=HO(e[t+1],e[t+2]),s=n?null:Xu.instance(o);return[{},s,t+3]}function Ff(e,t){const n=e[t]?dv.create(e[t]):null;return[{},n,t+1]}Ju(xee,XS),Ju(Fee,XS),Ju(Pee,XS),Ju(jO),Qu(Nee,td,xf,Ff),Qu(kee,td,xf,Ff),Qu(Aee,td,xf,Ff),Qu(td,xf,Ff),Qu(td),Ju(Oee,Mee),Ju(KO),Qu(td,xf,Ff);function nd(e){"@babel/helpers - typeof";return nd=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},nd(e)}var Do=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Do||{});Do.review,Do.review_take,Do.review_scene,Do.review_rendition,Do.review_frame,Do.review_rendition_comment,Do.review_comment,Do.scene_hub,Do.hub_rendition,Do.hub_comment,Do.people_insight,Do.people_detail,Do.project,Do.woohoo,Do.update,Do.core,Do.project_focusMode;var JS=null;function Lee(e){JS=e}function gv(){if(!JS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return JS}function qO(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=gv();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function Vee(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&nd(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function Bee(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function YO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function ZO(e,t){if(!e||nd(e)!=="object")return null;try{var n=gv();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var w,S=t.toUpperCase();v=(w=p[g])===null||w===void 0||(w=w.errorMessages)===null||w===void 0||(w=w[S])===null||w===void 0||(w=w.validation_rules)===null||w===void 0?void 0:w[c]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[c]}if(v&&typeof v=="string")return Vee(v,a,u,d)}catch(C){console.error("Error in validation rules",C)}}}}catch(C){return console.error("Error in getValidationErrorMessage:",C),null}return null}function $ee(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return qO();var n=e.code,o=e.error,s=e.details,r=e.message;if(YO(s)&&s){var i=ZO(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=gv();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(o&&nd(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(o.key),f=gv(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var w=v;return s!=null&&s.context&&(w=Bee(w,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",w)),n!==""?"[".concat(n,"] ").concat(w," ").concat(t):"".concat(w," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&nd(o)!=="object"&&YO(s)){var S=ZO(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):qO()}const oa=rc("toast",()=>{const e=l=>{var c;if((l==null?void 0:l.apiCode)==="offline")s({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const u=$ee((c=l==null?void 0:l.res)==null?void 0:c.data);s({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=V([]),n=(l,c)=>{const u=wee[l];if(u){const d=u[c];if(d){s({id:l,type:c,message:d});return}}else s({id:l,type:c,message:l})},o=new Map,s=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{r(u.id),o.delete(u.id)},c);o.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function r(l){t.value=t.value.filter(u=>u.id!==l);const c=o.get(l);c&&(clearTimeout(c.timeoutId),o.delete(l))}function i(l){const c=o.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=o.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{r(l),o.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:s,removeNotification:r,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:i,resumeAutoDismiss:a}}),Hee=["onMouseenter","onMouseleave"],Gee=["innerHTML"],Uee=["innerHTML"],Wee=["data-tooltip"],zee={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},jee=Ct(st({__name:"Snackbar",setup(e){const t=Yt,n=IW,o=oa(),{removeNotification:s}=o,{notifications:r}=ns(o),i=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=V(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(K(),Ue(dW,{name:"list",tag:"div",class:te(["notification-center",f.$style["notification-wrapper"]])},{default:he(()=>[(K(!0),ie(It,null,Fn(H(r),g=>{var v;return Ke((K(),ie("div",{key:g.id,class:te([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:w=>d(g.id),onMouseleave:w=>h(g.id)},[me("p",{class:te(f.$style.snackbar__message)},[me("span",{class:te(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(K(),Ue(lt,{key:0,src:"CircleCheck",source:"remote"})):Xe("",!0),!g.icon&&g.type=="interactive"?(K(),Ue(lt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(K(),Ue(lt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(K(),ie("i",{key:3,class:te(f.$style["icon-draw"]),innerHTML:g.icon},null,10,Gee)):g.icon&&!i(g.icon)?(K(),Ue(lt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)],2),me("span",{class:te(f.$style["error-message"])},[me("span",{class:te(f.$style.message),innerHTML:g.message},null,10,Uee)],2)],2),g.actions?(K(),ie("div",{key:0,class:te(f.$style["actions-notification"]),"data-notification":"true"},[(K(!0),ie(It,null,Fn(g.actions,w=>(K(),Ue(at,Wt({key:w.label},{ref_for:!0},w,{onClick:kt(w.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:he(()=>[w.btnIcon?(K(),Ue(lt,{key:0,src:w.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)]),_:2},1040,["onClick"]))),128))],2)):Xe("",!0),g.type!=="interactive"?Ke((K(),ie("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ue(at,{variant:"secondary",onClick:w=>c(g.message),class:te(f.$style["copy-btn"])},{prefix:he(()=>[ue(lt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Wee)),[[H(t),a.value]]):Xe("",!0),g.type=="interactive"?Ke((K(),ie("div",zee,[ue(at,{variant:"tertiary",onClick:w=>H(s)(g.id),class:te(f.$style["close-btn"]),size:18},{default:he(()=>[ue(lt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[H(t),"Close"]]):Xe("",!0)],42,Hee)),[[H(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_jf7je_1","notification-item":"_notification-item_jf7je_15","notification--success":"_notification--success_jf7je_30","notification--error":"_notification--error_jf7je_36","close-btn":"_close-btn_jf7je_42","notification--info":"_notification--info_jf7je_45","notification--warning":"_notification--warning_jf7je_52","notification--interactive":"_notification--interactive_jf7je_59","snackbar-type":"_snackbar-type_jf7je_67",snackbar__message:"_snackbar__message_jf7je_76",message:"_message_jf7je_89","error-message":"_error-message_jf7je_97",snackbar__icon:"_snackbar__icon_jf7je_103","actions-notification":"_actions-notification_jf7je_112","icon-draw":"_icon-draw_jf7je_120","copy-btn":"_copy-btn_jf7je_128"}}]]);/*!
|
|
153
153
|
* vue-draggable-next v2.3.0
|
|
154
154
|
* (c) 2025 Anish George
|
|
155
155
|
* @license MIT
|
|
@@ -257,7 +257,7 @@ See ${KL(e,t)}`;return Array.isArray(o)?o.concat(r):[o,r]}var Ive={1:"Charting A
|
|
|
257
257
|
`)}checkProperties(e,t,n,o,s){const r=["__ob__","__v_skip","__metadata__"],i=Yve(Object.getOwnPropertyNames(e),[...r,...t,...n],n),a=Object.keys(i);for(const l of a){const c=i[l];let u=`invalid ${o} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;n.includes("context")&&(u+=`
|
|
258
258
|
If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),ip(u)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);ip(`to see all the valid ${o} properties please check: ${l}`)}}};function Yve(e,t,n){const o={},s=e.filter(r=>!t.some(i=>i===r));if(s.length>0)for(const r of s)o[r]=M0({inputValue:r,allSuggestions:n}).values;return o}var Zve=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Xve={moduleName:"Validation",version:ut,beans:[qve]};function jB(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Jve=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=(o,s)=>{o.hasChildren()&&e&&!s?o.childrenAfterFilter=o.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):o.childrenAfterFilter=o.childrenAfterGroup,jB(o)};if(this.doingTreeDataFiltering()){const o=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],c=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(r.childrenAfterGroup[a],c):n(l,c)}n(r,i)},s=r=>o(r,!1);t.executeFromRootNode(s)}else{const o=s=>n(s,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},Qve=class extends d_{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,o,s){this.comp=e;const r=fp(this,this.beans.context,s);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=o,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Pt(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=hr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Ad(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();yd(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Wn(t)===this.eGui)return;const s=Fc(t,this.eGui,null,e.shiftKey);if(s){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Ac(e);case Oe.ENTER:t&&xc(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"),o=!!e.relatedTarget&&Sc(e.relatedTarget,"ag-floating-filter");if(n&&o&&e.target===this.eGui){const s=this.lastFocusEvent,r=!!(s&&s.key===Oe.TAB);if(s&&r){const i=s.shiftKey;xc(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new u_(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=!Hs(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:o}=this,s=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(o.get("enableFilterHandlers")){const u=r;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:s}),t!=null&&t.isFilterActive(n)&&s(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,s=this.active?o==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!s?this.updateCompDetails(e,s,n):r.then(i=>{!i||o!=null&&o.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,n):this.updateFloatingFilterParams(s,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var o;if(!e)return;let n=e.params;(o=this.comp.getFloatingFilterComp())==null||o.then(s=>{var r;typeof(s==null?void 0:s.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:xo(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),s.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function eye(e,t){var o;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}(o=e.menuSvc)==null||o.showColumnMenu({column:n,positionBy:"auto"})}function tye(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var nye={moduleName:"SharedMenu",version:ut,beans:[fde],apiFunctions:{showColumnMenu:eye,hidePopupMenu:tye}},oye=class extends Oce{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:o}=e,s=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,s.top-r.top,0),c=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${c}px`,i=!0);const d=r.right-r.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return s.right-r.left-2}function p(){return s.left-r.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,n,o,s){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:o,mouseEvent:s})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return wa(e)}},zy={moduleName:"Popup",version:ut,beans:[oye]},sye=".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 rye(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function iye(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function aye(e,t){var o;const n=e.colModel.getColDefCol(t);if(n)return(o=e.colFilter)==null?void 0:o.destroyFilter(n,"api")}function lye(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function cye(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function uye(e,t,n){const{gos:o,colModel:s,colFilter:r}=e;n&&!o.get("enableFilterHandlers")&&(Je(288),n=!1);const i=s.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function dye(e,t,n){var o;return((o=e.filterManager)==null?void 0:o.setColumnFilterModel(t,n))??Promise.resolve()}function hye(e,t){var o;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}(o=e.menuSvc)==null||o.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function fye(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function pye(e,t){var o;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}return(o=e.colFilter)==null?void 0:o.getHandler(n,!0)}function gye(e,t){const{colModel:n,colFilter:o,gos:s}=e;if(!s.get("enableFilterHandlers")){Je(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(o==null||o.updateModel(a,i))}else o==null||o.updateAllModels(i)}var mye={filterHandler:()=>({doesFilterPass:()=>!0})},vye=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={...oV},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,o;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((o=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:o.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:o,dataTypeSvc:s,filterManager:r}=this.beans;if(s!=null&&s.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];i.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=o.getColDefCol(c)||o.getCol(c);if(!u){Je(62,{colId:c});return}if(!u.isFilterAllowed()){Je(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){Je(64,{colId:c});return}i.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});Kn.all(i).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Yf(h,f)||c.push(u.column)}),c.length>0?r==null||r.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:o,beans:{colModel:s}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);ft(l)&&(t[a]=l)}),!e)for(const i of Object.keys(o)){const a=o[i];ft(a)&&!n.has(i)&&((r=s.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const s=t[o];this.state.set(o,{model:xo(this.model,o),state:s})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((o,s)=>{const r=o.state;r!=null&&(n=!0,t[s]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return xo(this.model,n);const o=e.filter;return o?typeof o.getModel!="function"?(Je(66),null):o.getModel():xo(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(Je(67),!1):!1,{colModel:t,gos:n}=this.beans,o=!!g0(n),s=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:o},r=[],i=[],a=(c,u,d)=>{u&&(s(c)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(Kn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=gl(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),Kn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var o;const n=[];return this.allColumnFilters.forEach(s=>{const r=s.column;if(s.isHandler)n.push(Kn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=gl(s);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(o=this.beans.groupFilter)==null||o.updateFilterFlags(e,t),Kn.all(n)}doFiltersPass(e,t,n){const{data:o,aggData:s}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?s:o,a=this.model;for(let l=0;l<r.length;l++){const c=r[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:i,model:xo(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){_n(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,o=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,o=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(s=>{var a,l,c;const{column:r,isHandler:i}=s;o!==r.getColId()&&(i&&((l=(a=s.handler).onAnyFilterChanged)==null||l.call(a)),(c=gl(s,i))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const o=n.isHandler;o&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const s=gl(n,o);s&&t.push(s.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),Kn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:o}=this.beans;return(s,r)=>{const i=r?o.getCol(r):e;return i?n.getValue(i,s,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():xo(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ft(xo(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?gl(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=gl(t);return n?n.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return mae(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":sue(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,o,s,r){const i=()=>{const c=this.createFilterCompParams(e,s,r),u=o(c,s);return wle(this.beans.userCompFactory,t,u,n)},a=i();return a?{compDetails:a,createFilterUi:c=>(c?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,o){var d,h;const s=this.beans.selectableFilter;s!=null&&s.isSelectable(t)&&(t=s.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,o,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||Je(281,{colId:e.getColId()})),{compDetails:c,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:o}=this.beans;return Pt(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:s=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),s))??!0,rowModel:o})}createFilterCompParams(e,t,n,o){const s=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,o);if(r.filterChangedCallback=s,r.filterModifiedCallback=o?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=xo(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{s({...u,source:"columnFilter"})})},i.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},i.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=c=>this.filterUiChanged(e,c),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const o=t(),s={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(n),s}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:o,handlerParams:s,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...s,source:"init",model:xo(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:o,handlerParams:s,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:o,frameworkOverrides:s,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(E2(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=o.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:jce.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:w}=I2(s,t);g?p=g:v==null&&w==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(ro(o)&&Je(277,{colId:e.getColId()}),mye):void 0}createHandler(e,t,n){const o=this.createHandlerFunc(e,t,n);if(!o)return;const s=b0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,s);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const o=e.getColDef(),s=t(Pt(this.gos,{column:e,colDef:o})),r=this.createHandlerParams(e,n);return{handler:s,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),o=e.getColId(),s=this.filterChangedCallbackFactory(e);return Pt(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(o,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(o,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{s({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:o}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const s=o&&e.every(r=>o.isGroupFilter(r));e.length>0&&!s&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:o,selectableFilter:s}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(gp(p))})},i=e.getColDef(),a=s!=null&&s.isSelectable(i)?s.getFilterDef(e,i):i,l=cue(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=b0(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Pt(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=xo(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 _le(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,o){const s="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,o);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:s,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:s,column:t})}else this.destroyFilter(t,s)}destroyFilter(e,t="api"){const n=e.getColId(),o=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],o&&this.disposeFilterWrapper(o,t).then(s=>{var r;s&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:o,isHandler:s,filterUi:r}=e,i=o.getColId();s&&(n=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(r){if(r.created)return r.promise.then(l=>(n=s?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return Kn.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,w,S,b,C,_;const n=this.allColumnFilters.get(e);if(!n)return;const o=this.beans,s=n.column,r=s.getColDef(),i=s.isFilterAllowed(),a=this.getDefaultFilter(s),l=o.selectableFilter,c=l!=null&&l.isSelectable(r)?l.getFilterDef(s,r):r,u=i?this.createHandlerFunc(s,c,this.getDefaultFilter(s)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(s,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(s,c,a,E=>E,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??b0(o.userCompFactory,c,this.createFilterCompParams(s,d,"colDef"));if(h){const E=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),I=xo(this.model,e);if(n.handlerGenerator!=E){const T=n.handler,{handler:P,handlerParams:M}=this.createHandlerFromFunc(s,u.filterHandler,g);n.handler=P,n.handlerParams=M,n.handlerGenerator=E,delete this.model[e],(v=P.init)==null||v.call(P,{...M,source:"init",model:null}),this.destroyBean(T),I!=null&&((w=this.beans.filterManager)==null||w.onFilterChanged({columns:[s],source:t}))}else{const T=this.createHandlerParams(s,f==null?void 0:f.params);n.handlerParams=T,(b=(S=n.handler).refresh)==null||b.call(S,{...T,source:"colDef",model:I})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,s,f,p);return}n.filterUi.filterParams=g,(_=gl(n,h))==null||_.then(E=>{(E!=null&&E.refresh?E.refresh(g):!0)===!1?this.destroyFilterUi(n,s,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:s,params:g})})}refreshHandlerAndUi(e,t,n,o,s){const r=this.cachedFilter(e);if(!r)return o&&this.getOrCreateFilterWrapper(e,!0),Kn.resolve();if(!r.isHandler)return Kn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return Kce(()=>{if(i){const{created:c,filterParams:u}=i;if(c)return i.promise.then(d=>d?{filter:d,filterParams:u}:void 0);i.refreshed=!0}return Kn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,s)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:o}=t;return!(n===o||(n==null?void 0:n.render)&&(o==null?void 0:o.render)&&n.render===o.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(o=>{n.then(s=>{o(gp(s))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:s}=this,r=e.getColId(),i=o.get(r);return i?i.model??null:xo(s,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let o=()=>{};const s=new Promise(r=>{o=r});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(s=>o(s))})}getStateForColumn(e){return this.state.get(e)??{model:xo(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),o=n?this.getOrCreateFilterWrapper(n,!0):null;return o?this.setModelOnFilterWrapper(o,t):Kn.resolve()}setColDefPropsForDataType(e,t,n){var u;const o=e.filter,s=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof s!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;s==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:r,filterValueGetter:i}=tue(s,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,o)}setModelOnFilterWrapper(e,t,n){return new Kn(o=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){o();return}this.refreshHandlerAndUi(r,t,"api").then(()=>o());return}const s=gl(e);if(s){s.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Je(65),o();return}(r.setModel(t)||Kn.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){ft(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),o={model:t,state:n==null?void 0:n.state};this.state.set(e,o)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var i;const o=e.getColId(),s=this.cachedFilter(e),r=()=>s==null?void 0:s.filterUi;iV(t,r,()=>xo(this.model,o),()=>this.state.get(o),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=r())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((o,s)=>{var i;const r=this.beans.colModel.getColDefCol(s);r&&iV(e,()=>o.filterUi,()=>xo(this.model,s),()=>this.state.get(s),a=>this.updateState(r,a),a=>{this.updateStoredModel(s,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}),n.length&&Kn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();rV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>xo(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const s of n)if(s.source==="COLUMN_MENU")return!1;let o=!1;for(const s of e.keys()){const r=e.get(s);if(r.valid===!1)return!1;(r.model??null)!==xo(t,s)&&(o=!0)}return o}hasUnappliedModel(e){var o;const{model:t,state:n}=this;return(((o=n.get(e))==null?void 0:o.model)??null)!==xo(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 yye(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function wye(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Cye=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:o})=>this.onAdvFilterEnabledChanged(o),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var o;this.isAdvFilterEnabled()||(o=this.colFilter)==null||o.setState(e,t,n)}setFilterModel(e,t="api",n){var o;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(o=this.colFilter)==null||o.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){g0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Kn.resolve()).then(()=>{var r;const s={source:t,type:"filterChanged",columns:o};n&&is(s,n),this.eventSvc.dispatchEvent(s),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!g0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Je(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},bye=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,o){e&&!e.isColumn||this.showPopup(e,s=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:s})},n,t.target,Hs(this.gos),o)}showMenuAfterButtonClick(e,t,n,o){if(e&&!e.isColumn)return;let s=-1,r="left";const i=Hs(this.gos);!i&&this.gos.get("enableRtl")&&(s=1,r="right");const a=i?void 0:4*s,l=i?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,o)}showPopup(e,t,n,o,s,r){var g;const i=e?this.createBean(new Qce(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){_n(57);return}const a=ao({tag:"div",cls:`ag-menu${s?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const c=()=>i==null?void 0:i.afterGuiDetached(),u=vae(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{FV(e,!1,"contextMenu");const w=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),w&&o&&yi(o)){const S=M2(o);S==null||S.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=s&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),FV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Fc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),xc(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()}},Sye=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const o=e.getColDef(),{selectableFilter:s,valueSvc:r}=this.beans,i=n??(s==null?void 0:s.getFilterValueGetter(e.getColId()))??o.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,o):r.getValue(e,t)}executeFilterValueGetter(e,t,n,o,s){const{expressionSvc:r,valueSvc:i}=this.beans,a=Pt(this.gos,{data:t,node:o,column:n,colDef:s,getValue:i.getValueCallback.bind(i,o)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},Eye={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},_ye=class extends bn{constructor(){super(Eye,[yy]),this.eFloatingFilterText=dt}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,o=n.getHandler();if(o.getModelAsString){const s=o.getModelAsString(n.model);this.eFloatingFilterText.setValue(s)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},G_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],o=s=>s.some(r=>t[r]!=null)?!0:(Je(72,{keys:s}),!1);if(!n.every(o)){this.filterOptions=e.filter(s=>s===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Je(73)}else Je(74)}getCustomOption(e){return this.customFilterOptions[e]}};function Ip(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function jy(e){return e==null||typeof e=="string"&&e.trim().length===0}function Rye(e){return e==="AND"||e==="OR"?e:"AND"}function Dye(e,t,n){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(s=>s==null))return o(t,n)}function Tye(e,t){let n=e.length;return n>t&&(e.splice(t),Je(78),n=t),n}function xp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:s}=n;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var U_=class extends lue{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 G_;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=Rye(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const o=n===0?e:this.optionsFactory.defaultOption;t.setValue(o,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,o=!t.operator;if(!n&&o||n&&!o)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&dl(i.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),Kn.resolve();if(e.operator){const o=e;let s=o.conditions;s==null&&(s=[],Je(77));const r=Tye(s,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=o.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),s.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const o=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(o.type,!0),this.setConditionIntoUi(o,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),Kn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Je(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Je(80),n=1),n>t&&(Je(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new $0);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,s=>this.resetInput(s)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=ao({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,s),this.resetJoinOperatorOr(n,o,s),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const o=this.createManagedBean(new Ble);e.push(o);const s="ag-filter-condition-operator";return o.addCss(s),o.addCss(`${s}-${n}`),t.appendChild(o.getGui()),o}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const o=e+1,s=n-o;s>0&&this.removeConditionsAndOperators(o,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,s)=>{const r=this.isConditionDisabled(s,e);o.setDisabled(r||this.filterListOptions.length<=1),s===1&&(Qf(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((o,s)=>{$n(o,this.isConditionBodyVisible(s))});const n=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!n,!0);for(const o of this.eJoinOrs)o.setValue(n,!0);this.forEachInput((o,s,r,i)=>{this.setElementDisplayed(o,s<i),this.setElementDisabled(o,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:o,eJoinPanels:s,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(s,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const o=Ip(e,t,n);for(const s of o)Hr(s)}removeComponents(e,t,n){const o=Ip(e,t,n);for(const s of o)Hr(s.getGui()),this.destroyBean(s)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const o=this.getInputs(0)[0];o instanceof Pc&&this.isConditionBodyVisible(0)?n=o.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,o=!1;const s=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),o=!0,c&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,s),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),s=this.translate(o);n=this.filterPlaceholder({filterOptionKey:o,filterOption:s,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,o,s)=>{if(!(t instanceof Pc))return;const r=n===0&&s>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&s>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,o)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Pc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){b2(e)&&$n(e.getGui(),t)}setElementDisabled(e,t){b2(e)&&Qf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Pc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const o=xp(t,this.optionsFactory),s=this.getInputs(e);for(let r=0;r<s.length;r++){const i=s[r];i!=null&&n(i,r,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return xp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,o,s){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,s,r)=>{r===t&&this.setElementValue(o,n[s]!=null?n[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,o)=>{this.setElementValue(t,n===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},KB=class{constructor(e,t,n,o,s,r){this.alive=!0,this.context=e,this.eParent=s;const i=Cle(t,n,o);i&&i.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;s.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){$n(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)}},W_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function qB(e,t){const{dateFrom:n,dateTo:o,type:s}=e||{};return[n&&ws(n,void 0,!0)||null,o&&ws(o,void 0,!0)||null].slice(0,xp(s,t))}var YB=1e3,ZB=1/0,Iye=class extends U_{constructor(){super("dateFilter",qB,W_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=YB,this.maxValidYear=ZB,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))Je(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",YB),o=t("maxValidYear",ZB);this.minValidYear=n,this.maxValidYear=o,n>o&&Je(83);const{minValidDate:s,maxValidDate:r}=e,i=s instanceof Date?s:ws(s);this.minValidDate=i;const a=r instanceof Date?r:ws(r);this.maxValidDate=a,i&&a&&i>a&&Je(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:o},params:s}=this,r=new KB(n,t,s.colDef,Pt(o,{onDateChanged:()=>this.onUiChanged(),filterParams:s,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=ao({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,o){const s=ao({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(s),e.appendChild(s),n.push(this.createDateCompWrapper(s))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),Ip(this.eConditionPanelsFrom,e,t),Ip(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const o=Ip(e,t,n);for(const s of o)s.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:o,maxValidYear:s}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>s)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,o,s,r)=>{s!==e||!t||o>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},o=this.getValues(e),s=this.params.useIsoSeparator?"T":" ";return o.length>0&&(n.dateFrom=Gs(o[0],!0,s)),o.length>1&&(n.dateTo=Gs(o[1],!0,s)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},XB=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new G_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,o=[];if(n){const i=t;o.push(...i.conditions??[])}else o.push(t);const s=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return o[s](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:o}}=e;if(t==null)return;let r=hV(t)?t.conditions:[t];const i=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!r||r.every(u=>i.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((r&&!r.every(u=>u.filterType===c)||t.filterType!==c)&&(r=r.map(u=>({...u,filterType:c})),l=!0),typeof o=="number"&&r&&r.length>o&&(r=r.slice(0,o),l=!0),l){const u=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const o=this.optionsFactory,s=this.mapValuesFromModel(t,o),r=o.getCustomOption(t.type),i=Dye(r,s,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,n,t,e))}},JB=class extends XB{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:o,includeBlanksInLessThan:s,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(s)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const o=n.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const s=this.comparator(),r=e[0]!=null?s(e[0],t):0;switch(o){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=s(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return jy(t);case"notBlank":return!jy(t);default:return Je(76,{filterModelType:o}),!0}}},QB={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},xye={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},z_=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?ml(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(c=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${ml(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?ml(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=i||{};return a&&l&&c===0?n(a,l):this.conditionToString(r,o,r.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,o,s,r){let i;const a=this.getTypeKey(e);return a&&(i=ml(this,a)),s&&r&&(i=this.getLocaleTextFunc()(s,r)),i!=null?t?`${i} ${ml(this,"filterSummaryInRangeValues",[n(),o()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},e$=class extends z_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:o,valueSvc:s}=this.beans,r=t.column,i=o==null?void 0:o.getDateFormatterFunction(r),a=i?i(n??void 0):n;return s.formatValue(r,null,a)}),this.filterTypeKeys=QB}conditionToString(e,t,n,o,s){const{type:r}=e,i=ws(e.dateFrom),a=ws(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>O0(h,l),u=()=>i!==null?c(i):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(r,n,u,d,o,s);if(h!=null)return h}return n?`${u()}-${d()}`:i!=null?c(i):`${r}`}};function Fye(e,t){const n=t;return n<e?-1:n>e?1:0}var Pye=class extends JB{constructor(){super(qB,W_),this.filterType="date",this.FilterModelFormatterClass=e$}comparator(){return this.params.filterParams.comparator??Fye}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},t$=class extends bn{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 G_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(n);this.setEditable(o)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:o,model:s}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},kye={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"}]},Aye=class extends t${constructor(){super(kye,[yy]),this.eReadOnlyText=dt,this.eDateWrapper=dt,this.FilterModelFormatterClass=e$,this.filterType="date",this.defaultOptions=W_}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?ws(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){$n(this.eDateWrapper,e),$n(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,o=Gs(e),s=o==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(s,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=Y0(e,this.defaultDebounceMs);return Pt(this.gos,{onDateChanged:Lo(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:o}=this;this.dateComp=new KB(e,t,o.column.getColDef(),this.getDateComponentParams(),n,s=>{s.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Oye={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Mye=class extends bn{constructor(){super(Oye,[yy]),this.eDateInput=dt,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&hl();const{minValidYear:o,maxValidYear:s,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&o&&Je(85),i&&s&&Je(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:ws(g));f&&p&&f.getTime()>p.getTime()&&Je(87)}r?r instanceof Date?t.min=O0(r):t.min=r:o&&(t.min=`${o}-01-01`),i?i instanceof Date?t.max=O0(i):t.max=i:s&&(t.max=`${s}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return ws(this.eDateInput.getValue())}setDate(e){var o;const t=this.params.filterParams.colDef.cellDataType,n=((o=this.beans.dataTypeSvc)==null?void 0:o.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Gs(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}},j_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function K_(e){const{allowedCharPattern:t}=e??{};return t??null}function q_(e){return e==null||isNaN(e)?null:e}function n$(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[q_(n),q_(o)].slice(0,xp(s,t))}var Nye=class extends U_{constructor(){super("numberFilter",n$,j_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:o}=this.params,s=!n&&o?o(t??null):t;super.setElementValue(e,s)}createEValue(){const e=K_(this.params),t=ao({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,o){const s=this.createManagedBean(o?new kc({allowedCharPattern:o}):new B0);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=o=>this.removeComponents(o,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(q_(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=ua(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},o$=class extends z_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=QB}conditionToString(e,t,n,o,s){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),o,s);if(c!=null)return c}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},Lye=class extends JB{constructor(){super(n$,j_),this.filterType="number",this.FilterModelFormatterClass=o$}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},s$=class extends We{constructor(e){super(),this.params=e,this.eInput=dt,this.onValueChanged=()=>{}}setupGui(e){var o;this.eInput=this.createManagedBean(new kc((o=this.params)==null?void 0:o.config));const t=this.eInput.getGui();e.appendChild(t);const n=s=>this.onValueChanged(s);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function Y_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function r$(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[n||null,o||null].slice(0,xp(s,t))}var Vye={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},i$=class extends t${constructor(){super(...arguments),this.eFloatingFilterInputContainer=dt,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Vye)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:o,readOnly:s}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Ey(e.filterParams),!s){const r=Y0(e.filterParams,o),i=Lo(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();No(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:o,params:s,lastType:r}=this;let i=o.getValue();if(s.filterParams.trimInput&&(i=Y_(i),o.setValue(i,!0)),n){const a=s,l=a.model,c=this.convertValue(i),u=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else s.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Bye=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new B0),this.eTextInput=this.createManagedBean(new kc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(n,o=>this.onValueChanged(o))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},$ye=class extends i${constructor(){super(...arguments),this.FilterModelFormatterClass=o$,this.filterType="number",this.defaultOptions=j_}updateParams(e){K_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=K_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new s$({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Bye)}convertValue(e){return e?Number(e):null}},Z_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Hye=class extends U_{constructor(){super("textFilter",r$,Z_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(ua(n.getValue()))}),t}createEValue(){const e=ao({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const o=this.createManagedBean(new kc);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:o,eValuesTo:s}=this;n(o),n(s)}},a$=class extends z_{constructor(){super(...arguments),this.filterTypeKeys=xye}conditionToString(e,t,n,o,s){const{filter:r,filterTo:i,type:a}=e;if(t){const l=u=>()=>ml(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(r),l(i),o,s);if(c!=null)return c}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},Gye=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const o=t.lastIndexOf(n);return o>=0&&o===t.length-n.length}default:return!1}},Uye=e=>e,Wye=e=>e==null?null:e.toString().toLowerCase(),zye=class extends XB{constructor(){super(r$,Z_),this.filterType="text",this.FilterModelFormatterClass=a$}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Gye,this.formatter=t.textFormatter??(t.caseSensitive?Uye:Wye)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,o){const s=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return jy(t);if(n.type==="notBlank")return!jy(t);const d={api:i,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:n.type,value:r,textFormatter:u};return s.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const o={...n},{filter:s,filterTo:r}=n;return s&&(o.filter=Y_(s)??null),r&&(o.filterTo=Y_(r)??null),o};return hV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},jye=class extends i${constructor(){super(...arguments),this.FilterModelFormatterClass=a$,this.filterType="text",this.defaultOptions=Z_}createFloatingFilterInputService(){return this.createManagedBean(new s$)}};function Kye(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function qye(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Yye(e){var t;(t=e.quickFilter)==null||t.resetCache()}var Zye=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:o}=this.beans,s=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(s&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=o==null?void 0:o.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ft(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Je(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const o=this.getTextForColumn(n,e);return ft(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:o,matcher:s}=this;return s(o,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const s=Pt(this.gos,{value:n,node:t,data:t.data,column:e,colDef:o});n=o.getQuickFilterText(s)}return ft(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const o=this.getTextForColumn(n,e);ft(o)&&t.push(o)}return t.join(`
|
|
259
259
|
`)}},Xye={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Jve]},X_={moduleName:"FilterCore",version:ut,beans:[Cye],apiFunctions:{isAnyFilterPresent:yye,onFilterChanged:wye},css:[sye],dependsOn:[Xye]},l$={moduleName:"FilterValue",version:ut,beans:[Sye]},Ky={moduleName:"ColumnFilter",version:ut,beans:[vye,bye],dynamicBeans:{headerFilterCellCtrl:Qve},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:rye,getColumnFilterInstance:iye,destroyFilter:aye,setFilterModel:lye,getFilterModel:cye,getColumnFilterModel:uye,setColumnFilterModel:dye,showColumnFilter:hye,hideColumnFilter:fye,getColumnFilterHandler:pye,doFilterAction:gye},dependsOn:[X_,zy,l$,nye]},Jye={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:_ye},dependsOn:[Ky]},Qye={moduleName:"TextFilter",version:ut,dependsOn:[Ky],userComponents:{agTextColumnFilter:{classImp:Hye,params:{useForm:!0}},agTextColumnFloatingFilter:jye},dynamicBeans:{agTextColumnFilterHandler:zye}},ewe={moduleName:"NumberFilter",version:ut,dependsOn:[Ky],userComponents:{agNumberColumnFilter:{classImp:Nye,params:{useForm:!0}},agNumberColumnFloatingFilter:$ye},dynamicBeans:{agNumberColumnFilterHandler:Lye}},twe={moduleName:"DateFilter",version:ut,dependsOn:[Ky],userComponents:{agDateColumnFilter:{classImp:Iye,params:{useForm:!0}},agDateInput:Mye,agDateColumnFloatingFilter:Aye},dynamicBeans:{agDateColumnFilterHandler:Pye}},nwe={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[Zye],dependsOn:[X_,l$]},owe={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:Kye,getQuickFilter:qye,resetQuickFilter:Yye},dependsOn:[nwe]},swe={moduleName:"ExternalFilter",version:ut,dependsOn:[X_]},rwe=".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}}",J_=(e,t,n)=>{var a,l,c;const{editModelSvc:o}=e,s=(l=(a=o==null?void 0:o.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=s||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},iwe=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=H_(s),{column:i,eGui:a}=t,l=i.getColDef();!o&&r&&!l.headerComponent&&(o=Jv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=H_(s),{column:i,eGui:a}=t,l=i.getColGroupDef();!o&&r&&!(l!=null&&l.headerGroupComponent)&&(o=Jv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:o}=this,{gos:s,editSvc:r}=o,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&J_(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&ft(g))return _p(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Pt(s,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=H_(s);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&J_(o,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Jv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,o)}setupFullWidthRowTooltip(e,t,n,o){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(s,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:o}=n,s=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!s)return;const r={getGui:()=>s,getTooltipValue:()=>J_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ft(t.tooltipField)||ft(t.tooltipValueGetter)||ft(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},awe=class extends Pce{createTooltipComp(e,t){const n=Ele(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}},c$={moduleName:"Tooltip",version:ut,beans:[iwe],dynamicBeans:{tooltipFeature:Y2,highlightTooltipFeature:kce,tooltipStateManager:awe},userComponents:{agTooltipComponent:Mce},dependsOn:[zy],css:[rwe]},Hd=class{constructor(e){this.cellValueChanges=e}},Q_=class extends Hd{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},lwe=10,u$=class{constructor(e){this.actionStack=[],this.maxStackSize=e||lwe,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}},cwe=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&&jV(this.activeCellEdit,t),o=this.activeRowEdit!==null&&khe(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new u$(n),this.redoStack=new u$(n),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(n,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(o,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,n,o,s){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[o],s),r instanceof Q_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const o of e.cellValueChanges){const{rowIndex:s,rowPinned:r,columnId:i}=o,a={rowIndex:s,rowPinned:r},l=Ca(this.beans,a);l.displayed&&l.setDataValue(i,t(o),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((o,s)=>{if(!o)return;const r=o.startRow,i=o.endRow;s===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:o.startColumn,columns:o.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:o}=t,s={rowIndex:n,rowPinned:o},r=Ca(this.beans,s),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:o}=e,{colModel:s,focusSvc:r,rangeSvc:i}=this.beans,a=s.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Hd(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 Hd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Hd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Q_(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&&ha(n)?e=new Q_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Hd(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 Hd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},uwe=".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}",dwe={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},hwe=class extends Oy{constructor(){super(dwe,[V0]),this.eEditor=dt}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=qv(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},qy=class extends Oy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=dt}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:o,eventKey:s,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;o?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?i="":s&&s.length===1?r?a=!1:i=s:(i=t.getStartValue(),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var o,s;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;hl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(s=(o=this.cellEditorInput).setCaret)==null||s.call(o)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},fwe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},pwe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return fwe}getAgComponents(){return[L2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:o,max:s,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ft(n)&&!ft(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Gs(e,this.includeTime??!1)}},gwe=class extends qy{constructor(){super(new pwe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},mwe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},vwe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return mwe}getAgComponents(){return[L2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,o=this.formatDate(this.parseDate(n??void 0)),{min:s,max:r,getValidationErrors:i}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(s){const u=new Date(s);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ft(n)&&!ft(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Gs(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):ws(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Gs(e??null,this.includeTime??!1)??void 0}},ywe=class extends qy{constructor(){super(new vwe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},wwe={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Cwe=class extends Oy{constructor(){super(wwe,[Hle]),this.eEditor=dt}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:o,maxLength:s,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==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,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,o=e.getValue();return!ft(o)&&!ft(n)?n:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getLocaleTextFunc(),s=this.getValue();let r=[];return typeof s=="string"&&t!=null&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,internalErrors:r,cellEditorParams:e}):r}},bwe={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Swe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return bwe}getAgComponents(){return[Gle]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:o,precision:s,step:r}=t;n!=null&&e.setMax(n),o!=null&&e.setMin(o),s!=null&&e.setPrecision(s),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:o}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),o?o({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ft(n)&&!ft(t.value))return t.value;let o=t.parseValue(n);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){hl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Ewe=class extends qy{constructor(){super(new Swe(()=>this.getLocaleTextFunc()))}},_we={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Rwe=class extends Oy{constructor(){super(_we,[Qle]),this.eEditor=dt,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:o}=this,{values:s,value:r,eventKey:i}=e;if(Bn(s)){Je(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;s.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,o=this.getValue();let s=[];if(t&&!t.includes(o)){const r=this.getLocaleTextFunc();s.push(r("invalidSelectionValidation","Invalid selection."))}else s=null;return n?n({value:o,internalErrors:s,cellEditorParams:e}):s}},Dwe={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Twe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Dwe}getAgComponents(){return[yy]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getValue(),s=this.getLocaleTextFunc();let r=[];return t!=null&&typeof o=="string"&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ft(n)&&!ft(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){hl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ft(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},d$=class extends qy{constructor(){super(new Twe(()=>this.getLocaleTextFunc()))}};function Iwe(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function xwe(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function h$(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function f$(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Fwe(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Pwe(e){var t;(t=e.undoRedo)==null||t.undo("api")}function kwe(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Awe(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Owe(e){var o;const t=(o=e.editModelSvc)==null?void 0:o.getEditMap(),n=[];return t==null||t.forEach((s,r)=>{const{rowIndex:i,rowPinned:a}=r;s.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=ba(l);let g=u??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Mwe(e,t=!1){var o;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const s of((o=e.editModelSvc)==null?void 0:o.getEditPositions())??[])s.state==="editing"&&n.revertSingleCellEdit(s);else Lc(e,{persist:!0});Vd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Nwe(e,t){var o;const n=zn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function Lwe(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(o);if(!l){Je(12,{colKey:o});return}const u=Ca(e,{rowIndex:s,rowPinned:r||null});if(!u){Je(290,{rowIndex:s,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&f$(e,s),h$(e,o),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Vwe(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Bwe(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function $we(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Hwe={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Gwe=class extends S0{constructor(e){super(Hwe),this.params=e}postConstruct(){Dc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{o_(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function Uwe(e,{column:t},n,o,s="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=Wwe(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:s==="api"?o??!1:!1}function Wwe(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function eR(e,{rowNode:t,column:n},o="ui"){const s=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,s)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function zwe(e,t,n="ui"){const o=eR(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(r=>eR(e,{rowNode:t.rowNode,column:r},n))}var Yy=(e,t=!1)=>{if(e!==void 0)return ba(e)||t&&e.state==="editing"};function p$(e,t,n=!1){var o;return Yy((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var g$=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const r=e[o];if(r.data&&(Yy(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Yy(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||g$(r.childrenAfterGroup,t,n))return!0}};function m$(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:g$(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function v$(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return Yy((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var jwe=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 s;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=p$(n,e)||m$(n,e)||v$(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const o=!!((s=this.editModelSvc)!=null&&s.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Kwe=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 i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let o=e.rowNode,s=t==null?void 0:t.getEditRow(o);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:o});if(!s&&o.pinnedSibling&&(o=o.pinnedSibling,s=t==null?void 0:t.getEditRow(o)),s){const a=Array.from(s.keys()).some(l=>{const c={rowNode:o,column:l};return p$(n,c,!0)||m$(n,c)||v$(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var s,r;const n=((s=this.editSvc)==null?void 0:s.isBatchEditing())??!1,o=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",o&&t),i.toggleCss("ag-row-batch-edit",o&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},qwe=({rowModel:e,pinnedRowModel:t,editModelSvc:n},o)=>{const s=new Set;e.forEachNode(r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("top",r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("bottom",r=>o.has(r)&&s.add(r));for(const r of o)s.has(r)||n.removeEdits({rowNode:r});return s},Ywe=({editModelSvc:e},t,n)=>{var o;for(const s of t)(o=e==null?void 0:e.getEditRow(s))==null||o.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:s,column:i}))},Zwe=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());Ywe(e,qwe(e,o),t)},Xwe=new Set(["undo","redo","paste","bulk","rangeSvc"]),Jwe=new Set(["ui","api"]),y$={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Qwe=new Set(Object.keys(y$)),eCe=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Zy={cancel:!0,source:"api"},tCe={cancel:!1,source:"api"},Gd={checkSiblings:!0},Fp={force:!0,suppressFlash:!0},nCe=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:o})=>{this.stopEditing(void 0,Zy),this.createStrategy(o)});const t=Zwe(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,Zy):this.isEditing()&&(this.isBatchEditing()?Vd(e,this.model.getEditPositions()):this.stopEditing(void 0,tCe)),!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,Zy)):(this.stopEditing(void 0,Zy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=w$(n,e);if(o){if(o.beanName===s)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,o="ui"){const s=Uwe(this.beans,e,t,n,o);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}shouldStopEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldCancel(e,t,n))??null}validateEdit(){return vme(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Gd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:o=null,source:s="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=zn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,n,s);if(l===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:s,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,w,S;const{event:n,cancel:o,source:s="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(Qwe.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?y$[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Gd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=zn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!o&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=o&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){Lc(a,{persist:!0,isCancelling:g||o,isStopping:p});const b=l.getEditMap(),C=this.processEdits(b,o,s);(v=this.strategy)==null||v.stop(o,n);for(const _ of C)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const E=zn(a,_),I=ba(_);E==null||E.refreshCell({force:!0,suppressFlash:!I})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((w=this.strategy)!=null&&w.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,C=b===Oe.ENTER,_=b===Oe.ESCAPE,E=b===Oe.TAB;(C||E||_)&&(C||E?Lc(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Vd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Lc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),A_(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:o}=e;if(!(n instanceof KeyboardEvent)||o)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of o){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=ba(c);!t&&d&&!s&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,o,s="edit"){const{beans:r}=this,i=zn(r,{rowNode:e,column:t}),a=Jwe.has(s)?"edit":s;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),o&&(i==null||i.refreshCell(Fp)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=Fp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...oCe(e),...Fp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:o,sourceValue:s}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:o,oldValue:s,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:o,gos:s}=this,{editModelSvc:r,rowModel:i}=o;ro(s)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,o={}){var d,h,f;const{beans:s,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=zn(s,{rowNode:p,column:t}))==null||h.refreshCell(o);for(const p of a)(f=zn(s,{rowNode:p,column:t}))==null||f.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:o,beans:s}=this;if(n.group){if(o.get("treeData")){if(!n.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const r=w$(o)==="fullRow"?zwe(s,e,t):eR(s,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var o,s,r,i;if(this.hasValidationErrors(e)){const a=zn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((o=t==null?void 0:t.preventDefault)==null||o.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(s=a==null?void 0:a.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var o,s,r,i;const n=zn(this.beans,e);(o=n==null?void 0:n.comp)!=null&&o.getCellEditor()&&(Vd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Ld(this.beans,e,{silent:!0}),Vc(this.beans),n==null||n.refreshCell(Fp),t&&(n==null||n.focusCell(),(i=(r=(s=n==null?void 0:n.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var o;Vc(this.beans);const t=zn(this.beans,e);t&&(t.refreshCell(Fp),(o=t.rowCtrl.rowEditStyleFeature)==null||o.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,o="ui"){var a;let s;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Bd&&r&&(s=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,o,i)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!i&&this.stopEditing()),s}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const s=e.pinnedSibling;if(s){const i=this.model.getEdit({rowNode:s,column:t});i&&(o=i)}const r=n?(o==null?void 0:o.editorValue)??(o==null?void 0:o.pendingValue):o==null?void 0:o.pendingValue;return r===pr||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){dme(this,this.beans,e)}createPopupEditorWrapper(e){return new Gwe(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!eCe.has(n))return;const{beans:s}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Xwe.has(n))return Hy(s,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return Hy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(o=s.editModelSvc)==null||o.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return Hy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){pme(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Gd))return;const{rowNode:o,column:s}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(o,Gd),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,Gd);if(i!==void 0&&(a!=null&&a.has(s)))return{valueToDisplay:this.valueSvc.getValue(s,o)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,o){var s;(s=this.strategy)==null||s.dispatchCellEvent(e,t,n,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Pt(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:r}=this;Lc(o,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=Ca(o,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let w=r.parseValue(g,f??null,a,v);Number.isNaN(w)&&(w=null),p.set(g,{editorValue:void 0,pendingValue:w,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),A_(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=zn(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new jwe(e,t)}createRowStyleFeature(e,t){return new Kwe(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:o,valueSvc:s}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?o.getCol(i):l?o.getCol(l):a;if(!f)continue;const p=Ca(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ba({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=zn(this.beans,e);if(!t||!this.isEditing(t,Gd))return;const n=this.model.getEdit(t);if(!n||!ba(n))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return zn(this.beans,e)}};function oCe(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 w$(e,t){return t??e.get("editType")??"singleCell"}var C$=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:o,beans:s}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=zn(s,n));const{gos:i,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:Ca(s,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?o.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var s,r;const n=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const i of n){o.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((s=a==null?void 0:a.errorMessages)==null?void 0:s.length)??0)>0){o.fail.push(i);continue}o.pass.push(i)}if(e)for(const i of n)Gy(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(o);if(i.destroy.length>0)for(const a of i.destroy)Gy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=zn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){Lc(this.beans,{persist:!1});const n=this.model.getEditPositions(),o=[];if(e)for(const s of n)s.rowNode!==e&&o.push(s);else for(const s of n)o.push(s);Vd(this.beans,o),A_(this.beans,t)}setFocusOutOnEditor(e){var t,n,o;(o=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||o.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>{var s,r;return(r=(s=t==null?void 0:t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:r.call(s)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:o,position:s,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;fme(this.beans,r,s,i,t,o)}dispatchCellEvent(e,t,n,o){const s=zn(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,n),...o})}dispatchRowEvent(e,t,n){if(n)return;const o=P_(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return o&&n==="api"?!0:o&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Oe.ESCAPE||o&&n==="api"||n==="api")}setEditMap(e,t){var o;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((s,r)=>{s.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(o=this.model)==null||o.setEditMap(e),n.length>0){const s=n.at(-1),r=s.pendingValue===pr?void 0:s.pendingValue;this.start({position:s,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=zn(this.beans,s);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},sCe=class extends C${constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!P_(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:o,event:s,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:o,event:s,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var s;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const o=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(ba(a)){o.push(i);break}}}),Vc(this.beans),!e&&((s=this.editSvc)==null?void 0:s.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of o)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const o=zn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,o="ui",s=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!s?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Ld(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&s&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!s&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},o)=>{var r;if(n!=="editing")return;const s=zn(this.beans,{rowNode:t,column:o});s&&!((r=s.comp)!=null&&r.getCellEditor())&&Ld(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},rCe=class extends C${constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const o=super.shouldStop(e,t,n);if(o!==null)return o;const{rowNode:s,column:r}=e||{};return(!this.rowNode||!this.column)&&s&&r?null:this.rowNode!==s||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:o,ignoreEventKey:s}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:o,ignoreEventKey:s})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:o,column:s,rowPinned:r}=e,i=Ca(this.beans,{rowIndex:o,rowPinned:r}),a=k_(s),l=t.getCol(a),c=e.previousParams;if(c){const u=k_(c.column);if((c==null?void 0:c.rowIndex)===o&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,o="ui",s=!1){var p,g,v,w,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=Md(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!s&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!s&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),d&&!s){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((w=a.comp)!=null&&w.getCellEditor())){const C=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Ld(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},Cl={moduleName:"EditCore",version:ut,beans:[ume,nCe],apiFunctions:{getEditingCells:Owe,getEditRowValues:Awe,getCellEditorInstances:hme,startEditingCell:Lwe,stopEditing:Mwe,isEditing:Nwe,validateEdit:Vwe},dynamicBeans:{singleCell:rCe,fullRow:sCe},dependsOn:[zy,c$],css:[uwe]},iCe={moduleName:"UndoRedoEdit",version:ut,beans:[cwe],apiFunctions:{undoCellEditing:Pwe,redoCellEditing:kwe,getCurrentUndoSize:Bwe,getCurrentRedoSize:$we},dependsOn:[Cl]},aCe={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:d$,agTextCellEditor:d$},dependsOn:[Cl]},lCe={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Ewe}},dependsOn:[Cl]},cCe={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:gwe,agDateStringCellEditor:ywe},dependsOn:[Cl]},uCe={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:hwe},dependsOn:[Cl]},dCe={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Rwe},dependsOn:[Cl]},hCe={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:Cwe},dependsOn:[Cl]},fCe={moduleName:"CustomEditor",version:ut,dependsOn:[Cl]},pCe=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Dd(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),Rae(e))}createColumns(e,t){var h,f;const n=()=>{var p;dy(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},o=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==o,i=this.generateSelectionCols();if(_ae(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!pa(v));return[...i,...g]})}updateColumns(e){var n;const t=Dd(e.source);for(const o of((n=this.columns)==null?void 0:n.list)??[]){const s=this.createSelectionColDef(e.currentValue);o.setColDef(s,null,t),Ur(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>hp(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!_c(e))return!1;const o=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&o)return!1;const s=!!Rd(n),r=ry(n);return s||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:s,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:l2,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new Tc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?Rd(t):void 0,s=e&&typeof e!="string"?Rd(e):void 0,r=o!==s,i=t&&typeof t!="string"?ry(t):void 0,a=e&&typeof e!="string"?ry(e):void 0,l=i!==a,c=iy(e),u=iy(t);(r||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;dy(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const o=e.length+t.length+n.length;if(o===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const r=()=>{let u;switch(s.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Gr(u,s)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(c2))?2:1)===o&&r()}};function gCe(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!bp(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:o,source:s,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:o,source:s??"api",newValue:r})}function mCe(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function vCe(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function yCe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function wCe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function CCe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function bCe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function SCe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function ECe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var _Ce=class extends Lde{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=ay(e),this.groupSelectsDescendants=up(e),this.groupSelectsFiltered=ly(e)==="filteredDescendants",this.masterSelectsDetail=o2(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=up(e),n=ay(e),o=ly(e)==="filteredDescendants";this.masterSelectsDetail=o2(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,n),this.selectRange(o.select,!0,n);{const s=o.checkFilteredNodes?S$(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:s,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:o,event:s,source:r,keepDescendants:i=!1}){var c;if(o.length===0)return 0;const{gos:a}=this;if(!_c(a)&&e)return Je(132),0;if(o.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<o.length;u++){const d=o[u],h=Ud(d);if(h.rowPinned&&!bp(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(o.length===1&&r==="api"&&this.selectionCtx.setRoot(Ud(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ud(o[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let o=0;return e.forEach(s=>{const r=Ud(s);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),o}selectChildren(e,t,n){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,o)=>{e(n)&&t.set(o,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:o}=this.beans;if(!ro(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new Ep(!0,s),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==s){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const o=new Map;let s=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!DCe(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&o.set(r.parent.id,r.parent)}}),o.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),s}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new pl(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(!ro(e))return;const n=t.getTopLevelNodes();if(n===null)return;const o=[];function s(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(n),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ro(this.gos);let o=!1;const s=r=>{const i=this.selectRowNode(Ud(r),!1,void 0,e);o||(o=i)};if(t==="currentPage"||t==="filtered"){if(!n){_n(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);o||(o=r)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return b$(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){n(s);return}if(!s.expanded&&!s.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(s);return}this.groupSelectsDescendants||n(s)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(n),t):(o.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,o=t.getFirstRow(),s=t.getLastRow();for(let r=o;r<=s;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!_c(t)){Je(132);return}if(dae(t)&&!cp(t)){Je(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:s}=e;let r=!1;if(this.getNodesToSelect(s).forEach(i=>{const a=this.selectRowNode(Ud(i),!0,void 0,o);r||(r=a)}),n.selectAll=!0,ro(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(o);r||(r=i)}r&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){_n(103);return}const o=new Set(e),s=[];this.beans.rowModel.forEachNode(r=>{o.has(r.id)&&s.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return ro(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!_c(t))return;const o="selectableChanged",s=e!==void 0,r=ro(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(s&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new Ep(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!s,!s)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:o}),!s&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,o))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const o=RCe(n);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!cp(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const s=[];for(const r of o){const i=n.getRowNode(r);i&&s.push(i)}n.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ud(e){return bp(e)?e.pinnedSibling:e.footer?e.sibling:e}function RCe(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),b$(t,n)}function b$(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function DCe(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function S$(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(S$))??!1;return t||n}var TCe={moduleName:"SharedRowSelection",version:ut,beans:[pCe],apiFunctions:{setNodesSelected:gCe,selectAll:mCe,deselectAll:vCe,selectAllFiltered:yCe,deselectAllFiltered:wCe,selectAllOnCurrentPage:CCe,deselectAllOnCurrentPage:bCe,getSelectedNodes:SCe,getSelectedRows:ECe}},ICe={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[_Ce],dependsOn:[TCe]};function xCe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function FCe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function E$(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function _$(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function PCe(e,t,n){var s,r;const o=kve(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){_n(238);return}o.setRowCount(t,n);return}_n(28);return}(r=Wy(e))==null||r.setRowCount(t,n)}function kCe(e){var t;return Sd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function ACe(e){return e.rowModel.isLastRowIndexKnown()}var OCe={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:xCe,collapseAll:FCe}},MCe={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:E$,resetRowHeights:_$}},NCe={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:PCe,getCacheBlockState:kCe,isLastRowIndexKnown:ACe}},LCe=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(o=>{var r;if(!o){_n(18),t||_n(20);return}if(this.isGridApi(o))return o;const s=o;return"current"in s?(r=s.current)==null?void 0:r.api:(s.api||_n(19),s.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(o=>{n.push(t(o))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let o=null;n&&(o=t.getProvidedColGroup(n.getGroupId())),!(n&&!o)&&t.setColumnGroupOpened(o,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const o=this.beans,{colResize:s,ctrlsSvc:r,colModel:i}=o;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Ur(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Ur(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Ur(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},VCe={moduleName:"AlignedGrids",version:ut,beans:[LCe],dependsOn:[lB]},BCe=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},R$(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:o}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const s=R$(this.rootNode),r=new Array(e.length);s._leafs=r;let i=0;const a=o==null?void 0:o.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const w=a(g);w&&c(v,w)}}};c(s,e),r.length=i}setImmutableRowData(e,t){var w;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=_d(o),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(w=this.beans.groupStage)==null?void 0:w.getNestedDataGetter();let d=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const C=S.sourceRowIndex;d=C<=h,h=C}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,C)=>{for(let _=0,E=b.length;_<E;++_){const I=b[_];if(!I)continue;let T=this.getRowNode(s({data:I,level:C}));if(T?(p(T,I),f||(f=!!u&&T.treeParent!==S)):(T=this.createRowNode(I,C),i.add(T)),!u||l.has(T)){l.add(T);continue}l.add(T),T.treeParent=S;const P=u(I);P&&g(T,P,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?WCe(S,l,r):UCe(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const o=this.rootNode._leafs;for(let s=0,r=o.length;s<r;s++){const i=o[s];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],o=_d(this.gos),s=this.executeRemove(o,e,t,n),r=this.executeUpdate(o,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:s,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:o,removals:s},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(o.delete(g),s.add(g)),f[c++]=g}return f.length=c,c&&GCe(i,u,d,s,h),f}executeUpdate(e,{update:t},{adds:n,updates:o},s){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&s.push(u),i[a++]=u,n.has(u)||o.add(u))}return i.length=a,i}executeAdd(e,t){var n;const o=(n=this.rootNode)._leafs??(n._leafs=[]),s=o.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=s+i;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<s){for(let d=s-1,h=a-1;d>=l;--d){const f=o[d];f.sourceRowIndex=h,o[h--]=f}t.reordered=!0}o.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,o[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var o;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(o=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||o.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new pl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const o=n.id,s=this.allNodesMap;return s[o]&&Je(2,{nodeId:o}),s[o]=n,n}deleteNode(e){var s;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const o=e.pinnedSibling;o&&((s=this.beans.pinnedRowModel)==null||s.pinRow(o,null))}lookupNode(e,t){if(!e)return HCe(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(_n(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=$Ce(e,t)),t}},$Ce=(e,t)=>{for(let n=0,o=e.length;n<o;n++){const s=e[n];if((s==null?void 0:s.rowIndex)==t-1)return n+1}return t},R$=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],o=[],s=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=o,e.childrenAfterFilter=s;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=o,r.childrenAfterFilter=s,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},HCe=(e,t)=>{if(e)for(let n=0,o=e.length;n<o;n++){const s=e[n];if(s.data===t)return s}return _n(5,{data:t}),null},GCe=(e,t,n,o,s)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(o.has(a)||s!=null&&s.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},UCe=(e,t)=>{const n=t.size;e.length=n;let o=0,s=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===o?r||(r=s):(a>=0?r=!0:s=!0,i.sourceRowIndex=o,e[o]=i),++o}return r},WCe=(e,t,{removals:n,adds:o})=>{const s=e.length;e.length=t.size;let r=0;for(let i=0;i<s;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of o)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},D$=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let o=0,s=t.length-1;o<=s;o++){const r=t[o],i=o===0,a=o===s;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==o&&(r.childIndex=o,r.dispatchRowEvent("childIndexChanged"))}},zCe=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,o){const{gos:s,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=s.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=s.getCallback("postSortRows");let g=!1,v;const w=S=>{var E,I;const b=f&&S.leafGroup;let C=u&&d&&!S.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let _=null;if(C){let T=!1;if(h){const P=S.level+1;P<h.length&&(T=h[P].getSort()===null)}T||(_=qCe(S))}else!e.length||b||(t&&n?_=jCe(a,S,n,o,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((E=S.childrenAfterAggFilter)==null?void 0:E.slice(0))??[]),g||(g=((I=S.childrenAfterSort)==null?void 0:I[0])!==_[0]),S.childrenAfterSort=_,D$(S),p){const T={nodes:S.childrenAfterSort};p(T)}};if(o==null||o.forEachChangedNodeDepthFirst(w),g&&s.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Si(this.gos)){for(let n=0;n<t;++n){const o=e[n].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},jCe=(e,t,n,o,s)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,s);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||o&&!o.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(s,h,f)),KCe(e,s,l,d)},KCe=(e,t,n,o)=>{let s=0,r=0;const i=n.length,a=o.length,l=new Array(i+a);let c=0;for(;s<i&&r<a;){const u=n[s],d=o[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++s):(l[c++]=d.rowNode,++r)}for(;s<i;)l[c++]=n[s++].rowNode;for(;r<a;)l[c++]=o[r++].rowNode;return l},qCe=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,o=t==null?void 0:t.length,s=n==null?void 0:n.length;if(!o||!s)return null;const r=new Array(s),i=new Set;for(let l=0;l<s;++l)i.add(n[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===o)return t;for(const l of i)r[a++]=l;return r.length=a,r},YCe=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=Lo(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new pl(e);this.rootNode=t,this.nodeManager=this.createBean(new BCe(t));const n=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=n;for(let o=n.length-1;o>=0;--o)for(const s of n[o].refreshProps)t.set(s,o);this.addManagedPropertyListeners([...t.keys()],o=>{var r;const s=(r=o.changeSet)==null?void 0:r.properties;s&&this.onPropChange(s)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,o){let s,r=!1;do{s=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,o);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=cl(this.beans,d);d.setRowHeight(h.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:o}=this,s=o.groupStage;if(!t)return;const r=new Set(e),i=s==null?void 0:s.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=s==null?void 0:s.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new Ny,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,o=t.length;let s=o;for(let r=0,i=e.length;r<i&&s;++r)s=Math.min(s,n.get(e[r])??s);return s<o?t[s].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,o=t.environment.getDefaultRowHeight();let s=0;const r=Vo(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=cl(t,l,r,o);l.setRowHeight(u.height,u.estimated)}l.setRowTop(s),l.setRowIndex(i),s+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,o=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},s=i=>{o(i),o(i.detailNode),o(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)s(a[u])},r=this.rootNode;r&&s(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var s,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=(s=e.sibling)!=null&&s.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:o}=this;if(!n||!o.length||o[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(o,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let r=s.parent;for(;r&&r!==t;)s=r,r=s.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(s))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:Ed(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(s=>s.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:Ed(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Ed(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new Ep(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:o}=e;return!(!t||n||!o||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:o,started:s,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(s&&i&&o.dispatchEvent({type:"rowDataUpdated"}),!s||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,o=!1;const s=[],r=up(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(o)return;if(n&&(i===t||i===e)&&(o=!0,r&&i.group)){T$(s,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(o=!0)}(!i.group||!r)&&s.push(i)}),s}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let o=0,s=n-1;if(e<=0)return 0;if(t[s].rowTop<=e)return s;let i=-1,a=-1;for(;;){const l=Math.floor((o+s)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(s=l-1),i===o&&a===s))return l;i=o,a=s}}isRowInPixel(e,t){const n=e.rowTop,o=n+e.rowHeight;return n<=t&&o>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let o=0,s=t.length;o<s;++o)e(t[o],o)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,o=t.length;n<o;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:o,rowGroupColsSvc:s}=this.beans;if(!o.isPivotMode())return;if(!(s!=null&&s.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,o=this.rootNode,s=0){let r=s;if(!o)return r;const i=o===this.rootNode;if(i||e(o,r++),o.hasChildren()&&!o.footer){const a=n(o);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,o,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,o,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),D$(o)})}doGrouping(e){var s;const t=this.rootNode,n=this.beans.groupStage,o=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(o||e.rowDataUpdated)&&((s=this.beans.colFilter)==null||s.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,jB(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var o,s;const t=(o=this.nodeManager)==null?void 0:o.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(j0)===0?(s=this.beans.groupStage)==null?void 0:s.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:o}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const s=[],r=[],i=new Ny;for(const{rowDataTransaction:l,callback:c}of o??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);s.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),s.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:s}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var s;const t=this.nodeManager;if(!t)return null;(s=this.beans.valueCache)==null||s.onDataChanged(),this.rowNodesCountReady=!0;const n=new Ny,o=t.updateRowData(e,n);return this.commitTransactions(n),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const s of o)s.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const o=t.sibling;o==null||o.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},T$=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let o=0,s=n.length;o<s;++o){const r=n[o];r.data&&e.push(r),r.group&&T$(e,r)}};function ZCe(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function XCe(e,t){const n=wl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function JCe(e){var t;return((t=wl(e))==null?void 0:t.isEmpty())??!0}function QCe(e,t){var n;(n=wl(e))==null||n.forEachLeafNode(t)}function ebe(e,t){var n;(n=wl(e))==null||n.forEachNodeAfterFilter(t)}function tbe(e,t){var n;(n=wl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function nbe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=wl(e))==null?void 0:n.updateRowData(t)})}function obe(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=wl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function sbe(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=wl(e))==null?void 0:t.flushAsyncTransactions()})}function rbe(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var I$={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[YCe,zCe],dependsOn:[LB]},ibe={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:ZCe,refreshClientSideRowModel:XCe,isRowDataEmpty:JCe,forEachLeafNode:QCe,forEachNodeAfterFilter:ebe,forEachNodeAfterFilterAndSort:tbe,applyTransaction:nbe,applyTransactionAsync:obe,flushAsyncTransactions:sbe,getBestCostNodeSelection:rbe,resetRowHeights:_$,onRowHeightChanged:E$},dependsOn:[OCe,MCe]},abe=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:o,skipRowGroups:s,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:s,columnKeys:o,exportRowNumbers:r});return[this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,o){var p;const s=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,u=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&cae(this.gos,o);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||s(Pt(this.gos,{node:o})))return;const f=e.onNewBodyRow(o);if(n.forEach((g,v)=>{f.onColumn(g,v,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Pt(this.gos,{node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const o=new C2,{colGroupSvc:s}=this.beans,r=s?s.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const o=n.onNewHeaderRow();t.forEach((s,r)=>{o.onColumn(s,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",o),n}}processRows(e,t){return n=>{var c;const o=this.rowModel,s=ro(this.gos),r=Sd(this.gos),i=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>o.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())s?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?o.forEachNode(a):s||r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const o=t.getSortOptions(),s=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(o,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):s(r.parent,i.parent):r.level>i.level?s(r.parent,i):s(r,i.parent)};e.sort(s)}processPinnedBottomRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",o),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:o=!1,columnKeys:s}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>pa(h)?!1:!ga(h)||o;if(s!=null&&s.length)return r.getColsForKeys(s).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!y0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const o=[];for(const s of e){const r=s;if(r.getChildren)for(const i of r.getChildren()??[])o.push(i)}e.length>0&&io(e[0])&&this.doAddHeaderHeader(t,e,n),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,n)}doAddHeaderHeader(e,t,n){const o=e.onNewHeaderGroupingRow();let s=0;for(const r of t){const i=r;let a;n?a=n(Pt(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Tn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,c)}}},lbe={moduleName:"SharedExport",version:ut,beans:[abe]},x$=`\r
|
|
260
|
-
`,cbe=class extends Vve{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,x$),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=x$),this.isFirstLine=!1}},ube=class extends Lve{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Bve(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new cbe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function dbe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function hbe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var fbe={moduleName:"CsvExport",version:ut,beans:[ube],apiFunctions:{getDataAsCsv:dbe,exportDataAsCsv:hbe},dependsOn:[lbe]},pbe=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:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new pl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Bn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new pl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},gbe=2,mbe=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 o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new pbe(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()&&(ll(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=gbe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},vbe=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 pl(e);this.rootNode=t,t.level=-1,this.rowHeight=Rc(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=Rc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Yf(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;_d(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Rc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new mbe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ybe(e){var t;(t=Wy(e))==null||t.refreshCache()}function wbe(e){var t;(t=Wy(e))==null||t.purgeCache()}function Cbe(e){var t;return(t=Wy(e))==null?void 0:t.getRowCount()}var bbe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=uae(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Lo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Gr(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){ll(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){ll(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Sbe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[vbe,bbe]},Ebe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:ybe,purgeInfiniteCache:wbe,getInfiniteRowCount:Cbe},dependsOn:[Sbe,NCe]},_be="↑",Rbe="↓",Dbe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Tbe=class extends bn{constructor(){super(Dbe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=_be+s:i.textContent=Rbe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),No(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:No(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Ibe=".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}",xbe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Fbe=class extends bn{constructor(){super(xbe),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Ibe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=ao({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Bn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:No(o),!0}},Pbe=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"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Fhe(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 kbe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Abe={moduleName:"HighlightChanges",version:ut,beans:[Pbe],userComponents:{agAnimateShowChangeCellRenderer:Tbe,agAnimateSlideCellRenderer:Fbe},apiFunctions:{flashCells:kbe}};function Obe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Mbe(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function F$(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Nbe(e)),e.version=ut,e}function Nbe(e){return e.cellSelection=Lbe(e,"rangeSelection"),e}function Lbe(e,t){if(e&&typeof e=="object")return e[t]}var Vbe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Lo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Lo(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=Lo(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=ro(e);const o=F$(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=F$(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Ove(fy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const O=!(o!=null&&o.has(D))&&!!(F||t==="api");return h||(h=O),O},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:D,sort:F},O)=>{const k=g(D);k.sort=F,k.sortIndex=O})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((D,F)=>{const O=g(D);O.rowGroup=!0,O.rowGroupIndex=F})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(b||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,F)=>{const O=g(D);O.pivot=!0,O.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!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 E=f("columnVisibility",c);if(E)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(E||!n)&&(v.hide=null);const I=f("columnSizing",u);if(I)for(const{colId:D,flex:F,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const k=g(D);k.flex=F??null,k.width=O}(I||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,P=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),M=P?T.map(D=>g(D)):Object.values(p);(M.length||h)&&(this.columnStates=M,Ur(this.beans,{state:M,applyOrder:P,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Ur(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Mve(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ha(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Yf(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Yf(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")}},Bbe={moduleName:"GridState",version:ut,beans:[Vbe],apiFunctions:{getState:Obe,setState:Mbe}};function $be(e){return e.rowModel.isLastRowIndexKnown()}function Hbe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Gbe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Ube(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Wbe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function zbe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function jbe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Kbe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function qbe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ybe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Zbe=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 o=Math.max(Rc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Lo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Pp="paginationPageSizeSelector",Xbe={tag:"span",cls:"ag-paging-page-size"},Jbe=class extends bn{constructor(){super(Xbe),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(Pp,()=>{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(){No(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(Pp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(Pp)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Pp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(dl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new $0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Pp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Qbe={selector:"AG-PAGE-SIZE-SELECTOR",component:Jbe},eSe=".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}",tSe=class extends HV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(eSe)}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(),[Qbe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Zue(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}Yue(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}):Nve(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){uie(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},nSe={selector:"AG-PAGINATION",component:tSe},oSe=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 nSe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},sSe={moduleName:"Pagination",version:ut,beans:[oSe,Zbe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:$be,paginationGetPageSize:Hbe,paginationGetCurrentPage:Gbe,paginationGetTotalPages:Ube,paginationGetRowCount:Wbe,paginationGoToNextPage:zbe,paginationGoToPreviousPage:jbe,paginationGoToFirstPage:Kbe,paginationGoToLastPage:qbe,paginationGoToPage:Ybe},dependsOn:[zy]};function rSe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function P$(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&P$(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function iSe(e,t){return e.rowModel.getRowNode(t)}function aSe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function lSe(e){return e.rowRenderer.getRenderedNodes()}function cSe(e,t,n){e.rowModel.forEachNode(t,n)}function uSe(e){return e.rowRenderer.firstRenderedRow}function dSe(e){return e.rowRenderer.lastRenderedRow}function hSe(e,t){return e.rowModel.getRow(t)}function fSe(e){return e.rowModel.getRowCount()}var pSe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:rSe,setRowNodeExpanded:P$,getRowNode:iSe,addRenderedRowListener:aSe,getRenderedNodes:lSe,forEachNode:cSe,getFirstDisplayedRowIndex:uSe,getLastDisplayedRowIndex:dSe,getDisplayedRowAtIndex:hSe,getDisplayedRowCount:fSe}},gSe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Iwe,getHorizontalPixelRange:xwe,ensureColumnVisible:h$,ensureIndexVisible:f$,ensureNodeVisible:Fwe}};function mSe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function vSe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function ySe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function wSe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function CSe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function bSe(e){return{rowHeight:Rc(e),headerHeight:yp(e)}}function SSe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(gp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=L_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!V_(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(gp(c))}}return[...o,...n]}var ESe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:mSe,refreshCells:vSe,refreshHeader:ySe,isAnimationFrameQueueEmpty:wSe,flushAllAnimationFrames:CSe,getSizesForCurrentTheme:bSe,getCellRendererInstances:SSe}};function _Se(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function k$({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function RSe(e,t){var n;t&&typeof t=="object"?k$(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var DSe=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 o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&ro(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Td(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=A$(this.beans),i=u=>n.leftCols.some(d=>hp(d,u)),a=u=>n.rightCols.some(d=>hp(d,u)),l=e.colKeys.filter(u=>!pa(u)&&!ga(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),C=r??b;for(;w!==0;){w=0;const _=[];for(const E of o){if(!E||Eae(E))continue;const I=f.getCol(E);if(!I||v.has(I))continue;const T=p.getPreferredWidthForColumn(I,b);if(T>0){const P=S[I.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const M=TSe(I,T,P);I.setActualWidth(M,u),v.add(I),w++}_.push(I)}_.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Mc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=A$(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=fa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=w.getActualWidth();return(b==null||_>=b)&&(C==null||_<=C)}))return;const l=[],c=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>hp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Gr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof S=="number"&&C<S?v.setActualWidth(S,t,!0):typeof b=="number"&&C>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-fa(c);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/fa(l);let S=v;for(let b=l.length-1;b>=0;b--){const C=l[b],_=s==null?void 0:s[C.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),I=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=C.getMinWidth(),P=C.getMaxWidth(),M=typeof E=="number"&&E>T?E:T,D=typeof I=="number"&&I<P?I:P;let F=Math.round(C.getActualWidth()*w);F<M?(F=M,h(C),d=!1):F>D?(F=D,h(C),d=!1):b===0&&(F=S),C.setActualWidth(F,t,!0),S-=F}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Td(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function TSe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function A$({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ep(n.eGridBody)-s}var ISe={moduleName:"ColumnAutoSize",version:ut,beans:[DSe],apiFunctions:{sizeColumnsToFit:_Se,autoSizeColumns:k$,autoSizeAllColumns:RSe},dependsOn:[sB]},xSe=".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 FSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function PSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function kSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function ASe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function OSe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var MSe={moduleName:"PinnedRow",version:ut,beans:[kde],css:[xSe],apiFunctions:{getPinnedTopRowCount:FSe,getPinnedBottomRowCount:PSe,getPinnedTopRow:kSe,getPinnedBottomRow:ASe,forEachPinnedRow:OSe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},NSe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},LSe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,_)=>{p=C,g=null,v=_},S=C=>{const _=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!_){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,r.getValue(t,C));return}const E=r.getValue(t,C);if(f){const I=Pt(n,{valueA:v,nodeA:p,valueB:E,nodeB:C,column:t,colDef:a});if(!h(I)){w(C,E);return}}else if(d?!d(v,E):v!==E){w(C,E);return}if(!g){const I=l==null?void 0:l.get(p);(I==null?void 0:I.firstNode)===p?(I.reset(),g=I):g=new NSe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,C=>{(!i||i.isRowInPage(C.rowIndex))&&S(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},VSe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Lo(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 LSe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},BSe=class extends Bd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Kv(e,t.rowIndex)}setAriaRowSpan(){gie(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(Ay(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}},$Se=class extends Uy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new BSe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},HSe=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),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new $Se(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},GSe={moduleName:"CellSpan",version:ut,beans:[VSe,HSe]},USe=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,o=n.cellClassRules,s=this.getCellClassParams(e,n);M_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},WSe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){M_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new USe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},zSe={moduleName:"CellStyle",version:ut,beans:[WSe]},jSe={moduleName:"RowStyle",version:ut,beans:[kme]};function KSe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var qSe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},YSe="ag-column-hover",ZSe=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 o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(YSe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new qSe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},XSe={moduleName:"ColumnHover",version:ut,beans:[ZSe],apiFunctions:{isColumnHovered:KSe}},JSe=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 r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!$y.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{$y.has(i)&&t(i,a)},o=(i,a)=>{$y.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function QSe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function eEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function tEe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function nEe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var oEe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:QSe,addGlobalListener:tEe,removeEventListener:eEe,removeGlobalListener:nEe},beans:[JSe]},sEe={moduleName:"Locale",version:ut,beans:[Ave]},rEe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Lo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=cl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Ec(o),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const b=Io(i),C=!(b!=null&&b.contains(t)),_=w==0;if(C||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const c=il(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},iEe={moduleName:"RowAutoHeight",version:ut,beans:[rEe]},aEe={moduleName:"AllCommunity",version:ut,dependsOn:[I$,fbe,Ebe,Xve,aCe,lCe,cCe,uCe,dCe,hCe,fCe,iCe,Qye,ewe,twe,Jye,owe,swe,Bbe,VCe,sSe,lB,pSe,gSe,ESe,ISe,jhe,MSe,ICe,pve,zSe,XSe,jSe,oEe,vve,Abe,c$,sEe,iEe,zhe,ibe,GSe]};let O$=!1;O$||(Qie.registerModules([aEe,I$]),O$=!0);class lEe{constructor(t,n){no(this,"gridApi",null);no(this,"container");no(this,"config");no(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=xve(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cEe=pB.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"),uEe=st({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null);bS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=V(null),a=q(()=>({width:"100%",height:o.height||"500px"})),l=q(()=>({...o,theme:cEe}));function c(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new lEe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return tt(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),qn(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:r,style:cn(a.value),class:te(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function Wd(e){return fL(e)}const dEe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Wd(gc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>qf.fromType(n))],Xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},hEe=()=>({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:jv(yee),suppressMovable:!0}),M$="blank",fEe=[M$,"__checkboxSelection","options"],pEe=["uiColumnResized","uiColumnMoved","api"],gEe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},N$=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,mEe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=$h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=V([]),a=hEe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(x=>{const{field:$,hide:W,width:Q,pinned:ae}=x;p.push([$,W])});const g=new Map(p),v=dEe(),w=qf.fromType(gEe),S=!!f,C=((d==null?void 0:d.map(x=>{var $;return{headerName:x.name,field:`metric_${x.id}`,editable:(($=x==null?void 0:x.auth_permission)==null?void 0:$.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:S?!g.get(`metric_${x.id}`):!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:jv(gc),headerComponentParams:()=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"})}}))||[]).map(x=>qf.fromType(x)),_=[a,...v,...C,w],E=[],I=[],T=[];for(const x of _)x.pinned==="left"?E.push(x):x.pinned==="right"||x.field===M$?I.push(x):T.push(x);if(!f||f.length===0){i.value=_;return}const P=new Map(f.map(x=>[x.field,x])),M=new Map(T.map(x=>[x.field,x])),D=[];for(const x of f)if(x.field&&M.has(x.field)){const $=M.get(x.field);D.push({...N$($,x),hide:x.hide}),M.delete(x.field)}const F=Array.from(M.values()),O=[...D,...F].map(x=>({...x,lockPinned:!0})),k=x=>N$(x,P.get(x.field));i.value=[...E.map(k),...O,...I.map(k)]};tt(e,d=>c(d),{immediate:!0});const u=xr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!pEe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!fEe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},li);return HR(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},vEe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},yEe=e=>{var F,O,k;const{showMessage:t,showErrorNetMessage:n}=oa(),o=oo(),s={domainApi:vEe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(k=(O=(F=o==null?void 0:o.appContext)==null?void 0:F.config)==null?void 0:O.globalProperties)==null?void 0:k.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new FO(r,s);i.on("call-api",x=>{x.success?t(x.apiCode,"success"):n(x)});const a=ds({}),l=V([]),c=V(!1),u=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=H7(),v=x=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:x}),w=50,S=async(x,$,W)=>{if(!x.length)return[];const Q=t8(x,$);return(await Promise.all(Q.map(W))).flat()},b=async x=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:x})).data.map(W=>[W==null?void 0:W.id,W.permission])}catch($){return console.error("Failed to fetch item permissions chunk:",$),[]}},C=async(x,$)=>{try{const W=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:x,per_page:x.length*$.length,metric_ids:$}),Q=W.data.map(ee=>{const X=new Map(ee.item_metrics.map(z=>[z.metric_id,{value:z.value,auth_permission:z==null?void 0:z.auth_permission}])),N=Object.fromEntries($.map(z=>[z,X.get(z)??null]));return[ee==null?void 0:ee.id,N]}),ae=new Set(W.data.map(ee=>ee==null?void 0:ee.id));for(const ee of x)if(!ae.has(ee)){const X=Object.fromEntries($.map(N=>[N,{value:null,auth_permission:void 0}]));Q.push([ee,X])}return Q}catch(W){return console.error("Failed to fetch a chunk of metric values:",W),x.map(ae=>[ae,Object.fromEntries($.map(ee=>[ee,void 0]))])}},_=async x=>{try{const $=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:x,per_page:x.length}),W=$.data.flatMap(Q=>Q.assignees);return g(W),$.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch($){return console.error("Failed to fetch a chunk of assigned users:",$),[]}},E=async x=>{if(!x.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const $=await S(x,w,b);return Object.fromEntries($)}catch($){return console.error("Failed to fetch item permissions:",$),{}}},I=async(x,$)=>!x.length||!$.length?{}:(p=p.then(async()=>{try{const ae=[];let ee=0;for(let N=0;N<$.length;N+=5){ee++;const z=$.slice(N,N+5),ne=[];for(let ve=0;ve<z.length;ve++){const we=z[ve],re=await S(x,w,U=>C(U,[we]));ne.push(re),await new Promise(U=>setTimeout(U,500))}ae.push(...ne);const pe=N+5>=$.length}const X={};for(const N of ae.flat()){const[z,ne]=N;X[z]||(X[z]={}),Object.assign(X[z],ne)}return X}catch(W){return console.error("Failed to fetch metric values:",W),{}}}),p),T=async x=>{if(!x.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const $=await S(x,w,_);return Object.fromEntries($)}catch($){return console.error("Failed to fetch assigned users:",$),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async x=>{const{cursor:$,offset:W,size:Q,searchQuery:ae}=x;let ee=[];c.value=!0,u.value=null;try{const X=await i.getAllItem_cursor({...x,cursor:$||void 0,offset:W||void 0,pageSize:Q||f.value,...v(ae),sortBy:x.sort_by});return l.value=X.data,d.value=X.meta,h.value=X.meta.current_page||0,ee=X.data.map(N=>N==null?void 0:N.id),X}catch(X){throw u.value=X,console.error("Failed to fetch items (cursor):",X),X}finally{const X=async()=>{try{const[N,z]=await Promise.all([T(ee),E(ee)]);e.value.updateItemData({assignees:N,permission:z},ee);const ne=await I(ee,e.value.metricIds);e.value.setMetricValues(ne,new Set(ee),e.value.metricIds)}catch(N){console.error("Post-fetch processing failed:",N)}};c.value=!1,setTimeout(X)}},getAssignableStatus:async x=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:x})}catch($){throw console.error("Failed to fetch assignable status:",$),$}},getMetricList:async x=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:x})}catch($){throw console.error("Failed to fetch metric list:",$),$}},getMetricValues:I,getAssignedUsers:T}};function wEe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=I7((o.assignees[c]||[]).map(rP));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function CEe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function bEe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=V(!0),a=V(!0),l=V(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=CEe(r,e.perPage,()=>o.value,C=>{i.value=C},C=>{a.value=C});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=xr(v=>{d(v)},li),p=()=>{s.value},g=V(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const SEe={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."]}}},EEe=e=>{var t;return(t=Object.entries(SEe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},_Ee={key:1},REe=Ct(st({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=V(null),s=e,r=()=>{o.value&&o.value.show()},i=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:c}=Zn(!1,{}),u=V(!1),d=async()=>{u.value=!0;const D=s.workspaceId,F=s.entityId;if(!D||!F||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(D,F))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async D=>{var k,x,$;const F=new FormData,O=((k=D.name.split(".").pop())==null?void 0:k.toString())||"";if(F.append("file",D),F.append("format",O),F.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,F),g()}catch(W){throw console.error("Error uploading file:",W),v((($=(x=W.response)==null?void 0:x.data)==null?void 0:$.message)||"An unknown error occurred during file upload."),W}},g=()=>{a.value="success"},v=D=>{i.value=D,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var D;E(),(D=o.value)==null||D.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=V(null),E=()=>{var D;(D=_.value)==null||D.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},I=yn("switchInstance"),T=()=>{I?I("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1})},P=(D,F)=>new File([D],F,{type:D.type});let M;return Qt(()=>{const D=sessionStorage.getItem("BASE_URL");M=KE({target:window,allowedOrigins:[D||"https://app.arbocollab.com"],onMessage:(F,O)=>{var x;if(F.type!=="TOOLBOX_EXPORT_DATA")return;const k=P(F.payload.file,F.payload.fileName);(x=_.value)==null||x.setFile(k)},onInvalidMessage:(F,O,k)=>{console.warn("Rejected postMessage:",O,k.origin)}})}),qn(()=>{M==null||M()}),(D,F)=>(K(),Ue(H(KS),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},tu({default:he(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ue(sL,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",_Ee,[me("div",{class:te(D.$style["step-section"])},[me("span",{class:te(D.$style["step-title"])},"Step 1: Download current data",2),me("span",{class:te(D.$style["step-description"])},[...F[1]||(F[1]=[Qe(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),me("br",null,null,-1),me("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),me("div",{class:te(D.$style["actions-section"])},[ue(H(at),{class:te(D.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:he(()=>[ue(H(lt),{src:"Download"})]),default:he(()=>[F[2]||(F[2]=Qe(" Download file ",-1))]),_:1},8,["class","disabled"]),ue(H(at),{class:te(D.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:T},{default:he(()=>[...F[3]||(F[3]=[Qe(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),me("div",{class:te(D.$style["step-section"])},[me("span",{class:te(D.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(_M),{modelValue:l.value,"onUpdate:modelValue":F[0]||(F[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),me("div",{class:te(D.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(rL)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"secondary",onClick:S},{default:he(()=>[...F[4]||(F[4]=[Qe(" Cancel ",-1)])]),_:1}),ue(H(at),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:he(()=>[...F[5]||(F[5]=[Qe(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:f},{default:he(()=>[...F[6]||(F[6]=[Qe(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:E},{default:he(()=>[...F[7]||(F[7]=[Qe(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ji92_1","step-title":"_step-title_1ji92_12","step-title-2":"_step-title-2_1ji92_18","step-description":"_step-description_1ji92_24","date-format-guide":"_date-format-guide_1ji92_29","import-error":"_import-error_1ji92_40","drop-area":"_drop-area_1ji92_50","is-dragging":"_is-dragging_1ji92_50","drop-area-content":"_drop-area-content_1ji92_53",browse:"_browse_1ji92_62","download-sample-btn":"_download-sample-btn_1ji92_66","actions-section":"_actions-section_1ji92_70"}}]]),DEe={class:"visual-btn-visual"},TEe={class:"visual-btn--label"},IEe={key:0,class:"visual-btn--description"},xEe={key:1,class:"visual-btn--description"},L$=Ct(st({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ie("div",{class:te(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[me("div",DEe,[Dt(r.$slots,"visual",{},()=>[i[0]||(i[0]=AU('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-db9bdf1b><g clip-path="url(#clip0_4824_13082)" data-v-db9bdf1b><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-db9bdf1b></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-db9bdf1b></path></g><defs data-v-db9bdf1b><clipPath id="clip0_4824_13082" data-v-db9bdf1b><rect width="41.1429" height="36" fill="white" data-v-db9bdf1b></rect></clipPath></defs></svg>',1))],!0)]),me("div",TEe,ht(n.label),1),n.disabled?(K(),ie("div",IEe," Coming soon ")):(K(),ie("div",xEe,ht(n.description),1))],2))}}),[["__scopeId","data-v-db9bdf1b"]]),kp="xlsx_toolbox",FEe="TOOLBOX_EXPORT_DATA",PEe="https://app.arbocollab.com",kEe=e=>{const t=yn("switchInstance",void 0),n=i=>{const{source:a,template:l}=i??{};console.log("Opening toolbox with payload:",i);const c={showLoad:!1};if(t?t(kp,"",c):window.appManager.switchInstance(kp,"",c),!l)throw new Error("template file is missing");setTimeout(()=>{const u=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:load",payload:{source:a,template:l}},u)},1e3)},o=(i,a)=>{console.log(" sendBackErrorFile",{file:i,fileName:a});const l={showLoad:!1};if(t?t(kp,"",l):window.appManager.switchInstance(kp,"",l),!i)throw new Error("Error file is missing");setTimeout(()=>{const c=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:edit",payload:{file:i}},c)},1e3)};let s;const r=i=>{var a;if(console.log("Received postMessage event:",i),((a=i.data)==null?void 0:a.type)===FEe){const{file:l,fileName:c}=i.data.payload;e(new File([l],c,{type:l.type}),c),window.appManager.hide(kp)}};return Qt(()=>{s=KE({target:window,allowedOrigins:[sessionStorage.getItem("BASE_URL")||PEe],onMessage:i=>{r({data:i})},onInvalidMessage:(i,a,l)=>{console.warn("Rejected postMessage:",a,l.origin)}}),window.addEventListener("message",r)}),qn(()=>s==null?void 0:s()),{openToolbox:n,sendBackErrorFile:o}},AEe={class:"header-name"},OEe={class:"modal-body"},MEe={class:"description"},NEe={key:0,class:"error-message"},LEe={class:"dynamic"},VEe={key:1,class:"choose-method-container"},BEe={key:2,class:"select-status-container"},$Ee={key:3,class:"result-container"},HEe={key:4,class:"result-container"},GEe={key:2},V$="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",UEe=20,WEe=Ct(st({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Yt,s=q(()=>[1,2].includes(f.value)),r=q(()=>dP()),i=q(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=Zn(!1,l),d=1,h=V(),f=V(d),p=V(null),g=V(null),v=V(null),w=V(void 0),S=V(null),b=q(()=>i.value[f.value]),C=V(),_=()=>{var ee;p.value=null,f.value=d,g.value=null,v.value=null,E.value=null,S.value=null,(ee=C.value)==null||ee.clear(),w.value=void 0};tt([g,v],([ee,X])=>{f.value===1&&ee&&X&&(f.value=2)});const E=V(null),I=ee=>{console.error(ee),E.value=ee},T=async(ee,X)=>{var z,ne,pe;if(W.value=!0,!u.value||!l.workspaceId||!l.entityId){console.error("API services not available");return}const N=new FormData;N.append("file",ee),N.append("format",((z=X??ee.name)==null?void 0:z.split(".").pop())??ee.name.split(".").pop()??""),N.append("entity_id",l.entityId),N.append("template_flow_status_id",p.value??"");try{await u.value.addNewSceneViaImportFile(l.workspaceId,l.entityId,N),f.value=3,c("import-success")}catch(ve){console.error("Error uploading file:",ve),I(((pe=(ne=ve.response)==null?void 0:ne.data)==null?void 0:pe.message)||"An unknown error occurred during file upload."),f.value=4}finally{W.value=!1}},{openToolbox:P,sendBackErrorFile:M}=kEe((ee,X)=>{v.value=ee,w.value=X??ee.name,f.value=2}),D=async()=>{const ee=await O();try{P({template:ee})}catch(X){console.error("Error opening toolbox:",X),oa().showErrorNetMessage("Failed to open toolbox.")}},F=V(!1),O=async()=>{F.value=!0;const ee=l.workspaceId,X=l.entityId;if(!ee||!X||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const N=await u.value.downloadTemplate(ee,X,!1);if(!N)throw new Error("No response from downloadTemplate API");return N}catch(N){return console.error("Error downloading template:",N),Promise.reject(N)}finally{F.value=!1}},k=ee=>{const X=V$.includes(ee.type);return X||(console.error("Invalid file type:",ee.type),oa().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),X},x=async()=>{const ee=document.createElement("input");ee.type="file",ee.accept=V$,ee.onchange=async()=>{var N;const X=(N=ee.files)==null?void 0:N[0];if(X){if(!k(X)){_();return}g.value=rb(X);try{const z=await O();if(!z){oa().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}P({source:X,template:z})}catch(z){console.error("Error opening toolbox:",z),oa().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},ee.click()},$=async ee=>{var X;if(!((X=u.value)!=null&&X.getAssignableStatuses)){console.error("API services not available");return}return u.value.getAssignableStatuses(l.workspaceId,{entity_id:l.entityId,name_like:ee.name_like,page:ee.page,per_page:UEe})},W=V(!1),Q=()=>{p.value=null,v.value&&w.value&&M(v.value,w.value)},ae=()=>{p.value&&v.value&&(W.value=!0,T(v.value,w.value).finally(()=>{W.value=!1}))};return t({open:()=>{var ee;return(ee=h.value)==null?void 0:ee.show()},close:()=>{var ee;return(ee=h.value)==null?void 0:ee.hide()}}),(ee,X)=>(K(),Ue(H(KS),Wt({ref_key:"popupRef",ref:h,style:a,onHidden:_},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),tu({header:he(()=>[me("span",AEe,ht(b.value.title),1)]),default:he(()=>[me("div",OEe,[me("div",MEe,ht(b.value.description),1),E.value&&f.value===4?(K(),ie("div",NEe,[X[3]||(X[3]=Qe(" Error code ",-1)),me("span",LEe,ht(E.value),1)])):Xe("",!0),f.value===1?(K(),ie("div",VEe,[ue(L$,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
|
|
260
|
+
`,cbe=class extends Vve{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,x$),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=x$),this.isFirstLine=!1}},ube=class extends Lve{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Bve(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new cbe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function dbe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function hbe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var fbe={moduleName:"CsvExport",version:ut,beans:[ube],apiFunctions:{getDataAsCsv:dbe,exportDataAsCsv:hbe},dependsOn:[lbe]},pbe=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:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new pl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Bn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new pl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},gbe=2,mbe=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 o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new pbe(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()&&(ll(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=gbe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},vbe=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 pl(e);this.rootNode=t,t.level=-1,this.rowHeight=Rc(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=Rc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Yf(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;_d(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Rc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new mbe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ybe(e){var t;(t=Wy(e))==null||t.refreshCache()}function wbe(e){var t;(t=Wy(e))==null||t.purgeCache()}function Cbe(e){var t;return(t=Wy(e))==null?void 0:t.getRowCount()}var bbe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=uae(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Lo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Gr(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){ll(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){ll(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Sbe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[vbe,bbe]},Ebe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:ybe,purgeInfiniteCache:wbe,getInfiniteRowCount:Cbe},dependsOn:[Sbe,NCe]},_be="↑",Rbe="↓",Dbe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Tbe=class extends bn{constructor(){super(Dbe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=_be+s:i.textContent=Rbe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),No(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:No(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Ibe=".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}",xbe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Fbe=class extends bn{constructor(){super(xbe),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Ibe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=ao({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Bn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:No(o),!0}},Pbe=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"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Fhe(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 kbe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Abe={moduleName:"HighlightChanges",version:ut,beans:[Pbe],userComponents:{agAnimateShowChangeCellRenderer:Tbe,agAnimateSlideCellRenderer:Fbe},apiFunctions:{flashCells:kbe}};function Obe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Mbe(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function F$(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Nbe(e)),e.version=ut,e}function Nbe(e){return e.cellSelection=Lbe(e,"rangeSelection"),e}function Lbe(e,t){if(e&&typeof e=="object")return e[t]}var Vbe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Lo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Lo(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=Lo(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=ro(e);const o=F$(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=F$(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Ove(fy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const O=!(o!=null&&o.has(D))&&!!(F||t==="api");return h||(h=O),O},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:D,sort:F},O)=>{const k=g(D);k.sort=F,k.sortIndex=O})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((D,F)=>{const O=g(D);O.rowGroup=!0,O.rowGroupIndex=F})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(b||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,F)=>{const O=g(D);O.pivot=!0,O.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!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 E=f("columnVisibility",c);if(E)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(E||!n)&&(v.hide=null);const I=f("columnSizing",u);if(I)for(const{colId:D,flex:F,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const k=g(D);k.flex=F??null,k.width=O}(I||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,P=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),M=P?T.map(D=>g(D)):Object.values(p);(M.length||h)&&(this.columnStates=M,Ur(this.beans,{state:M,applyOrder:P,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Ur(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Mve(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ha(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Yf(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Yf(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")}},Bbe={moduleName:"GridState",version:ut,beans:[Vbe],apiFunctions:{getState:Obe,setState:Mbe}};function $be(e){return e.rowModel.isLastRowIndexKnown()}function Hbe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Gbe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Ube(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Wbe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function zbe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function jbe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Kbe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function qbe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ybe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Zbe=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 o=Math.max(Rc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Lo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Pp="paginationPageSizeSelector",Xbe={tag:"span",cls:"ag-paging-page-size"},Jbe=class extends bn{constructor(){super(Xbe),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(Pp,()=>{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(){No(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(Pp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(Pp)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Pp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(dl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new $0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Pp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Qbe={selector:"AG-PAGE-SIZE-SELECTOR",component:Jbe},eSe=".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}",tSe=class extends HV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(eSe)}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(),[Qbe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Zue(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}Yue(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}):Nve(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){uie(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},nSe={selector:"AG-PAGINATION",component:tSe},oSe=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 nSe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},sSe={moduleName:"Pagination",version:ut,beans:[oSe,Zbe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:$be,paginationGetPageSize:Hbe,paginationGetCurrentPage:Gbe,paginationGetTotalPages:Ube,paginationGetRowCount:Wbe,paginationGoToNextPage:zbe,paginationGoToPreviousPage:jbe,paginationGoToFirstPage:Kbe,paginationGoToLastPage:qbe,paginationGoToPage:Ybe},dependsOn:[zy]};function rSe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function P$(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&P$(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function iSe(e,t){return e.rowModel.getRowNode(t)}function aSe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function lSe(e){return e.rowRenderer.getRenderedNodes()}function cSe(e,t,n){e.rowModel.forEachNode(t,n)}function uSe(e){return e.rowRenderer.firstRenderedRow}function dSe(e){return e.rowRenderer.lastRenderedRow}function hSe(e,t){return e.rowModel.getRow(t)}function fSe(e){return e.rowModel.getRowCount()}var pSe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:rSe,setRowNodeExpanded:P$,getRowNode:iSe,addRenderedRowListener:aSe,getRenderedNodes:lSe,forEachNode:cSe,getFirstDisplayedRowIndex:uSe,getLastDisplayedRowIndex:dSe,getDisplayedRowAtIndex:hSe,getDisplayedRowCount:fSe}},gSe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Iwe,getHorizontalPixelRange:xwe,ensureColumnVisible:h$,ensureIndexVisible:f$,ensureNodeVisible:Fwe}};function mSe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function vSe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function ySe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function wSe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function CSe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function bSe(e){return{rowHeight:Rc(e),headerHeight:yp(e)}}function SSe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(gp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=L_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!V_(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(gp(c))}}return[...o,...n]}var ESe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:mSe,refreshCells:vSe,refreshHeader:ySe,isAnimationFrameQueueEmpty:wSe,flushAllAnimationFrames:CSe,getSizesForCurrentTheme:bSe,getCellRendererInstances:SSe}};function _Se(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function k$({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function RSe(e,t){var n;t&&typeof t=="object"?k$(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var DSe=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 o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&ro(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Td(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=A$(this.beans),i=u=>n.leftCols.some(d=>hp(d,u)),a=u=>n.rightCols.some(d=>hp(d,u)),l=e.colKeys.filter(u=>!pa(u)&&!ga(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),C=r??b;for(;w!==0;){w=0;const _=[];for(const E of o){if(!E||Eae(E))continue;const I=f.getCol(E);if(!I||v.has(I))continue;const T=p.getPreferredWidthForColumn(I,b);if(T>0){const P=S[I.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const M=TSe(I,T,P);I.setActualWidth(M,u),v.add(I),w++}_.push(I)}_.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Mc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=A$(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=fa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=w.getActualWidth();return(b==null||_>=b)&&(C==null||_<=C)}))return;const l=[],c=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>hp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Gr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof S=="number"&&C<S?v.setActualWidth(S,t,!0):typeof b=="number"&&C>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-fa(c);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/fa(l);let S=v;for(let b=l.length-1;b>=0;b--){const C=l[b],_=s==null?void 0:s[C.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),I=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=C.getMinWidth(),P=C.getMaxWidth(),M=typeof E=="number"&&E>T?E:T,D=typeof I=="number"&&I<P?I:P;let F=Math.round(C.getActualWidth()*w);F<M?(F=M,h(C),d=!1):F>D?(F=D,h(C),d=!1):b===0&&(F=S),C.setActualWidth(F,t,!0),S-=F}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Td(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function TSe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function A$({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ep(n.eGridBody)-s}var ISe={moduleName:"ColumnAutoSize",version:ut,beans:[DSe],apiFunctions:{sizeColumnsToFit:_Se,autoSizeColumns:k$,autoSizeAllColumns:RSe},dependsOn:[sB]},xSe=".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 FSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function PSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function kSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function ASe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function OSe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var MSe={moduleName:"PinnedRow",version:ut,beans:[kde],css:[xSe],apiFunctions:{getPinnedTopRowCount:FSe,getPinnedBottomRowCount:PSe,getPinnedTopRow:kSe,getPinnedBottomRow:ASe,forEachPinnedRow:OSe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},NSe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},LSe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,_)=>{p=C,g=null,v=_},S=C=>{const _=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!_){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,r.getValue(t,C));return}const E=r.getValue(t,C);if(f){const I=Pt(n,{valueA:v,nodeA:p,valueB:E,nodeB:C,column:t,colDef:a});if(!h(I)){w(C,E);return}}else if(d?!d(v,E):v!==E){w(C,E);return}if(!g){const I=l==null?void 0:l.get(p);(I==null?void 0:I.firstNode)===p?(I.reset(),g=I):g=new NSe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,C=>{(!i||i.isRowInPage(C.rowIndex))&&S(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},VSe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Lo(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 LSe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},BSe=class extends Bd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Kv(e,t.rowIndex)}setAriaRowSpan(){gie(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(Ay(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}},$Se=class extends Uy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new BSe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},HSe=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),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new $Se(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},GSe={moduleName:"CellSpan",version:ut,beans:[VSe,HSe]},USe=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,o=n.cellClassRules,s=this.getCellClassParams(e,n);M_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},WSe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){M_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new USe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},zSe={moduleName:"CellStyle",version:ut,beans:[WSe]},jSe={moduleName:"RowStyle",version:ut,beans:[kme]};function KSe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var qSe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},YSe="ag-column-hover",ZSe=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 o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(YSe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new qSe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},XSe={moduleName:"ColumnHover",version:ut,beans:[ZSe],apiFunctions:{isColumnHovered:KSe}},JSe=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 r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!$y.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{$y.has(i)&&t(i,a)},o=(i,a)=>{$y.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function QSe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function eEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function tEe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function nEe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var oEe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:QSe,addGlobalListener:tEe,removeEventListener:eEe,removeGlobalListener:nEe},beans:[JSe]},sEe={moduleName:"Locale",version:ut,beans:[Ave]},rEe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Lo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=cl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Ec(o),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const b=Io(i),C=!(b!=null&&b.contains(t)),_=w==0;if(C||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const c=il(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},iEe={moduleName:"RowAutoHeight",version:ut,beans:[rEe]},aEe={moduleName:"AllCommunity",version:ut,dependsOn:[I$,fbe,Ebe,Xve,aCe,lCe,cCe,uCe,dCe,hCe,fCe,iCe,Qye,ewe,twe,Jye,owe,swe,Bbe,VCe,sSe,lB,pSe,gSe,ESe,ISe,jhe,MSe,ICe,pve,zSe,XSe,jSe,oEe,vve,Abe,c$,sEe,iEe,zhe,ibe,GSe]};let O$=!1;O$||(Qie.registerModules([aEe,I$]),O$=!0);class lEe{constructor(t,n){no(this,"gridApi",null);no(this,"container");no(this,"config");no(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=xve(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cEe=pB.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"),uEe=st({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null);bS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=V(null),a=q(()=>({width:"100%",height:o.height||"500px"})),l=q(()=>({...o,theme:cEe}));function c(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new lEe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return tt(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),qn(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:r,style:cn(a.value),class:te(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function Wd(e){return fL(e)}const dEe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Wd(gc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>qf.fromType(n))],Xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},hEe=()=>({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:jv(yee),suppressMovable:!0}),M$="blank",fEe=[M$,"__checkboxSelection","options"],pEe=["uiColumnResized","uiColumnMoved","api"],gEe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},N$=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,mEe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=$h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=V([]),a=hEe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(x=>{const{field:$,hide:W,width:Q,pinned:ae}=x;p.push([$,W])});const g=new Map(p),v=dEe(),w=qf.fromType(gEe),S=!!f,C=((d==null?void 0:d.map(x=>{var $;return{headerName:x.name,field:`metric_${x.id}`,editable:(($=x==null?void 0:x.auth_permission)==null?void 0:$.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:S?!g.get(`metric_${x.id}`):!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:jv(gc),headerComponentParams:()=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"})}}))||[]).map(x=>qf.fromType(x)),_=[a,...v,...C,w],E=[],I=[],T=[];for(const x of _)x.pinned==="left"?E.push(x):x.pinned==="right"||x.field===M$?I.push(x):T.push(x);if(!f||f.length===0){i.value=_;return}const P=new Map(f.map(x=>[x.field,x])),M=new Map(T.map(x=>[x.field,x])),D=[];for(const x of f)if(x.field&&M.has(x.field)){const $=M.get(x.field);D.push({...N$($,x),hide:x.hide}),M.delete(x.field)}const F=Array.from(M.values()),O=[...D,...F].map(x=>({...x,lockPinned:!0})),k=x=>N$(x,P.get(x.field));i.value=[...E.map(k),...O,...I.map(k)]};tt(e,d=>c(d),{immediate:!0});const u=xr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!pEe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!fEe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},li);return HR(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},vEe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},yEe=e=>{var F,O,k;const{showMessage:t,showErrorNetMessage:n}=oa(),o=oo(),s={domainApi:vEe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(k=(O=(F=o==null?void 0:o.appContext)==null?void 0:F.config)==null?void 0:O.globalProperties)==null?void 0:k.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new FO(r,s);i.on("call-api",x=>{x.success?t(x.apiCode,"success"):n(x)});const a=ds({}),l=V([]),c=V(!1),u=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=H7(),v=x=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:x}),w=50,S=async(x,$,W)=>{if(!x.length)return[];const Q=t8(x,$);return(await Promise.all(Q.map(W))).flat()},b=async x=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:x})).data.map(W=>[W==null?void 0:W.id,W.permission])}catch($){return console.error("Failed to fetch item permissions chunk:",$),[]}},C=async(x,$)=>{try{const W=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:x,per_page:x.length*$.length,metric_ids:$}),Q=W.data.map(ee=>{const X=new Map(ee.item_metrics.map(z=>[z.metric_id,{value:z.value,auth_permission:z==null?void 0:z.auth_permission}])),N=Object.fromEntries($.map(z=>[z,X.get(z)??null]));return[ee==null?void 0:ee.id,N]}),ae=new Set(W.data.map(ee=>ee==null?void 0:ee.id));for(const ee of x)if(!ae.has(ee)){const X=Object.fromEntries($.map(N=>[N,{value:null,auth_permission:void 0}]));Q.push([ee,X])}return Q}catch(W){return console.error("Failed to fetch a chunk of metric values:",W),x.map(ae=>[ae,Object.fromEntries($.map(ee=>[ee,void 0]))])}},_=async x=>{try{const $=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:x,per_page:x.length}),W=$.data.flatMap(Q=>Q.assignees);return g(W),$.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch($){return console.error("Failed to fetch a chunk of assigned users:",$),[]}},E=async x=>{if(!x.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const $=await S(x,w,b);return Object.fromEntries($)}catch($){return console.error("Failed to fetch item permissions:",$),{}}},I=async(x,$)=>!x.length||!$.length?{}:(p=p.then(async()=>{try{const ae=[];let ee=0;for(let N=0;N<$.length;N+=5){ee++;const z=$.slice(N,N+5),ne=[];for(let ve=0;ve<z.length;ve++){const we=z[ve],re=await S(x,w,U=>C(U,[we]));ne.push(re),await new Promise(U=>setTimeout(U,500))}ae.push(...ne);const pe=N+5>=$.length}const X={};for(const N of ae.flat()){const[z,ne]=N;X[z]||(X[z]={}),Object.assign(X[z],ne)}return X}catch(W){return console.error("Failed to fetch metric values:",W),{}}}),p),T=async x=>{if(!x.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const $=await S(x,w,_);return Object.fromEntries($)}catch($){return console.error("Failed to fetch assigned users:",$),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async x=>{const{cursor:$,offset:W,size:Q,searchQuery:ae}=x;let ee=[];c.value=!0,u.value=null;try{const X=await i.getAllItem_cursor({...x,cursor:$||void 0,offset:W||void 0,pageSize:Q||f.value,...v(ae),sortBy:x.sort_by});return l.value=X.data,d.value=X.meta,h.value=X.meta.current_page||0,ee=X.data.map(N=>N==null?void 0:N.id),X}catch(X){throw u.value=X,console.error("Failed to fetch items (cursor):",X),X}finally{const X=async()=>{try{const[N,z]=await Promise.all([T(ee),E(ee)]);e.value.updateItemData({assignees:N,permission:z},ee);const ne=await I(ee,e.value.metricIds);e.value.setMetricValues(ne,new Set(ee),e.value.metricIds)}catch(N){console.error("Post-fetch processing failed:",N)}};c.value=!1,setTimeout(X)}},getAssignableStatus:async x=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:x})}catch($){throw console.error("Failed to fetch assignable status:",$),$}},getMetricList:async x=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:x})}catch($){throw console.error("Failed to fetch metric list:",$),$}},getMetricValues:I,getAssignedUsers:T}};function wEe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=I7((o.assignees[c]||[]).map(rP));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function CEe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function bEe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=V(!0),a=V(!0),l=V(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=CEe(r,e.perPage,()=>o.value,C=>{i.value=C},C=>{a.value=C});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=xr(v=>{d(v)},li),p=()=>{s.value},g=V(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const SEe={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."]}}},EEe=e=>{var t;return(t=Object.entries(SEe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},_Ee={key:1},REe=Ct(st({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=V(null),s=e,r=()=>{o.value&&o.value.show()},i=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:c}=Zn(!1,{}),u=V(!1),d=async()=>{u.value=!0;const D=s.workspaceId,F=s.entityId;if(!D||!F||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(D,F))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async D=>{var k,x,$;const F=new FormData,O=((k=D.name.split(".").pop())==null?void 0:k.toString())||"";if(F.append("file",D),F.append("format",O),F.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,F),g()}catch(W){throw console.error("Error uploading file:",W),v((($=(x=W.response)==null?void 0:x.data)==null?void 0:$.message)||"An unknown error occurred during file upload."),W}},g=()=>{a.value="success"},v=D=>{i.value=D,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var D;E(),(D=o.value)==null||D.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=V(null),E=()=>{var D;(D=_.value)==null||D.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},I=yn("switchInstance"),T=()=>{I?I("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1})},P=(D,F)=>new File([D],F,{type:D.type});let M;return Qt(()=>{const D=sessionStorage.getItem("BASE_URL");M=KE({target:window,allowedOrigins:[D||"https://app.arbocollab.com"],onMessage:(F,O)=>{var x;if(F.type!=="TOOLBOX_EXPORT_DATA")return;const k=P(F.payload.file,F.payload.fileName);(x=_.value)==null||x.setFile(k)},onInvalidMessage:(F,O,k)=>{console.warn("Rejected postMessage:",O,k.origin)}})}),qn(()=>{M==null||M()}),(D,F)=>(K(),Ue(H(KS),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},tu({default:he(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ue(sL,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",_Ee,[me("div",{class:te(D.$style["step-section"])},[me("span",{class:te(D.$style["step-title"])},"Step 1: Download current data",2),me("span",{class:te(D.$style["step-description"])},[...F[1]||(F[1]=[Qe(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),me("br",null,null,-1),me("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),me("div",{class:te(D.$style["actions-section"])},[ue(H(at),{class:te(D.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:he(()=>[ue(H(lt),{src:"Download"})]),default:he(()=>[F[2]||(F[2]=Qe(" Download file ",-1))]),_:1},8,["class","disabled"]),ue(H(at),{class:te(D.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:T},{default:he(()=>[...F[3]||(F[3]=[Qe(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),me("div",{class:te(D.$style["step-section"])},[me("span",{class:te(D.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(_M),{modelValue:l.value,"onUpdate:modelValue":F[0]||(F[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),me("div",{class:te(D.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(rL)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"secondary",onClick:S},{default:he(()=>[...F[4]||(F[4]=[Qe(" Cancel ",-1)])]),_:1}),ue(H(at),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:he(()=>[...F[5]||(F[5]=[Qe(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:f},{default:he(()=>[...F[6]||(F[6]=[Qe(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:E},{default:he(()=>[...F[7]||(F[7]=[Qe(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ji92_1","step-title":"_step-title_1ji92_12","step-title-2":"_step-title-2_1ji92_18","step-description":"_step-description_1ji92_24","date-format-guide":"_date-format-guide_1ji92_29","import-error":"_import-error_1ji92_40","drop-area":"_drop-area_1ji92_50","is-dragging":"_is-dragging_1ji92_50","drop-area-content":"_drop-area-content_1ji92_53",browse:"_browse_1ji92_62","download-sample-btn":"_download-sample-btn_1ji92_66","actions-section":"_actions-section_1ji92_70"}}]]),DEe={class:"visual-btn-visual"},TEe={class:"visual-btn--label"},IEe={key:0,class:"visual-btn--description"},xEe={key:1,class:"visual-btn--description"},L$=Ct(st({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ie("div",{class:te(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[me("div",DEe,[Dt(r.$slots,"visual",{},()=>[i[0]||(i[0]=AU('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-db9bdf1b><g clip-path="url(#clip0_4824_13082)" data-v-db9bdf1b><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-db9bdf1b></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-db9bdf1b></path></g><defs data-v-db9bdf1b><clipPath id="clip0_4824_13082" data-v-db9bdf1b><rect width="41.1429" height="36" fill="white" data-v-db9bdf1b></rect></clipPath></defs></svg>',1))],!0)]),me("div",TEe,ht(n.label),1),n.disabled?(K(),ie("div",IEe," Coming soon ")):(K(),ie("div",xEe,ht(n.description),1))],2))}}),[["__scopeId","data-v-db9bdf1b"]]),kp="xlsx_toolbox",FEe="TOOLBOX_EXPORT_DATA",PEe="https://app.arbocollab.com",kEe=e=>{const t=yn("switchInstance",void 0),n=i=>{const{source:a,template:l}=i??{},c={showLoad:!1};if(t?t(kp,"",c):window.appManager.switchInstance(kp,"",c),!l)throw new Error("template file is missing");setTimeout(()=>{const u=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:load",payload:{source:a,template:l}},u)},1e3)},o=(i,a)=>{const l={showLoad:!1};if(t?t(kp,"",l):window.appManager.switchInstance(kp,"",l),!i)throw new Error("Error file is missing");setTimeout(()=>{const c=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:edit",payload:{file:i}},c)},1e3)};let s;const r=i=>{var a;if(((a=i.data)==null?void 0:a.type)===FEe){const{file:l,fileName:c}=i.data.payload;e(new File([l],c,{type:l.type}),c),window.appManager.hide(kp)}};return Qt(()=>{s=KE({target:window,allowedOrigins:[sessionStorage.getItem("BASE_URL")||PEe],onMessage:i=>{r({data:i})},onInvalidMessage:(i,a,l)=>{console.warn("Rejected postMessage:",a,l.origin)}}),window.addEventListener("message",r)}),qn(()=>s==null?void 0:s()),{openToolbox:n,sendBackErrorFile:o}},AEe={class:"header-name"},OEe={class:"modal-body"},MEe={class:"description"},NEe={key:0,class:"error-message"},LEe={class:"dynamic"},VEe={key:1,class:"choose-method-container"},BEe={key:2,class:"select-status-container"},$Ee={key:3,class:"result-container"},HEe={key:4,class:"result-container"},GEe={key:2},V$="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",UEe=20,WEe=Ct(st({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Yt,s=q(()=>[1,2].includes(f.value)),r=q(()=>dP()),i=q(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=Zn(!1,l),d=1,h=V(),f=V(d),p=V(null),g=V(null),v=V(null),w=V(void 0),S=V(null),b=q(()=>i.value[f.value]),C=V(),_=()=>{var ee;p.value=null,f.value=d,g.value=null,v.value=null,E.value=null,S.value=null,(ee=C.value)==null||ee.clear(),w.value=void 0};tt([g,v],([ee,X])=>{f.value===1&&ee&&X&&(f.value=2)});const E=V(null),I=ee=>{console.error(ee),E.value=ee},T=async(ee,X)=>{var z,ne,pe;if(W.value=!0,!u.value||!l.workspaceId||!l.entityId){console.error("API services not available");return}const N=new FormData;N.append("file",ee),N.append("format",((z=X??ee.name)==null?void 0:z.split(".").pop())??ee.name.split(".").pop()??""),N.append("entity_id",l.entityId),N.append("template_flow_status_id",p.value??"");try{await u.value.addNewSceneViaImportFile(l.workspaceId,l.entityId,N),f.value=3,c("import-success")}catch(ve){console.error("Error uploading file:",ve),I(((pe=(ne=ve.response)==null?void 0:ne.data)==null?void 0:pe.message)||"An unknown error occurred during file upload."),f.value=4}finally{W.value=!1}},{openToolbox:P,sendBackErrorFile:M}=kEe((ee,X)=>{v.value=ee,w.value=X??ee.name,f.value=2}),D=async()=>{const ee=await O();try{P({template:ee})}catch(X){console.error("Error opening toolbox:",X),oa().showErrorNetMessage("Failed to open toolbox.")}},F=V(!1),O=async()=>{F.value=!0;const ee=l.workspaceId,X=l.entityId;if(!ee||!X||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const N=await u.value.downloadTemplate(ee,X,!1);if(!N)throw new Error("No response from downloadTemplate API");return N}catch(N){return console.error("Error downloading template:",N),Promise.reject(N)}finally{F.value=!1}},k=ee=>{const X=V$.includes(ee.type);return X||(console.error("Invalid file type:",ee.type),oa().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),X},x=async()=>{const ee=document.createElement("input");ee.type="file",ee.accept=V$,ee.onchange=async()=>{var N;const X=(N=ee.files)==null?void 0:N[0];if(X){if(!k(X)){_();return}g.value=rb(X);try{const z=await O();if(!z){oa().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}P({source:X,template:z})}catch(z){console.error("Error opening toolbox:",z),oa().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},ee.click()},$=async ee=>{var X;if(!((X=u.value)!=null&&X.getAssignableStatuses)){console.error("API services not available");return}return u.value.getAssignableStatuses(l.workspaceId,{entity_id:l.entityId,name_like:ee.name_like,page:ee.page,per_page:UEe})},W=V(!1),Q=()=>{p.value=null,v.value&&w.value&&M(v.value,w.value)},ae=()=>{p.value&&v.value&&(W.value=!0,T(v.value,w.value).finally(()=>{W.value=!1}))};return t({open:()=>{var ee;return(ee=h.value)==null?void 0:ee.show()},close:()=>{var ee;return(ee=h.value)==null?void 0:ee.hide()}}),(ee,X)=>(K(),Ue(H(KS),Wt({ref_key:"popupRef",ref:h,style:a,onHidden:_},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),tu({header:he(()=>[me("span",AEe,ht(b.value.title),1)]),default:he(()=>[me("div",OEe,[me("div",MEe,ht(b.value.description),1),E.value&&f.value===4?(K(),ie("div",NEe,[X[3]||(X[3]=Qe(" Error code ",-1)),me("span",LEe,ht(E.value),1)])):Xe("",!0),f.value===1?(K(),ie("div",VEe,[ue(L$,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
|
|
261
261
|
into a table.`,onOnClick:D},{visual:he(()=>[ue(H(Ka),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ue(L$,{label:"Import from file",description:`Create ${r.value} from a CSV or
|
|
262
262
|
Excel file.`,onOnClick:x},{visual:he(()=>[ue(H(Ka),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):f.value===2?(K(),ie("div",BEe,[ue(H(bM),{modelValue:p.value,"onUpdate:modelValue":X[0]||(X[0]=N=>p.value=N),"get-status-func":$,"workspace-id":l.workspaceId,id:l.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:C},null,8,["modelValue","workspace-id","id"])])):f.value===3?(K(),ie("div",$Ee,[ue(H(Ka),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(K(),ie("div",HEe,[ue(H(Ka),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[f.value===2||f.value===4||f.value===3?{name:"footer",fn:he(()=>[f.value===4?(K(),Ue(H(at),{key:0,variant:"secondary",onClick:X[1]||(X[1]=()=>{var N;_(),(N=h.value)==null||N.hide()})},{default:he(()=>[...X[4]||(X[4]=[Qe(" Close ",-1)])]),_:1})):f.value===3?(K(),Ue(H(at),{key:1,variant:"secondary",onClick:X[2]||(X[2]=()=>{var N;_(),(N=h.value)==null||N.hide()})},{default:he(()=>[...X[5]||(X[5]=[Qe(" Got it ",-1)])]),_:1})):Xe("",!0),f.value===2?Ke((K(),ie("div",GEe,[ue(H(at),{loading:W.value,disabled:W.value||!p.value,onClick:ae},{default:he(()=>[...X[6]||(X[6]=[Qe(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[H(o),{content:W.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Xe("",!0),f.value===4?(K(),Ue(H(at),{key:3,onClick:Q},{default:he(()=>[...X[7]||(X[7]=[Qe(" Try Again ",-1)])]),_:1})):Xe("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-474db5c4"]]),zEe=Ct(st({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ts,o=vS(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=ns(o),a=Yt,l=ko,c=V(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=V(""),h=q(()=>{var Ze;const Ae=((Ze=i.value)==null?void 0:Ze.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Ae},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",type:"text",hide:!Ae,id:"overwrite_scenes_option"}]}),f=e;qf.initialize({wrapVueCellRenderer:jv,wrapVueCellEditor:fL});const p=mf(),{switchInstanceFunc:g}=ns(p);Qt(()=>{const Ae=oo();g.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ze=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ze.postMessage("Focusable elements updated")},7e3)})});const v=V(null),w=V([]),S=uv(),{rowCount:b}=ns(S),C=V(!1),_=V(""),E=V(),I=EA(),{metricList:T}=ns(I),P=V(""),M=V(!1),D=V(new Set),F=V(new Map),{apiServices:O}=Zn(!1,f),{columnDefs:k,checkboxColumn:x,saveColumnConfig:$}=mEe(T,f.entityId,v),W=V();tt(()=>k,()=>{var Ae;(Ae=W.value)==null||Ae.updateColumnDefs(k.value)},{deep:!0});const Q=(Ae,Ze)=>{$(Ae,Ze)},{updateRowData:ae,setMetricValues:ee}=wEe(v),X=q(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(Ve.value||{}).length==1&&Object.keys(Ve.value)[0]=="preflight_status")&&Object.keys(Ve.value||{}).length>0})),N=q(Tm),z=q(()=>k.value.filter(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.replace("metric_",""))||""}));Jr("timezone",N);const ne=q(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:z.value,updateItemData:ae,setMetricValues:ee})),{fetchItems:pe,getMetricList:ve,cusorMap:we,getMetricValues:re}=yEe(ne),U=q(()=>{if(!v.value)return!1;const Ae=v.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),ge=q(()=>{var Ae;return((Ae=c.value)==null?void 0:Ae.name)||"Items"}),oe=Ae=>{setTimeout(()=>{vt(()=>{var Ze,Kt;v.value&&(Ae?(Ze=v.value)==null||Ze.showNoRowsOverlay():(Kt=v.value)==null||Kt.hideOverlay())})},500)},Re=(Ae,Ze)=>{var Kt;b.value.total=Ae.meta.total??0,(Kt=Ae.meta.next)!=null&&Kt.cursor&&(we[Ze+1]=Ae.meta.next.cursor),P.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?oe(!0):oe(!1)},G=EM(),{setDefaultSort:Y}=G,de=V(null),{sortingAPIConfiguration:ke,isSortingRunning:xe}=ns(G),Ve=V({preflight_status:"1"}),ye=q(()=>({...Ve.value,search:_.value}));Jr("filterParams",ye);const L=V([]),j=async({page:Ae,pageSize:Ze,filterText:Kt})=>{var $c,Ea,In;($c=v.value)==null||$c.hideOverlay();const hn=we[Ae],Ni=!hn&&Ae>1?(Ae-1)*Ze:void 0,as=ke.value;as.length>0&&(xe.value=!0);try{const zr={cursor:hn,size:Ze,searchQuery:Kt,offset:Ni,sort_by:as,...Ve.value},Ss=await pe(zr);if(!Ss)return{rows:[],total:0};const Ap=(In=(Ea=Ss.meta)==null?void 0:Ea.extra)==null?void 0:In.default_sort;Ap&&Y(Ap);const Yd=(Op=>{const Zd=Op.data.map(yr=>aP(yr,N.value));return Zd.forEach(yr=>{D.value.add(String(yr.id)),F.value.set(String(yr.id),{})}),Zd})(Ss);return Re(Ss,Ae),{rows:Yd,total:b.value.total}}catch(zr){return console.error("Failed to fetch items:",zr),{rows:[],total:0}}finally{xe.value=!1}},{isLoading:le,toggleSidebar:Ge,onGridReady:be,handleUnSelect:ze,handleSelectAll:qe,onSearch:Ee,firstLoad:Me}=bEe({selectRowData:V([]),isSidebarOpen:C,quickFilterText:_,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:j}),wt=V([]),At=()=>{var Ae;wt.value=((Ae=v.value)==null?void 0:Ae.getSelectedRows())||[]},Ut=ds({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),tn=q(()=>({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:zt,noRowsOverlayComponent:jv(Qte),noRowsOverlayComponentParams:()=>X.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 Ze=["row-highlight"];return Ae.data.id||Ze.push("row-inactive"),Ae.data.isDeleted&&Ze.push("row-deleted"),Ae.data.disabled&&Ze.push("row-deleted"),Ae.data.isArchived&&Ze.push("row-archived"),Ae.data.isLocked&&Ze.push("row-locked"),Ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:O.value,sorting:xe.value},onCellKeyDown:Ae=>{var Ze,Kt,hn;if(Ae.data.isDeleted)return!1;if(((Ze=Ae==null?void 0:Ae.event)==null?void 0:Ze.key)==="Enter"){const{api:Ni,node:as,column:$c}=Ae,Ea=Ni.getCellRendererInstances({rowNodes:[as],columns:[$c]});if(Ea.length>0){const In=Ea[0];In&&typeof((Kt=In.componsenExposed)==null?void 0:Kt.focus)=="function"&&((hn=In.componsenExposed)==null||hn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var hn;if((hn=Ae.data)!=null&&hn.isDeleted)return!0;const Ze=Ae.event.key,Kt=Ae.editing;return Kt&&Ze==="Tab"?!0:Kt&&Ze==="Enter"?!1:Ze==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ze==="ArrowUp"||Ze==="ArrowDown"||Ze==="ArrowLeft"||Ze==="ArrowRight"||Ze==="Tab"||Ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ze=Ae.api.getFirstDisplayedRowIndex(),Kt=Ae.api.getLastDisplayedRowIndex();Ut.rowsDisplay.fromIndex=Ze,Ut.rowsDisplay.toIndex=Kt,Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(hn=>hn.getColId())},onViewportChanged:Ae=>{Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ze=>Ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ze.length>0&&Ze[0].focusUi()}},tabToNextCell:Ae=>{let Ze=Ae.nextCellPosition;if(Ze&&Ze.column.getColId()==="ag-Grid-SelectionColumn"){const Kt=Ae.api.getAllDisplayedColumns(),hn=Kt.indexOf(Ze.column),Ni=Ae.backwards?-1:1,as=Kt[hn+Ni];if(as)return{rowIndex:Ze.rowIndex,column:as,rowPinned:Ze.rowPinned}}return Ze}}));function zt(){if(!v.value)return;let Ae=0;v.value.forEachNode(Ze=>{Ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}tt(()=>ke,()=>{v.value&&(P.value="",D.value.clear(),v.value.deselectAll(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Le=V(),je=V(),_t=V(),Nt=()=>{var Ae;(Ae=_t.value)==null||Ae.open()},jt=()=>{var Ae;(Ae=je.value)==null||Ae.open()},nt=async()=>{Me.value=!0,v.value&&(P.value="",D.value.clear(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},Fo=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),gr=V();q(()=>{var Ae;return(Ae=EEe(Fo.value))==null?void 0:Ae.map(Ze=>`<div>• ${Ze}</div>`).join(`
|
|
263
|
-
`)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>Q(hn,!0)),Ze.addEventListener("columnResized",hn=>Q(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{vt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);T.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},zd=async()=>{if(O.value)try{const Ae=await O.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Mn=async()=>{if(O.value)try{const Ae=await O.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=Av(),{setUser:nR}=lo,jd=async()=>{if(O.value)try{const Ae=await O.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(O.value)try{const Ze=await O.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),Mn())},{immediate:!0,deep:!0}),tt(z,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(D.value),Kt).then(hn=>{ee(hn,D.value,Kt)})},{immediate:!0,deep:!0}),tt(P,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{k.value=Ae||[],Q({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(dee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(jS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Hne),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(ES),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:te(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Lte),{"model-value":H(k),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":H(x),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(uEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr,onOnScroll:Ae.handleScroll}),null,16,["height","isSorting","onOnScroll"])]),footer:he(()=>[me("div",{class:te(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ht(H(b).loaded)+" of "+ht(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(vne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(oee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":U.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(jee))]),popup:he(()=>[ue(Ure,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(WEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(REe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},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"}}]]),B$="0.1.
|
|
263
|
+
`)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>Q(hn,!0)),Ze.addEventListener("columnResized",hn=>Q(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{vt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);T.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},zd=async()=>{if(O.value)try{const Ae=await O.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Mn=async()=>{if(O.value)try{const Ae=await O.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=Av(),{setUser:nR}=lo,jd=async()=>{if(O.value)try{const Ae=await O.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(O.value)try{const Ze=await O.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),Mn())},{immediate:!0,deep:!0}),tt(z,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(D.value),Kt).then(hn=>{ee(hn,D.value,Kt)})},{immediate:!0,deep:!0}),tt(P,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{k.value=Ae||[],Q({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(dee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(jS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Hne),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(ES),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:te(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Lte),{"model-value":H(k),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":H(x),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(uEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr,onOnScroll:Ae.handleScroll}),null,16,["height","isSorting","onOnScroll"])]),footer:he(()=>[me("div",{class:te(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ht(H(b).loaded)+" of "+ht(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(vne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(oee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":U.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(jee))]),popup:he(()=>[ue(Ure,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(WEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(REe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},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"}}]]),B$="0.1.179",jEe={key:0},KEe=Ct(st({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=ds({id:"",workspaceId:"",apiConfig:{}}),o=oa(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=V(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};gh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",B$);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new FO(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),qn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Jr("workspaceId",d),Jr("entityId",u),(h,f)=>(K(),ie("div",{class:te(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",jEe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ue(H(zEe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tR=async(e={},t={})=>{const n=n1(KEe),o=hZ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${B$}`,"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",Yt),n.directive("focusable",ko);const i=await Pre();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tR),Nn.default=tR,Nn.initDashboard=tR,Object.defineProperties(Nn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|