@arbocollab/arbo-plugin-item-table 0.0.134 → 0.0.135
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/CHANGELOG.md +61 -0
- package/lib/es/index.es.js +7 -5
- package/lib/umd/index.umd.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.0.135] - 2026-02-05
|
|
6
|
+
|
|
7
|
+
### 🚀 Features
|
|
8
|
+
|
|
9
|
+
**Filter System Enhancement**
|
|
10
|
+
|
|
11
|
+
- **New Parameter: `preflight_status`**
|
|
12
|
+
- Added `preflight_status` parameter to ItemService and filter logic
|
|
13
|
+
- Replaces `status_eq` as the default filter parameter
|
|
14
|
+
- Default value: `'1'` (active items only)
|
|
15
|
+
|
|
16
|
+
**FilterBox Component**
|
|
17
|
+
|
|
18
|
+
- **Improved Archive Status Logic:**
|
|
19
|
+
- No selection: Uses `preflight_status: '1'` (active items only)
|
|
20
|
+
- Single selection (archived): `status_eq: '0'`
|
|
21
|
+
- Single selection (active): `status_eq: '1'`
|
|
22
|
+
- Both selected: `status_eq: '0,1'` (all items)
|
|
23
|
+
- Updated clear filter action to use `preflight_status: '1'` instead of `status_eq`
|
|
24
|
+
|
|
25
|
+
**ItemTable Component**
|
|
26
|
+
|
|
27
|
+
- Changed default filter from `status_eq: '1'` to `preflight_status: '1'`
|
|
28
|
+
- Better alignment with new filtering system
|
|
29
|
+
|
|
30
|
+
**ItemService API**
|
|
31
|
+
|
|
32
|
+
- Added `preflight_status` parameter support in `getItemList()` method
|
|
33
|
+
- Maintains backward compatibility with existing `status_eq` parameter
|
|
34
|
+
|
|
35
|
+
### 🔧 Code Quality
|
|
36
|
+
|
|
37
|
+
- Removed unused `node:console` import from item-table.vue
|
|
38
|
+
- Improved filter parameter naming consistency
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## [0.0.134] - 2026-02-05
|
|
43
|
+
|
|
44
|
+
### 🚀 Features
|
|
45
|
+
|
|
46
|
+
**Tooltip Directive - Style Injection**
|
|
47
|
+
|
|
48
|
+
- **Automatic Style Injection:**
|
|
49
|
+
- Styles are now automatically injected into `<head>` on directive initialization
|
|
50
|
+
- Uses unique ID `'arbo-tooltip-styles'` to prevent duplicate injections
|
|
51
|
+
- Checks for existing styles before injecting
|
|
52
|
+
- Injected once globally, not per tooltip instance
|
|
53
|
+
|
|
54
|
+
**Tooltip Themes:**
|
|
55
|
+
|
|
56
|
+
- All themes use CSS custom properties for dynamic theming
|
|
57
|
+
- Themes included: `arbo`, `warning`, `error`, `light`
|
|
58
|
+
- Arrow colors automatically match tooltip background for all placements
|
|
59
|
+
|
|
60
|
+
**Implementation Details:**
|
|
61
|
+
|
|
62
|
+
- `injectTooltipStyles()` function runs in `beforeMount` directive hook
|
|
63
|
+
- Pure CSS converted from SCSS
|
|
64
|
+
- Global application of styles ensures consistent tooltip appearance
|
|
65
|
+
|
|
5
66
|
## [0.0.133] - 2026-02-05
|
|
6
67
|
|
|
7
68
|
### 🐛 Bug Fixes
|
package/lib/es/index.es.js
CHANGED
|
@@ -35574,7 +35574,7 @@ const KX = /* @__PURE__ */ ut({
|
|
|
35574
35574
|
const he = {};
|
|
35575
35575
|
Object.assign(he, X(J.assignees));
|
|
35576
35576
|
const { statuses: be, archiveStatuses: Ge, startDateRange: Se, dueDateRange: ct } = J;
|
|
35577
|
-
return be && be.length > 0 && (he.status_ina = be.join(",")), E.value == "AND" ? he.condition_combine_type = "and" : he.condition_combine_type = "or", Se && Object.assign(he, O(Se, "start_date")), ct && Object.assign(he, O(ct, "due_date")), Ge && Ge.length === 1 ? he.status_eq = Ge[0] === "archived" ? "0" : "1" : Ge && Ge.length === 2 ? he.status_eq = "0,1" : Object.keys(he).length === 0 && (he.status_eq = "1"), he;
|
|
35577
|
+
return be && be.length > 0 && (he.status_ina = be.join(",")), E.value == "AND" ? he.condition_combine_type = "and" : he.condition_combine_type = "or", Se && Object.assign(he, O(Se, "start_date")), ct && Object.assign(he, O(ct, "due_date")), !Ge || Ge.length === 0 ? he.preflight_status = "1" : Ge && Ge.length === 1 ? he.status_eq = Ge[0] === "archived" ? "0" : "1" : Ge && Ge.length === 2 ? he.status_eq = "0,1" : Object.keys(he).length === 0 && (he.status_eq = "1"), he;
|
|
35578
35578
|
}, N = (J) => {
|
|
35579
35579
|
if (J === null || typeof J != "object") return J;
|
|
35580
35580
|
if (J instanceof Date) return new Date(J.getTime());
|
|
@@ -35607,7 +35607,7 @@ const KX = /* @__PURE__ */ ut({
|
|
|
35607
35607
|
(he = (J = f.value) == null ? void 0 : J.clear) == null || he.call(J), (Ge = (be = p.value) == null ? void 0 : be.clear) == null || Ge.call(be), (ct = (Se = m.value) == null ? void 0 : Se.clear) == null || ct.call(Se), (vt = (wt = v.value) == null ? void 0 : wt.clear) == null || vt.call(wt), ($ = (G = C.value) == null ? void 0 : G.clear) == null || $.call(G), E.value = "AND", b.value = null;
|
|
35608
35608
|
}, ie = () => {
|
|
35609
35609
|
ve(), _.value = null, b.value = null, h("apply-filter", {
|
|
35610
|
-
|
|
35610
|
+
preflight_status: "1"
|
|
35611
35611
|
});
|
|
35612
35612
|
};
|
|
35613
35613
|
it(I, (J) => {
|
|
@@ -77997,7 +77997,8 @@ class JL extends _ye {
|
|
|
77997
77997
|
due_date_gte: t.due_date_gte || void 0,
|
|
77998
77998
|
due_date_lte: t.due_date_lte || void 0,
|
|
77999
77999
|
due_date_btw: t.due_date_btw || void 0,
|
|
78000
|
-
condition_combine_type: t.condition_combine_type || "or"
|
|
78000
|
+
condition_combine_type: t.condition_combine_type || "or",
|
|
78001
|
+
preflight_status: t.preflight_status || void 0
|
|
78001
78002
|
}, i = t.sortBy;
|
|
78002
78003
|
return this.request(
|
|
78003
78004
|
"list_cursor",
|
|
@@ -79071,7 +79072,8 @@ const kye = {
|
|
|
79071
79072
|
var Rt, gn, Zs;
|
|
79072
79073
|
v.value.total = Ie.meta.total ?? 0, (Rt = Ie.meta.next) != null && Rt.cursor && (ie[Ae + 1] = Ie.meta.next.cursor), R.value = Ie.meta["X-Tsr-signature"] || "", Ie.meta.total === 0 ? (gn = f.value) == null || gn.showNoRowsOverlay() : (Zs = f.value) == null || Zs.hideOverlay();
|
|
79073
79074
|
}, Ge = Sk(), Se = H(null), { sortingAPIConfiguration: ct, isSortingRunning: wt } = Pi(Ge), vt = H({
|
|
79074
|
-
status_eq:
|
|
79075
|
+
// status_eq: '1',
|
|
79076
|
+
preflight_status: "1"
|
|
79075
79077
|
}), G = H([]), $ = async ({ page: Ie, pageSize: Ae, filterText: Rt }) => {
|
|
79076
79078
|
var Ta;
|
|
79077
79079
|
(Ta = f.value) == null || Ta.hideOverlay();
|
|
@@ -79533,7 +79535,7 @@ const kye = {
|
|
|
79533
79535
|
"beta-tag": "_beta-tag_1lefh_57"
|
|
79534
79536
|
}, Xye = {
|
|
79535
79537
|
$style: Zye
|
|
79536
|
-
}, Jye = /* @__PURE__ */ bt(Uye, [["__cssModules", Xye]]), QL = "0.0.
|
|
79538
|
+
}, Jye = /* @__PURE__ */ bt(Uye, [["__cssModules", Xye]]), QL = "0.0.135", Qye = { key: 0 }, ewe = /* @__PURE__ */ ut({
|
|
79537
79539
|
__name: "app",
|
|
79538
79540
|
setup(e) {
|
|
79539
79541
|
const t = q(() => n.id.length === 0 || n.workspaceId.length === 0), n = Oi({
|
package/lib/umd/index.umd.js
CHANGED
|
@@ -157,7 +157,7 @@ This will fail in production.`);r=il,r._s.has(e)||(s?lC(e,t,o,r):gP(e,o,r),$.env
|
|
|
157
157
|
<rect width="48" height="48" fill="white" transform="translate(0.617188 0.566406)"/>
|
|
158
158
|
</clipPath>
|
|
159
159
|
</defs>
|
|
160
|
-
</svg>`,i=Ud(),{showMessage:r}=i,a=H(!1),l=H(!1),u=e,c=H({file:null,format:null,isValid:void 0}),d=K(()=>{var x;return((x=u.acceptTypes)==null?void 0:x.map(k=>`.${k}`).join(","))||".xlsx,.xls,.csv"}),h=K(()=>c.value.format?s(c.value.format):""),f=K(()=>{var x;if(!c.value.isValid)return`Invalid file type. Please upload a ${(x=u.acceptTypes)==null?void 0:x.join(", ")} file.`}),p=K(()=>!!c.value.file),m=()=>{var x;(x=o.value)==null||x.click()},v=K(()=>c.value.file?c.value.file.name:""),C=x=>{var F;const k=u.acceptTypes||["xlsx","xls","csv"],I=(F=x.name.split(".").pop())==null?void 0:F.toLowerCase();return I?k.includes(I):!1},b=x=>{var I,F;const k=C(x);x&&k?(c.value.isValid=k,a.value=!1,c.value.file=x,c.value.format=((I=x.name.split(".").pop())==null?void 0:I.toLowerCase())||null):r(`Invalid file type. Please upload a ${(F=u.acceptTypes)==null?void 0:F.join(", ")} file.`,"error")},_=x=>{const k=x.target;if(k.files&&k.files[0]){const I=k.files[0];b(I)}},w=()=>{l.value=!0},R=()=>{l.value=!1},E=x=>{if(l.value=!1,x.dataTransfer&&x.dataTransfer.files&&x.dataTransfer.files[0]){const k=x.dataTransfer.files[0];b(k)}},T=n;return nt(c,x=>{T("update:modelValue",x)},{deep:!0}),t({internalValue:c,clear:()=>{o.value&&(o.value.value=""),c.value={file:null,format:null},a.value=!1}}),(x,k)=>{const I=$c("tooltip");return j(),le("div",{class:Y([x.$style["drop-area"],{[x.$style["is-dragging"]]:l.value,[x.$style.error]:a.value}]),onDragenter:Gt(w,["prevent"]),onDragover:Gt(w,["prevent"]),onDragleave:Gt(R,["prevent"]),onDrop:Gt(E,["prevent"]),onClick:m},[p.value?Xe("",!0):(j(),le("div",{key:0,class:Y(x.$style["drop-area-content"])},[ae(ft,{src:"Upload",size:"24",color:"#3C9BFA"}),pe("span",null,[ae(pt,{variant:["tertiary","text"],class:Y(x.$style["upload-btn"])},{default:ye(()=>[...k[0]||(k[0]=[at(" Click to upload ",-1)])]),_:1},8,["class"]),k[1]||(k[1]=at(" or drag and drop files here ",-1))])],2)),p.value?qe((j(),le("div",{key:1,class:Y(x.$style["drop-area-file"])},[pe("div",{innerHTML:h.value},null,8,hK),qe((j(),le("span",{class:Y(x.$style["file-name"])},[at(yt(v.value),1)],2)),[[I,{content:v.value}]])],2)),[[I,f.value]]):Xe("",!0),pe("input",{ref_key:"fileInput",ref:o,type:"file",style:{display:"none"},accept:d.value,onChange:_},null,40,fK)],34)}}}),[["__cssModules",{$style:{"upload-btn":"_upload-btn_1ybeg_1","drop-area":"_drop-area_1ybeg_8","is-dragging":"_is-dragging_1ybeg_18",error:"_error_1ybeg_22","drop-area-content":"_drop-area-content_1ybeg_26","drop-area-file":"_drop-area-file_1ybeg_34","file-name":"_file-name_1ybeg_42","clear-button":"_clear-button_1ybeg_51"}}]]),BC=ll("userStore",()=>{const e=H(null),t=H(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),pK={style:{"text-align":"left",width:"100%"}},gK={key:0},mK=["innerHTML"],vK=20,yK=wt(ut({__name:"FilterAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s}=lo({appendTo:"parent",offset:[0,0]}),{triggerRef:i,popupRef:r,isVisible:a}=lo({appendTo:"parent",offset:[0,2]}),l=()=>{h()},{triggerRef:u,popupRef:c,isVisible:d,show:h}=lo({appendTo:"parent",offset:[0,2]}),f=H(null),p=()=>{M.value=[],vt.value=!1,Ct.value=!1,te.value="any"},m=K(()=>a.value||d.value),v=K(()=>{var W;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((W=M.value)==null?void 0:W.length)===0,wrapperRef:s,active:m,bordered:!0}}),{argsMain:C}=bo(v),b=en,_=n,w=K(()=>{var W;return Math.max(0,(((W=M.value)==null?void 0:W.length)||0)-o.maxVisible)}),R=K(()=>{var W;return w.value<=0?"":((W=M.value)==null?void 0:W.slice(o.maxVisible).map(fe=>fe.name).join(", "))||""}),E=H(!1),T=H(!1),x=H(null),k=H(1),I=H(!0),F=H(0),A=H(""),M=H([]),V=K(()=>{var W;return((W=M.value)==null?void 0:W.map(fe=>fe.id))||[]}),{assigneeList:X,mergedOptions:O}=fT({...o,value:[]}),{apiServices:B}=eo(!1,o),N=async(W=1,fe="",Ee=!1)=>{var Pe,Be,Ne,Le,Oe;if(!B.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Ee?T.value=!0:E.value=!0,x.value=null,!((Pe=B.value)!=null&&Pe.getEntityUserRoles))throw new Error("API service getEntityUserRoles is undefined");const Te=Fn.getInstance().getItem("ws.code");try{const Ye=await((Be=B.value)==null?void 0:Be.getEntityUserRoles({workspaceId:String(Te),page:W,per_page:vK,display_name_like:fe,include:"user,ws_role"})),Ge=((Ne=Id(Ye.data))==null?void 0:Ne.map(Aw))??[];X.value=Ee?wd(X.value,Ge,"id"):Ge,F.value=Ye.meta.total,I.value=(((Le=Ye==null?void 0:Ye.meta)==null?void 0:Le.current_page)||0)<(((Oe=Ye==null?void 0:Ye.meta)==null?void 0:Oe.last_page)||0),k.value=W}catch(Ye){console.error("Error fetching assignable users:",Ye),x.value="Failed to load assignable users"}finally{E.value=!1,T.value=!1}},z=W=>{var fe,Ee;if((fe=M.value)!=null&&fe.some(Te=>Te.id===W.data.id)){M.value=(Ee=M.value)==null?void 0:Ee.filter(Te=>Te.id!==W.data.id);return}M.value=[...M.value||[],W.data]},q=()=>{!T.value&&I.value&&N(k.value+1,A.value,!0)},de=_i(async W=>{A.value=W,await N(1,W,!1)},pr);nt(()=>d.value,W=>{var fe;W&&(N(1,A.value,!1),(fe=f.value)==null||fe.focus())});const ve=K(()=>{var W;return((W=M.value)==null?void 0:W.slice(0,3))||[]}),se=K(()=>ve.value.map(W=>({id:W.id,name:W.name,initial:W.initial,avatarId:W.id,profile_image:W.profile_image,color:W.color,size:24,user:W}))),te=H("any"),J=W=>{te.value=W.id},he=K(()=>[{label:"Any",value:"any",id:"any",selected:te.value==="any"},{label:"All",value:"all",id:"all",selected:te.value==="all"}]),be=K(()=>te.value==="any"?"Any":te.value==="all"?"All":""),$e=BC(),{user:Se}=Is($e),ct=K(()=>{if(!Se.value)return{id:"",name:"Unknown",initial:"U",profile_image:null,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}};const W=Se.value;return{id:W.id,name:W.first_name,initial:"Me",profile_image:W.avatar,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}}}),Ct=H(!1),vt=H(!1);t({getData:()=>({assignees:M.value,showNoAssignee:Ct.value,showMe:vt.value,selectedTypeId:te.value}),clear:p,setData:W=>{M.value=W.assignees||[],Ct.value=W.showNoAssignee||!1,vt.value=W.showMe||!1,te.value=W.selectedTypeId||"any"}}),nt([M,Ct,vt,te],()=>{_("updated",{assignees:M.value,showNoAssignee:Ct.value,showMe:vt.value,selectedTypeId:te.value})},{deep:!0});const G=W=>{var Ee;const fe=Fn.getInstance().getItem("ws.code");return((Ee=B.value)==null?void 0:Ee.getUserInformation(fe,W))||Promise.resolve(null)};return(W,fe)=>(j(),le(Pt,null,[ae(So,qt(Z(C),{ref_key:"triggerRef",ref:s,bordered:!0,style:{"--box-padding":"0 4px 0 0","--icon-size":"18px"}}),{suffix:ye(({hovered:Ee,focused:Te})=>{var Pe;return[(M.value&&((Pe=M.value)==null?void 0:Pe.length)>0||Ct.value||vt.value)&&(Ee||Te)?(j(),le("div",{key:0,class:"wrapper-suffix",onClick:Gt(p,["stop","prevent"])},[ae(pt,{variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),pe("div",{class:Y(["wrapper-suffix",{"icon-up":Z(d)}]),onClick:l},[ae(ft,{src:"ChevronDown",color:"#A6A6A6",size:"12"})],2)]}),default:ye(()=>[pe("div",{class:Y([W.$style["assignee-row"],W.$style["assignee-selector"]])},[qe((j(),le("div",null,[ae(pt,{variant:"text",ref_key:"triggerRef1",ref:i,size:30,disabled:Ct.value,style:an({background:Ct.value?"#D7D7D7":"transparent",borderRadius:Ct.value?"4px 0 0 4px":"",border:"none"})},{suffix:ye(()=>[ae(ft,{class:Y(["wrapper-suffix2",{"icon-up":Z(a)}]),src:"ChevronDown",color:"#A6A6A6",size:"12"},null,8,["class"])]),default:ye(()=>[pe("span",pK,yt(be.value),1)]),_:1},8,["disabled","style"])])),[[Z(b),{content:Ct.value?"Only ‘Any’ is allowed with ‘No assignee’":""}]]),pe("span",{class:Y([W.$style.seperator])},null,2),pe("div",{ref_key:"triggerRef2",ref:u,class:Y(W.$style["assignee-row"]),style:{flex:1}},[Ct.value&&te.value=="any"?(j(),le("div",gK,[pe("div",{class:Y(W.$style["unassign-icon"])},[...fe[2]||(fe[2]=[pe("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[pe("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)])):Xe("",!0),vt.value?(j(),Ue(Wd,{key:1,user:ct.value,"show-profile":!1},null,8,["user"])):Xe("",!0),(j(!0),le(Pt,null,In(se.value,Ee=>(j(),Ue(Wd,{user:Ee.user,key:Ee.user.id,apiUpdateFunction:G},null,8,["user"]))),128)),w.value>0?qe((j(),le("div",{key:2,class:Y(W.$style["extra-avatars"])},[at(" +"+yt(w.value),1)],2)),[[Z(b),R.value]]):Xe("",!0)],2)],2)]),_:1},16),pe("div",{ref_key:"popupRef1",ref:r,class:Y([W.$style.list])},[(j(!0),le(Pt,null,In(he.value,Ee=>(j(),Ue(na,qt({class:W.$style["list-item"],style:{width:"100px",minWidth:"100px"}},{ref_for:!0},Ee,{key:Ee.id,onClick:Te=>J(Ee)}),null,16,["class","onClick"]))),128))],2),pe("div",{ref_key:"popupRef2",ref:c},[ae(ul,qt({"selected-id":V.value},{...o},{options:Z(O),loading:E.value,"loading-more":T.value,"has-more":I.value,ref_key:"searchListRef",ref:f,onSelect:fe[1]||(fe[1]=Ee=>{z(Ee),_("start-update")}),onSearch:Z(de),onLoadMore:q}),{"extra-item":ye(({query:Ee})=>[te.value=="any"&&Ee.trim()===""?(j(),Ue(pt,{key:0,variant:"menu-item",onClick:fe[0]||(fe[0]=Te=>Ct.value=!Ct.value),actived:Ct.value,style:{"border-top-width":0,"border-bottom-width":0}},{prefix:ye(()=>[pe("div",{class:Y(W.$style["unassign-icon"])},[...fe[3]||(fe[3]=[pe("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[pe("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)]),default:ye(()=>[fe[4]||(fe[4]=at(" No assignee ",-1))]),_:1},8,["actived"])):Xe("",!0)]),item:ye(({item:Ee,selectedIndex:Te,isSelected:Pe,handleSelect:Be,handleItemHover:Ne,getHighlightedLabel:Le,query:Oe,idx:Ye})=>[ae(na,qt(Ee,{hover:Ye===Te,selected:Pe(Ee),type:Ee.type,onClick:Gt(Ge=>Be(Ee),["stop","prevent"]),onMouseover:Ge=>Ne(Ye),class:W.$style["item-assignee"]}),{prefix:ye(()=>[ae(Wd,{user:Ee.data,apiUpdateFunction:G},null,8,["user"])]),label:ye(({})=>[Oe?qe((j(),le("span",{key:0,class:Y([W.$style["item-label"],W.$style.match]),style:{flex:"1"},innerHTML:Le(Ee.label)},null,10,mK)),[[Z(b),{content:Ee.label}]]):qe((j(),le("span",{key:1,class:Y(W.$style["item-label"]),style:{flex:"1"}},[at(yt(Ee.label),1)],2)),[[Z(b),{content:Ee.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],64))}}),[["__cssModules",{$style:{action:"_action_13z4k_1","item-assignee":"_item-assignee_13z4k_6","item-action":"_item-action_13z4k_6","item-label":"_item-label_13z4k_16","unassign-icon":"_unassign-icon_13z4k_25","error-message":"_error-message_13z4k_37","empty-state":"_empty-state_13z4k_47","assignee-row":"_assignee-row_13z4k_60","assignee-selector":"_assignee-selector_13z4k_68",seperator:"_seperator_13z4k_73","extra-avatars":"_extra-avatars_13z4k_81",list:"_list_13z4k_92"}}]]),wK={key:0,class:"wrapper-suffix"},CK=wt(ut({__name:"FilterArchiveStatus",emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:o,popupRef:s,isVisible:i}=lo({appendTo:"parent",offset:[0,0]}),r=H([]),a=K(()=>[{label:"Archived",value:"archived",id:"archived",selected:r.value.includes("archived")},{label:"Not archived (Active)",value:"active",id:"active",selected:r.value.includes("active")}]),l=H("");nt(r,v=>{v.length===0?l.value="":v.length===2?l.value="All":v.length===1&&(l.value=v[0]==="archived"?"Archived":"Not archived (Active)")},{immediate:!0,deep:!0});const u=v=>{r.value.includes(v.value)?r.value=r.value.filter(C=>C!==v.value):r.value.push(v.value)},c=()=>{r.value=[]},d=()=>{r.value=[]},h=K(()=>i.value),f=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:r.value.length===0,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=bo(f);t({getData:()=>r.value,clear:c,setData:v=>{r.value=v},reset:d});const m=n;return nt(()=>r.value,v=>{m("updated",v)},{deep:!0}),(v,C)=>(j(),le(Pt,null,[ae(So,qt({ref_key:"triggerRef",ref:o},Z(p),{bordered:!0,style:{"--icon-size":"18px"},class:"border-f3f5f8"}),{suffix:ye(({hovered:b,focused:_})=>[r.value.length>0&&(b||_)?(j(),le("div",wK,[ae(pt,{onClick:Gt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),pe("div",{class:Y(["wrapper-suffix",{"icon-up":Z(i)}])},[ae(ft,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[(j(),le("span",{key:l.value,style:{cursor:"pointer"}},yt(l.value),1))]),_:1},16),pe("div",{ref_key:"popupRef",ref:s,class:Y(v.$style.list)},[(j(!0),le(Pt,null,In(a.value,b=>(j(),Ue(na,qt({class:v.$style["list-item"]},{ref_for:!0},b,{key:b.id,onClick:_=>u(b)}),null,16,["class","onClick"]))),128))],2)],64))}}),[["__cssModules",{$style:{list:"_list_h4ljx_2","list-item":"_list-item_h4ljx_9"}}]]),bK={key:0,class:"wrapper-suffix"},SK=wt(ut({__name:"FilterStatus",emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o=e,s={INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a}=lo({appendTo:"parent",offset:[0,0]}),l=H([]),u=H([]),c=H(!1),d=H(!1),h=H(null),f=H(s.INITIAL_PAGE),p=H(!0),m=H(0),v=H(""),C=n,b=K(()=>a.value),_=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:l.value.length===0,wrapperRef:i,active:b,bordered:!0})),w=H(null),{argsMain:R}=bo(_),E=K(()=>u.value.filter(z=>l.value.includes(z.id))),T=K(()=>{const z=E.value.length;return z===0?"":z===1?E.value[0].label:`${z} statuses `}),x=K(()=>l.value),k=K(()=>{if(l.value.length===0)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const z=E.value[0],q=String((z==null?void 0:z.color)||"white");return{backgroundColor:q,border:hp(q,"white")?"1px solid #ccc":"1px solid #fff"}}),I=z=>({label:z.name,value:z.id,selected:l.value.includes(z.id),hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:z,id:z.id,color:z.color}),{apiServices:F}=eo(!1,o),A=Ao("entityId"),M=async(z=s.INITIAL_PAGE,q="",de=!1)=>{var ve,se;de?d.value=!0:c.value=!0,h.value=null;try{const te=Fn.getInstance().getItem("ws.code"),J=await((ve=F.value)==null?void 0:ve.getTemplateFlowStatuses({workspaceId:te,entityId:A||"",name_like:q,page:z}));if(!J){de||(u.value=[]),p.value=!1;return}const he=J.data.map(I);u.value=de?[...u.value,...he]:he,m.value=((se=J.meta)==null?void 0:se.total)??J.data.length,p.value=u.value.length<m.value,f.value=z}catch(te){console.error("Error fetching statuses:",te),h.value="Failed to load statuses",de||(u.value=[]),p.value=!1,C("error",h.value)}finally{c.value=!1,d.value=!1}},V=z=>{const q=z.id;l.value.includes(q)?l.value=l.value.filter(ve=>ve!==q):l.value=[...l.value,q],C("update:modelValue",l.value)},X=async()=>{!p.value||d.value||await M(f.value+1,v.value,!0)},O=async z=>{v.value=z,f.value=s.INITIAL_PAGE,await M(s.INITIAL_PAGE,z,!1)},B=()=>{l.value=[],C("update:modelValue",[])},N=()=>{var z;(z=r.value)==null||z.focus()};return nt(()=>a.value,z=>{var q;z&&(M(1,v.value,!1),(q=w.value)==null||q.focus())}),nt(()=>l.value,z=>{C("updated",z)},{deep:!0}),t({focus:N,clear:B,getData:()=>l.value,setData:z=>{l.value=z}}),(z,q)=>{const de=$c("tooltip");return j(),le(Pt,null,[ae(So,qt({ref_key:"triggerRef",ref:i},Z(R),{style:{"--icon-size":"18px"},class:"border-f3f5f8",bordered:!0}),{suffix:ye(({hovered:ve,focused:se})=>[E.value.length>0&&(ve||se)?(j(),le("div",bK,[ae(pt,{onClick:Gt(B,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),pe("div",{class:Y(["wrapper-suffix",{"icon-up":Z(a)}])},[ae(ft,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[pe("div",{class:Y(z.$style.status)},[E.value.length==1?(j(),le("div",{key:0,class:Y(z.$style["color-indicator"]),style:an(k.value)},null,6)):Xe("",!0),qe((j(),le("span",{class:Y({[z.$style.empty]:E.value.length===0,[z.$style["status-text"]]:!0})},[at(yt(T.value),1)],2)),[[de,{content:T.value}]])],2)]),_:1},16),pe("div",{ref_key:"popupRef",ref:r},[ae(ul,{style:{width:"396px"},ref_key:"searchListRef",ref:w,"selected-id":x.value,options:u.value,loading:c.value,"loading-more":d.value,"has-more":p.value,error:h.value,onSearch:O,onSelect:V,onLoadMore:X,onCancel:q[0]||(q[0]=ve=>C("cancel"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1quat_2",status:"_status_1quat_6","color-indicator":"_color-indicator_1quat_12","count-badge":"_count-badge_1quat_25","status-text":"_status-text_1quat_32",empty:"_empty_1quat_41"}}],["__scopeId","data-v-2550b492"]]),EK={key:0},RK={key:1},_K={key:0},DK={key:1},xK={key:0,class:"wrapper-suffix"},TK={key:1,class:"wrapper-suffix"},aI=wt(ut({__name:"FilterDateRange",emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:o,popupRef:s,isVisible:i,hide:r}=lo({appendTo:"parent",offset:[0,0]}),a=()=>{l.value=[null,null]},l=H([null,null]),u=C=>{const b=Hp();return C?it.fromJSDate(C,{zone:b}).toFormat("dd/MM/yyyy"):""},c=K(()=>i.value),d=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:l.value[0]===null&&l.value[1]===null,wrapperRef:o,active:c,bordered:!0})),{argsMain:h}=bo(d),f=H(!1),p=C=>{"start"in C&&C.start!==void 0&&(l.value[0]=C.start),"end"in C&&C.end!==void 0&&(l.value[1]=C.end)};t({getData:()=>l.value,clear:a,setData:C=>{l.value=C}});const m=n;nt(()=>l.value,C=>{m("updated",C)},{deep:!0});const v=H(null);return nt(()=>i.value,C=>{C&&setTimeout(()=>{var b;(b=v.value)==null||b.focus()},0)}),(C,b)=>(j(),le(Pt,null,[ae(So,qt({ref_key:"triggerRef",ref:o},Z(h),{style:{"--icon-size":"18px",cursor:"pointer"},bordered:!0}),{default:ye(({focused:_})=>[pe("div",{class:Y(C.$style["date-time"])},[pe("div",{class:Y(C.$style.date)},[l.value[0]==null&&(_||Z(i))?(j(),le("span",EK,"DD/MM/YYYY")):(j(),le("span",RK,yt(u(l.value[0])),1))],2),l.value[0]!==null||l.value[1]!==null||_||Z(i)?(j(),le("div",{key:0,class:Y(C.$style.separator)}," → ",2)):Xe("",!0),pe("div",{class:Y(C.$style.date)},[l.value[1]==null&&(_||Z(i))?(j(),le("span",_K,"DD/MM/YYYY")):(j(),le("span",DK,yt(u(l.value[1])),1))],2)],2)]),suffix:ye(({hovered:_,focused:w})=>[(l.value[0]!==null||l.value[1]!==null)&&(_||w||Z(i))?(j(),le("div",xK,[ae(pt,{onClick:Gt(a,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):(j(),le("div",TK,[ae(ft,{src:"Calendar",size:"12",color:"#A6A6A6"})]))]),_:1},16),pe("div",{ref_key:"popupRef",ref:s},[Z(i)?(j(),Ue(gC,{key:0,immediatelyUpdate:!1,value:l.value,onConfirmed:p,ref_key:"calendarRef",ref:v,onClosed:Z(r),onStartUpdate:b[0]||(b[0]=_=>f.value=!0),onFinishUpdate:b[1]||(b[1]=_=>f.value=!1)},null,8,["value","onClosed"])):Xe("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_1695v_2","date-time":"_date-time_1695v_5",date:"_date_1695v_5",separator:"_separator_1695v_16"}}]]),FK=wt(ut({__name:"Switch",props:{modelValue:{type:String,required:!0,validator:e=>["AND","OR"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,s=c=>{n.disabled||n.modelValue===c||o("update:modelValue",c)},i=K(()=>n.modelValue==="AND"?"left":"right"),r=K(()=>n.modelValue==="AND"&&l.value?l.value.offsetWidth+"px":n.modelValue==="OR"&&u.value?u.value.offsetWidth+"px":"calc(50% - 2px)"),a=K(()=>n.modelValue==="AND"?"translateX(0)":n.modelValue==="OR"&&l.value?`translateX(${l.value.offsetWidth+2}px)`:"translateX(0)"),l=H(null),u=H(null);return(c,d)=>(j(),le("div",{class:Y(["switch-container",{disabled:e.disabled}])},[pe("div",{class:Y(["slider",i.value]),style:an({width:r.value,transform:a.value})},null,6),pe("div",{class:Y(["option",{active:e.modelValue==="AND"}]),onClick:d[0]||(d[0]=h=>s("AND")),ref_key:"andRef",ref:l}," AND ",2),pe("div",{class:Y(["option",{active:e.modelValue==="OR"}]),onClick:d[1]||(d[1]=h=>s("OR")),ref_key:"orRef",ref:u}," OR ",2)],2))}}),[["__scopeId","data-v-0d89a13b"]]),th=wt(ut({__name:"FilterRow",props:{logic:{},label:{}},setup(e){return(t,n)=>(j(),le("div",{class:Y(t.$style["filter-line"])},[pe("div",{class:Y(t.$style["filter-logic"])},[pe("span",{class:Y(t.$style["filter-tag"])},[Ft(t.$slots,"logic",{},()=>[at(yt(e.logic),1)],!0)],2)],2),pe("span",null,yt(e.label),1),pe("span",null,[Ft(t.$slots,"is",{},()=>[n[0]||(n[0]=at("is",-1))],!0)]),pe("div",{class:Y(t.$style.selector)},[Ft(t.$slots,"default",{},void 0,!0)],2)],2))}}),[["__cssModules",{$style:{"filter-line":"_filter-line_ad5v0_1","filter-tag":"_filter-tag_ad5v0_8",selector:"_selector_ad5v0_28"}}],["__scopeId","data-v-62027e29"]]),PK={style:{height:"18px",width:"18px",display:"flex","align-items":"center","justify-content":"center"}},IK=["fill"],AK=["fill"],kK=wt(ut({__name:"FilterBox",props:{loading:{type:Boolean}},emits:["update:assignees","apply-filter"],setup(e,{expose:t,emit:n}){const o=Jo,s=en,i={ACTIVE:"#000",DEFAULT:"#3C9BFA"},{hide:r,isVisible:a,triggerRef:l,popupRef:u}=lo({offset:[0,0],maxWidth:650}),c=BC(),{workspaceUserRoleId:d}=Is(c),h=n,f=H(null),p=H(null),m=H(null),v=H(null),C=H(null),b=H(null),_=H(null),w=(J,he)=>{b.value={...b.value,[J]:he}},R=K(()=>d.value||""),E=H("AND"),T=K(()=>k.value?i.ACTIVE:i.DEFAULT),x=K(()=>({border:k.value?"2px solid var(--primary-color)":"",backgroundColor:k.value?"#F0F7FF":"",padding:k.value?"2px 0 2px 7px":"2px 7px",gap:"0"})),k=K(()=>M(_.value)>0),I=K(()=>M(b.value)),F=K(()=>I.value===0),A=K(()=>I.value<=1),M=J=>{var $e,Se,ct;let he=0;return J&&(((($e=J.assignees)==null?void 0:$e.assignees)&&J.assignees.assignees.length>0||((Se=J.assignees)==null?void 0:Se.showMe)||((ct=J.assignees)==null?void 0:ct.showNoAssignee))&&he++,J.statuses&&J.statuses.length>0&&he++,J.archiveStatuses&&J.archiveStatuses.length>0&&he++,J.startDateRange&&(J.startDateRange[0]||J.startDateRange[1])&&he++,J.dueDateRange&&(J.dueDateRange[0]||J.dueDateRange[1])&&he++),he},V=J=>J?J.toISOString():null,X=J=>{var vt;const he={};if(!J)return he;const be=((vt=J.assignees)==null?void 0:vt.map(G=>G.id))||[],$e=J.showMe,Se=J.showNoAssignee,ct=J.selectedTypeId,Ct=$e&&R.value?[...be,R.value]:be;if(Ct.length>0){const G=Ct.join(",");ct==="any"?he.assignee_any_ina=G||"":ct==="all"&&(he.assignee_all_ina=G)}return Se&&ct==="any"&&(he.with_not_assigned="1"),he},O=(J,he)=>{const be={},[$e,Se]=J;if($e&&Se){const ct=V($e),Ct=V(Se);ct&&Ct&&(be[`${he}_btw`]=`${ct},${Ct}`)}else if($e){const ct=V($e);ct&&(be[`${he}_gte`]=ct)}else if(Se){const ct=V(Se);ct&&(be[`${he}_lte`]=ct)}return be},B=J=>{const he={};Object.assign(he,X(J.assignees));const{statuses:be,archiveStatuses:$e,startDateRange:Se,dueDateRange:ct}=J;return be&&be.length>0&&(he.status_ina=be.join(",")),E.value=="AND"?he.condition_combine_type="and":he.condition_combine_type="or",Se&&Object.assign(he,O(Se,"start_date")),ct&&Object.assign(he,O(ct,"due_date")),$e&&$e.length===1?he.status_eq=$e[0]==="archived"?"0":"1":$e&&$e.length===2?he.status_eq="0,1":Object.keys(he).length===0&&(he.status_eq="1"),he},N=J=>{if(J===null||typeof J!="object")return J;if(J instanceof Date)return new Date(J.getTime());if(Array.isArray(J))return J.map(be=>N(be));const he={};for(const be in J)Object.prototype.hasOwnProperty.call(J,be)&&(he[be]=N(J[be]));return he},z=()=>{var J,he,be,$e,Se;return{assignees:((J=f.value)==null?void 0:J.getData())||{},statuses:((he=p.value)==null?void 0:he.getData())||[],startDateRange:((be=m.value)==null?void 0:be.getData())||[null,null],dueDateRange:(($e=v.value)==null?void 0:$e.getData())||[null,null],archiveStatuses:((Se=C.value)==null?void 0:Se.getData())||[]}},q=J=>{var he,be,$e,Se,ct,Ct,vt,G,W,fe,Ee,Te,Pe,Be,Ne,Le,Oe,Ye,Ge,ht;if(!J){(be=(he=f.value)==null?void 0:he.clear)==null||be.call(he),(Se=($e=p.value)==null?void 0:$e.clear)==null||Se.call($e),(Ct=(ct=m.value)==null?void 0:ct.clear)==null||Ct.call(ct),(G=(vt=v.value)==null?void 0:vt.clear)==null||G.call(vt),(fe=(W=C.value)==null?void 0:W.clear)==null||fe.call(W);return}J.assignees&&((Te=(Ee=f.value)==null?void 0:Ee.setData)==null||Te.call(Ee,J.assignees)),J.statuses&&((Be=(Pe=p.value)==null?void 0:Pe.setData)==null||Be.call(Pe,J.statuses)),J.startDateRange&&((Le=(Ne=m.value)==null?void 0:Ne.setData)==null||Le.call(Ne,J.startDateRange)),J.dueDateRange&&((Ye=(Oe=v.value)==null?void 0:Oe.setData)==null||Ye.call(Oe,J.dueDateRange)),J.archiveStatuses&&((ht=(Ge=C.value)==null?void 0:Ge.setData)==null||ht.call(Ge,J.archiveStatuses))},de=()=>{const J=z(),he=B(J);_.value=N(J),b.value=N(J),h("apply-filter",he),r()},ve=()=>{var J,he,be,$e,Se,ct,Ct,vt,G,W;(he=(J=f.value)==null?void 0:J.clear)==null||he.call(J),($e=(be=p.value)==null?void 0:be.clear)==null||$e.call(be),(ct=(Se=m.value)==null?void 0:Se.clear)==null||ct.call(Se),(vt=(Ct=v.value)==null?void 0:Ct.clear)==null||vt.call(Ct),(W=(G=C.value)==null?void 0:G.clear)==null||W.call(G),E.value="AND",b.value=null},se=()=>{ve(),_.value=null,b.value=null,h("apply-filter",{status_eq:"1"})};nt(I,J=>{J==0&&(E.value="AND")});const te=()=>{_.value?(q(N(_.value)),b.value=N(_.value)):(q(null),b.value=null)};return nt(a,(J,he)=>{J&&!he?_.value&&(q(N(_.value)),b.value=N(_.value)):!J&&he&&te()}),t({getData:z,getParams:()=>B(z()),clear:se,revertToCache:te}),(J,he)=>{var be,$e;return j(),le(Pt,null,[qe((j(),Ue(pt,{variant:"secondary",ref_key:"triggerRef",ref:l,actived:Z(a)||k.value,style:an(x.value)},Gc({prefix:ye(()=>[pe("div",PK,[(j(),le("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:T.value,xmlns:"http://www.w3.org/2000/svg"},[pe("path",{d:"M0.0998533 0.587105C0.269063 0.228176 0.627991 0 1.02538 0H12.1009C12.4983 0 12.8572 0.228176 13.0264 0.587105C13.1956 0.946034 13.1443 1.36906 12.8931 1.67671L8.20395 7.40675V10.6653C8.20395 10.9755 8.02961 11.2601 7.75016 11.3986C7.47071 11.537 7.13998 11.5088 6.8913 11.3216L5.25048 10.091C5.04281 9.9372 4.92232 9.69364 4.92232 9.4347V7.40675L0.230606 1.67415C-0.0180804 1.36906 -0.0719197 0.94347 0.0998533 0.587105Z",fill:T.value},null,8,AK)],8,IK))])]),default:ye(()=>[pe("span",{style:an({color:T.value})},"Filter",4)]),_:2},[k.value?{name:"suffix",fn:ye(()=>[pe("div",{onClick:Gt(se,["stop","prevent"]),style:{height:"24px",width:"24px",display:"flex","align-items":"center","justify-content":"center"},class:"rotate-icon"},[ae(ft,{src:"Xmark",size:10,color:T.value},null,8,["color"])])]),key:"0"}:void 0]),1032,["actived","style"])),[[Z(o),{isLoading:e.loading,fullwidth:!0}]]),pe("div",{ref_key:"popupRef",ref:u},[pe("div",{class:Y(J.$style["basic-filter"])},[pe("div",{class:Y(J.$style.row)},[pe("span",{class:Y(J.$style["filter-header"])},[he[6]||(he[6]=at(" Filters ",-1)),qe(ae(FK,{modelValue:E.value,"onUpdate:modelValue":he[0]||(he[0]=Se=>E.value=Se),disabled:A.value},null,8,["modelValue","disabled"]),[[Z(s),{content:A.value?"Available only when more than one filter is selected.":"",bypassOverflowCheck:!0}]])],2),I.value>0||(($e=(be=b.value)==null?void 0:be.assignees)==null?void 0:$e.selectedTypeId)=="all"?(j(),le("div",{key:0,class:Y(J.$style.row)},[ae(pt,{size:"small",variant:"secondary",onClick:ve},{default:ye(()=>[...he[7]||(he[7]=[at(" Clear all ",-1)])]),_:1})],2)):Xe("",!0)],2),ae(th,{logic:E.value,label:"Assignee"},{logic:ye(()=>[...he[8]||(he[8]=[at("Where",-1)])]),default:ye(()=>[ae(yK,{ref_key:"FilterAssigneeRef",ref:f,onUpdated:he[1]||(he[1]=Se=>w("assignees",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Status"},{default:ye(()=>[ae(SK,{ref_key:"FilterStatusRef",ref:p,onUpdated:he[2]||(he[2]=Se=>w("statuses",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Start Date"},{default:ye(()=>[ae(aI,{ref_key:"FilterStartDateRangeRef",ref:m,onUpdated:he[3]||(he[3]=Se=>w("startDateRange",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Due Date"},{default:ye(()=>[ae(aI,{ref_key:"FilterDueDateRangeRef",ref:v,onUpdated:he[4]||(he[4]=Se=>w("dueDateRange",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Archive Status"},{default:ye(()=>[ae(CK,{ref_key:"FilterArchiveStatusRef",ref:C,onUpdated:he[5]||(he[5]=Se=>w("archiveStatuses",Se))},null,512)]),_:1},8,["logic"]),pe("div",{class:Y([J.$style.row,J.$style["justify-end"]])},[ae(pt,{size:"small",onClick:de,disabled:F.value},{default:ye(()=>[...he[9]||(he[9]=[at(" Apply filter ",-1)])]),_:1},8,["disabled"])],2)],2)],512)],64)}}}),[["__cssModules",{$style:{row:"_row_19w8k_1","justify-end":"_justify-end_19w8k_7","basic-filter":"_basic-filter_19w8k_11","filter-grid":"_filter-grid_19w8k_22","filter-line":"_filter-line_19w8k_27","filter-tag":"_filter-tag_19w8k_34",selector:"_selector_19w8k_49","filter-header":"_filter-header_19w8k_59"}}]]),OK=ut({__name:"RatingRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},setup(e){var E;const t=Jo,n=e,{isEditing:o}=$d(n),{apiServices:s}=eo(!0,n),i=K(()=>{var T,x;return{value:r.value,metricConfig:(x=(T=n.params)==null?void 0:T.colDef)==null?void 0:x.context,error:n.error,hovered:!1,readOnly:n.disabled,disabled:n.readOnly,apiServices:s.value}}),r=H(Number(n.value)),a=H(!1),{componentState:l,metricConfig:u,ICON_SIZE:c,ratingParams:d,standardNameforIcon:h,isMetricReadonly:f}=PP(i,a),{updateCellData:p}=sI((E=n.params)==null?void 0:E.api),m=T=>{r.value=T,C(T)},v=T=>{var x,k,I;p({rowId:String((k=(x=n.params)==null?void 0:x.data)==null?void 0:k.id),field:`metric_${((I=u.value)==null?void 0:I.id)||""}`,value:T})},C=async T=>{var x,k,I,F;b.value=n.value,v(void 0);try{const A=await((F=s.value)==null?void 0:F.bulkUpdateMetric({workspaceId:n.workspaceId||"",itemIds:[((k=(x=n.params)==null?void 0:x.data)==null?void 0:k.id)||""],value:T==0||T===null?null:T.toString(),metricId:((I=u.value)==null?void 0:I.id)||""}));if((A==null?void 0:A.message)=="Done")v(T),b.value=T;else throw new Error("Update failed")}catch{v(b.value)}},b=H(r.value),_=()=>{Mt(()=>{setTimeout(()=>{C(r.value)},100)})},w=K(()=>({disabled:n.disabled,error:l.value.isError,clickable:!0,readOnly:f.value||n.readOnly,isEmpty:l.value.isEmpty})),{argsMain:R}=bo(w);return(T,x)=>(j(),Ue(So,qt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},Z(R),{ref:"wrapperRef",actived:Z(o),size:32,tabindex:"0"}),{default:ye(()=>[Z(l).isRating&&Z(d).maxRating?qe((j(),Ue(EP,{key:0,modelValue:r.value,"onUpdate:modelValue":x[0]||(x[0]=k=>r.value=k),params:Z(d),readOnly:n.readOnly||Z(f),disabled:n.disabled,onHandleEnter:m},{icon:ye(()=>[ae(ft,{onClick:_,source:"rating",src:Z(h)()||"Star",size:Z(c)},null,8,["src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[Z(t),{isLoading:Z(l).isLoading,fullwidth:!0}]]):Xe("",!0)]),_:1},16,["actived"]))}}),MK={style:{color:"#ff5200"}},lI=wt(ut({__name:"ImportVisual",props:{state:{},errorMessage:{},overwrite:{type:Boolean}},setup(e){return(t,n)=>(j(),le("div",{class:Y(t.$style["inform-layout"])},[e.state==="importing"?(j(),le("div",{key:0,class:Y(t.$style["import-error"]),style:{width:"500px"}},[ae(Z(sg),{src:"UploadInProgress","max-height":180,"max-width":180})],2)):e.state==="error"?(j(),le("div",{key:1,class:Y(t.$style["import-error"]),style:{width:"500px"}},[ae(Z(sg),{src:"Unsuccessful1","max-height":180,"max-width":180}),pe("span",{class:Y(t.$style["step-title"])}," File doesn’t meet requirements. Check file and try again. ",2),pe("div",MK,[pe("span",{class:Y(t.$style["step-description"])},"Error code",2),pe("span",{class:Y(t.$style["step-description"])},yt(e.errorMessage),3)])],2)):e.state==="success"?(j(),le(Pt,{key:2},[ae(Z(sg),{src:"Successful1","max-height":180,"max-width":180}),pe("span",{class:Y(t.$style["step-title"])},yt(e.overwrite?`Existing data will be overwritten in the background.
|
|
160
|
+
</svg>`,i=Ud(),{showMessage:r}=i,a=H(!1),l=H(!1),u=e,c=H({file:null,format:null,isValid:void 0}),d=K(()=>{var x;return((x=u.acceptTypes)==null?void 0:x.map(k=>`.${k}`).join(","))||".xlsx,.xls,.csv"}),h=K(()=>c.value.format?s(c.value.format):""),f=K(()=>{var x;if(!c.value.isValid)return`Invalid file type. Please upload a ${(x=u.acceptTypes)==null?void 0:x.join(", ")} file.`}),p=K(()=>!!c.value.file),m=()=>{var x;(x=o.value)==null||x.click()},v=K(()=>c.value.file?c.value.file.name:""),C=x=>{var F;const k=u.acceptTypes||["xlsx","xls","csv"],I=(F=x.name.split(".").pop())==null?void 0:F.toLowerCase();return I?k.includes(I):!1},b=x=>{var I,F;const k=C(x);x&&k?(c.value.isValid=k,a.value=!1,c.value.file=x,c.value.format=((I=x.name.split(".").pop())==null?void 0:I.toLowerCase())||null):r(`Invalid file type. Please upload a ${(F=u.acceptTypes)==null?void 0:F.join(", ")} file.`,"error")},_=x=>{const k=x.target;if(k.files&&k.files[0]){const I=k.files[0];b(I)}},w=()=>{l.value=!0},R=()=>{l.value=!1},E=x=>{if(l.value=!1,x.dataTransfer&&x.dataTransfer.files&&x.dataTransfer.files[0]){const k=x.dataTransfer.files[0];b(k)}},T=n;return nt(c,x=>{T("update:modelValue",x)},{deep:!0}),t({internalValue:c,clear:()=>{o.value&&(o.value.value=""),c.value={file:null,format:null},a.value=!1}}),(x,k)=>{const I=$c("tooltip");return j(),le("div",{class:Y([x.$style["drop-area"],{[x.$style["is-dragging"]]:l.value,[x.$style.error]:a.value}]),onDragenter:Gt(w,["prevent"]),onDragover:Gt(w,["prevent"]),onDragleave:Gt(R,["prevent"]),onDrop:Gt(E,["prevent"]),onClick:m},[p.value?Xe("",!0):(j(),le("div",{key:0,class:Y(x.$style["drop-area-content"])},[ae(ft,{src:"Upload",size:"24",color:"#3C9BFA"}),pe("span",null,[ae(pt,{variant:["tertiary","text"],class:Y(x.$style["upload-btn"])},{default:ye(()=>[...k[0]||(k[0]=[at(" Click to upload ",-1)])]),_:1},8,["class"]),k[1]||(k[1]=at(" or drag and drop files here ",-1))])],2)),p.value?qe((j(),le("div",{key:1,class:Y(x.$style["drop-area-file"])},[pe("div",{innerHTML:h.value},null,8,hK),qe((j(),le("span",{class:Y(x.$style["file-name"])},[at(yt(v.value),1)],2)),[[I,{content:v.value}]])],2)),[[I,f.value]]):Xe("",!0),pe("input",{ref_key:"fileInput",ref:o,type:"file",style:{display:"none"},accept:d.value,onChange:_},null,40,fK)],34)}}}),[["__cssModules",{$style:{"upload-btn":"_upload-btn_1ybeg_1","drop-area":"_drop-area_1ybeg_8","is-dragging":"_is-dragging_1ybeg_18",error:"_error_1ybeg_22","drop-area-content":"_drop-area-content_1ybeg_26","drop-area-file":"_drop-area-file_1ybeg_34","file-name":"_file-name_1ybeg_42","clear-button":"_clear-button_1ybeg_51"}}]]),BC=ll("userStore",()=>{const e=H(null),t=H(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),pK={style:{"text-align":"left",width:"100%"}},gK={key:0},mK=["innerHTML"],vK=20,yK=wt(ut({__name:"FilterAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s}=lo({appendTo:"parent",offset:[0,0]}),{triggerRef:i,popupRef:r,isVisible:a}=lo({appendTo:"parent",offset:[0,2]}),l=()=>{h()},{triggerRef:u,popupRef:c,isVisible:d,show:h}=lo({appendTo:"parent",offset:[0,2]}),f=H(null),p=()=>{M.value=[],vt.value=!1,Ct.value=!1,te.value="any"},m=K(()=>a.value||d.value),v=K(()=>{var W;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((W=M.value)==null?void 0:W.length)===0,wrapperRef:s,active:m,bordered:!0}}),{argsMain:C}=bo(v),b=en,_=n,w=K(()=>{var W;return Math.max(0,(((W=M.value)==null?void 0:W.length)||0)-o.maxVisible)}),R=K(()=>{var W;return w.value<=0?"":((W=M.value)==null?void 0:W.slice(o.maxVisible).map(fe=>fe.name).join(", "))||""}),E=H(!1),T=H(!1),x=H(null),k=H(1),I=H(!0),F=H(0),A=H(""),M=H([]),V=K(()=>{var W;return((W=M.value)==null?void 0:W.map(fe=>fe.id))||[]}),{assigneeList:X,mergedOptions:O}=fT({...o,value:[]}),{apiServices:B}=eo(!1,o),N=async(W=1,fe="",Ee=!1)=>{var Pe,Be,Ne,Le,Oe;if(!B.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Ee?T.value=!0:E.value=!0,x.value=null,!((Pe=B.value)!=null&&Pe.getEntityUserRoles))throw new Error("API service getEntityUserRoles is undefined");const Te=Fn.getInstance().getItem("ws.code");try{const Ye=await((Be=B.value)==null?void 0:Be.getEntityUserRoles({workspaceId:String(Te),page:W,per_page:vK,display_name_like:fe,include:"user,ws_role"})),Ge=((Ne=Id(Ye.data))==null?void 0:Ne.map(Aw))??[];X.value=Ee?wd(X.value,Ge,"id"):Ge,F.value=Ye.meta.total,I.value=(((Le=Ye==null?void 0:Ye.meta)==null?void 0:Le.current_page)||0)<(((Oe=Ye==null?void 0:Ye.meta)==null?void 0:Oe.last_page)||0),k.value=W}catch(Ye){console.error("Error fetching assignable users:",Ye),x.value="Failed to load assignable users"}finally{E.value=!1,T.value=!1}},z=W=>{var fe,Ee;if((fe=M.value)!=null&&fe.some(Te=>Te.id===W.data.id)){M.value=(Ee=M.value)==null?void 0:Ee.filter(Te=>Te.id!==W.data.id);return}M.value=[...M.value||[],W.data]},q=()=>{!T.value&&I.value&&N(k.value+1,A.value,!0)},de=_i(async W=>{A.value=W,await N(1,W,!1)},pr);nt(()=>d.value,W=>{var fe;W&&(N(1,A.value,!1),(fe=f.value)==null||fe.focus())});const ve=K(()=>{var W;return((W=M.value)==null?void 0:W.slice(0,3))||[]}),se=K(()=>ve.value.map(W=>({id:W.id,name:W.name,initial:W.initial,avatarId:W.id,profile_image:W.profile_image,color:W.color,size:24,user:W}))),te=H("any"),J=W=>{te.value=W.id},he=K(()=>[{label:"Any",value:"any",id:"any",selected:te.value==="any"},{label:"All",value:"all",id:"all",selected:te.value==="all"}]),be=K(()=>te.value==="any"?"Any":te.value==="all"?"All":""),$e=BC(),{user:Se}=Is($e),ct=K(()=>{if(!Se.value)return{id:"",name:"Unknown",initial:"U",profile_image:null,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}};const W=Se.value;return{id:W.id,name:W.first_name,initial:"Me",profile_image:W.avatar,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}}}),Ct=H(!1),vt=H(!1);t({getData:()=>({assignees:M.value,showNoAssignee:Ct.value,showMe:vt.value,selectedTypeId:te.value}),clear:p,setData:W=>{M.value=W.assignees||[],Ct.value=W.showNoAssignee||!1,vt.value=W.showMe||!1,te.value=W.selectedTypeId||"any"}}),nt([M,Ct,vt,te],()=>{_("updated",{assignees:M.value,showNoAssignee:Ct.value,showMe:vt.value,selectedTypeId:te.value})},{deep:!0});const G=W=>{var Ee;const fe=Fn.getInstance().getItem("ws.code");return((Ee=B.value)==null?void 0:Ee.getUserInformation(fe,W))||Promise.resolve(null)};return(W,fe)=>(j(),le(Pt,null,[ae(So,qt(Z(C),{ref_key:"triggerRef",ref:s,bordered:!0,style:{"--box-padding":"0 4px 0 0","--icon-size":"18px"}}),{suffix:ye(({hovered:Ee,focused:Te})=>{var Pe;return[(M.value&&((Pe=M.value)==null?void 0:Pe.length)>0||Ct.value||vt.value)&&(Ee||Te)?(j(),le("div",{key:0,class:"wrapper-suffix",onClick:Gt(p,["stop","prevent"])},[ae(pt,{variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),pe("div",{class:Y(["wrapper-suffix",{"icon-up":Z(d)}]),onClick:l},[ae(ft,{src:"ChevronDown",color:"#A6A6A6",size:"12"})],2)]}),default:ye(()=>[pe("div",{class:Y([W.$style["assignee-row"],W.$style["assignee-selector"]])},[qe((j(),le("div",null,[ae(pt,{variant:"text",ref_key:"triggerRef1",ref:i,size:30,disabled:Ct.value,style:an({background:Ct.value?"#D7D7D7":"transparent",borderRadius:Ct.value?"4px 0 0 4px":"",border:"none"})},{suffix:ye(()=>[ae(ft,{class:Y(["wrapper-suffix2",{"icon-up":Z(a)}]),src:"ChevronDown",color:"#A6A6A6",size:"12"},null,8,["class"])]),default:ye(()=>[pe("span",pK,yt(be.value),1)]),_:1},8,["disabled","style"])])),[[Z(b),{content:Ct.value?"Only ‘Any’ is allowed with ‘No assignee’":""}]]),pe("span",{class:Y([W.$style.seperator])},null,2),pe("div",{ref_key:"triggerRef2",ref:u,class:Y(W.$style["assignee-row"]),style:{flex:1}},[Ct.value&&te.value=="any"?(j(),le("div",gK,[pe("div",{class:Y(W.$style["unassign-icon"])},[...fe[2]||(fe[2]=[pe("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[pe("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)])):Xe("",!0),vt.value?(j(),Ue(Wd,{key:1,user:ct.value,"show-profile":!1},null,8,["user"])):Xe("",!0),(j(!0),le(Pt,null,In(se.value,Ee=>(j(),Ue(Wd,{user:Ee.user,key:Ee.user.id,apiUpdateFunction:G},null,8,["user"]))),128)),w.value>0?qe((j(),le("div",{key:2,class:Y(W.$style["extra-avatars"])},[at(" +"+yt(w.value),1)],2)),[[Z(b),R.value]]):Xe("",!0)],2)],2)]),_:1},16),pe("div",{ref_key:"popupRef1",ref:r,class:Y([W.$style.list])},[(j(!0),le(Pt,null,In(he.value,Ee=>(j(),Ue(na,qt({class:W.$style["list-item"],style:{width:"100px",minWidth:"100px"}},{ref_for:!0},Ee,{key:Ee.id,onClick:Te=>J(Ee)}),null,16,["class","onClick"]))),128))],2),pe("div",{ref_key:"popupRef2",ref:c},[ae(ul,qt({"selected-id":V.value},{...o},{options:Z(O),loading:E.value,"loading-more":T.value,"has-more":I.value,ref_key:"searchListRef",ref:f,onSelect:fe[1]||(fe[1]=Ee=>{z(Ee),_("start-update")}),onSearch:Z(de),onLoadMore:q}),{"extra-item":ye(({query:Ee})=>[te.value=="any"&&Ee.trim()===""?(j(),Ue(pt,{key:0,variant:"menu-item",onClick:fe[0]||(fe[0]=Te=>Ct.value=!Ct.value),actived:Ct.value,style:{"border-top-width":0,"border-bottom-width":0}},{prefix:ye(()=>[pe("div",{class:Y(W.$style["unassign-icon"])},[...fe[3]||(fe[3]=[pe("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[pe("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)]),default:ye(()=>[fe[4]||(fe[4]=at(" No assignee ",-1))]),_:1},8,["actived"])):Xe("",!0)]),item:ye(({item:Ee,selectedIndex:Te,isSelected:Pe,handleSelect:Be,handleItemHover:Ne,getHighlightedLabel:Le,query:Oe,idx:Ye})=>[ae(na,qt(Ee,{hover:Ye===Te,selected:Pe(Ee),type:Ee.type,onClick:Gt(Ge=>Be(Ee),["stop","prevent"]),onMouseover:Ge=>Ne(Ye),class:W.$style["item-assignee"]}),{prefix:ye(()=>[ae(Wd,{user:Ee.data,apiUpdateFunction:G},null,8,["user"])]),label:ye(({})=>[Oe?qe((j(),le("span",{key:0,class:Y([W.$style["item-label"],W.$style.match]),style:{flex:"1"},innerHTML:Le(Ee.label)},null,10,mK)),[[Z(b),{content:Ee.label}]]):qe((j(),le("span",{key:1,class:Y(W.$style["item-label"]),style:{flex:"1"}},[at(yt(Ee.label),1)],2)),[[Z(b),{content:Ee.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],64))}}),[["__cssModules",{$style:{action:"_action_13z4k_1","item-assignee":"_item-assignee_13z4k_6","item-action":"_item-action_13z4k_6","item-label":"_item-label_13z4k_16","unassign-icon":"_unassign-icon_13z4k_25","error-message":"_error-message_13z4k_37","empty-state":"_empty-state_13z4k_47","assignee-row":"_assignee-row_13z4k_60","assignee-selector":"_assignee-selector_13z4k_68",seperator:"_seperator_13z4k_73","extra-avatars":"_extra-avatars_13z4k_81",list:"_list_13z4k_92"}}]]),wK={key:0,class:"wrapper-suffix"},CK=wt(ut({__name:"FilterArchiveStatus",emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:o,popupRef:s,isVisible:i}=lo({appendTo:"parent",offset:[0,0]}),r=H([]),a=K(()=>[{label:"Archived",value:"archived",id:"archived",selected:r.value.includes("archived")},{label:"Not archived (Active)",value:"active",id:"active",selected:r.value.includes("active")}]),l=H("");nt(r,v=>{v.length===0?l.value="":v.length===2?l.value="All":v.length===1&&(l.value=v[0]==="archived"?"Archived":"Not archived (Active)")},{immediate:!0,deep:!0});const u=v=>{r.value.includes(v.value)?r.value=r.value.filter(C=>C!==v.value):r.value.push(v.value)},c=()=>{r.value=[]},d=()=>{r.value=[]},h=K(()=>i.value),f=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:r.value.length===0,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=bo(f);t({getData:()=>r.value,clear:c,setData:v=>{r.value=v},reset:d});const m=n;return nt(()=>r.value,v=>{m("updated",v)},{deep:!0}),(v,C)=>(j(),le(Pt,null,[ae(So,qt({ref_key:"triggerRef",ref:o},Z(p),{bordered:!0,style:{"--icon-size":"18px"},class:"border-f3f5f8"}),{suffix:ye(({hovered:b,focused:_})=>[r.value.length>0&&(b||_)?(j(),le("div",wK,[ae(pt,{onClick:Gt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),pe("div",{class:Y(["wrapper-suffix",{"icon-up":Z(i)}])},[ae(ft,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[(j(),le("span",{key:l.value,style:{cursor:"pointer"}},yt(l.value),1))]),_:1},16),pe("div",{ref_key:"popupRef",ref:s,class:Y(v.$style.list)},[(j(!0),le(Pt,null,In(a.value,b=>(j(),Ue(na,qt({class:v.$style["list-item"]},{ref_for:!0},b,{key:b.id,onClick:_=>u(b)}),null,16,["class","onClick"]))),128))],2)],64))}}),[["__cssModules",{$style:{list:"_list_h4ljx_2","list-item":"_list-item_h4ljx_9"}}]]),bK={key:0,class:"wrapper-suffix"},SK=wt(ut({__name:"FilterStatus",emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o=e,s={INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a}=lo({appendTo:"parent",offset:[0,0]}),l=H([]),u=H([]),c=H(!1),d=H(!1),h=H(null),f=H(s.INITIAL_PAGE),p=H(!0),m=H(0),v=H(""),C=n,b=K(()=>a.value),_=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:l.value.length===0,wrapperRef:i,active:b,bordered:!0})),w=H(null),{argsMain:R}=bo(_),E=K(()=>u.value.filter(z=>l.value.includes(z.id))),T=K(()=>{const z=E.value.length;return z===0?"":z===1?E.value[0].label:`${z} statuses `}),x=K(()=>l.value),k=K(()=>{if(l.value.length===0)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const z=E.value[0],q=String((z==null?void 0:z.color)||"white");return{backgroundColor:q,border:hp(q,"white")?"1px solid #ccc":"1px solid #fff"}}),I=z=>({label:z.name,value:z.id,selected:l.value.includes(z.id),hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:z,id:z.id,color:z.color}),{apiServices:F}=eo(!1,o),A=Ao("entityId"),M=async(z=s.INITIAL_PAGE,q="",de=!1)=>{var ve,se;de?d.value=!0:c.value=!0,h.value=null;try{const te=Fn.getInstance().getItem("ws.code"),J=await((ve=F.value)==null?void 0:ve.getTemplateFlowStatuses({workspaceId:te,entityId:A||"",name_like:q,page:z}));if(!J){de||(u.value=[]),p.value=!1;return}const he=J.data.map(I);u.value=de?[...u.value,...he]:he,m.value=((se=J.meta)==null?void 0:se.total)??J.data.length,p.value=u.value.length<m.value,f.value=z}catch(te){console.error("Error fetching statuses:",te),h.value="Failed to load statuses",de||(u.value=[]),p.value=!1,C("error",h.value)}finally{c.value=!1,d.value=!1}},V=z=>{const q=z.id;l.value.includes(q)?l.value=l.value.filter(ve=>ve!==q):l.value=[...l.value,q],C("update:modelValue",l.value)},X=async()=>{!p.value||d.value||await M(f.value+1,v.value,!0)},O=async z=>{v.value=z,f.value=s.INITIAL_PAGE,await M(s.INITIAL_PAGE,z,!1)},B=()=>{l.value=[],C("update:modelValue",[])},N=()=>{var z;(z=r.value)==null||z.focus()};return nt(()=>a.value,z=>{var q;z&&(M(1,v.value,!1),(q=w.value)==null||q.focus())}),nt(()=>l.value,z=>{C("updated",z)},{deep:!0}),t({focus:N,clear:B,getData:()=>l.value,setData:z=>{l.value=z}}),(z,q)=>{const de=$c("tooltip");return j(),le(Pt,null,[ae(So,qt({ref_key:"triggerRef",ref:i},Z(R),{style:{"--icon-size":"18px"},class:"border-f3f5f8",bordered:!0}),{suffix:ye(({hovered:ve,focused:se})=>[E.value.length>0&&(ve||se)?(j(),le("div",bK,[ae(pt,{onClick:Gt(B,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),pe("div",{class:Y(["wrapper-suffix",{"icon-up":Z(a)}])},[ae(ft,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[pe("div",{class:Y(z.$style.status)},[E.value.length==1?(j(),le("div",{key:0,class:Y(z.$style["color-indicator"]),style:an(k.value)},null,6)):Xe("",!0),qe((j(),le("span",{class:Y({[z.$style.empty]:E.value.length===0,[z.$style["status-text"]]:!0})},[at(yt(T.value),1)],2)),[[de,{content:T.value}]])],2)]),_:1},16),pe("div",{ref_key:"popupRef",ref:r},[ae(ul,{style:{width:"396px"},ref_key:"searchListRef",ref:w,"selected-id":x.value,options:u.value,loading:c.value,"loading-more":d.value,"has-more":p.value,error:h.value,onSearch:O,onSelect:V,onLoadMore:X,onCancel:q[0]||(q[0]=ve=>C("cancel"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1quat_2",status:"_status_1quat_6","color-indicator":"_color-indicator_1quat_12","count-badge":"_count-badge_1quat_25","status-text":"_status-text_1quat_32",empty:"_empty_1quat_41"}}],["__scopeId","data-v-2550b492"]]),EK={key:0},RK={key:1},_K={key:0},DK={key:1},xK={key:0,class:"wrapper-suffix"},TK={key:1,class:"wrapper-suffix"},aI=wt(ut({__name:"FilterDateRange",emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:o,popupRef:s,isVisible:i,hide:r}=lo({appendTo:"parent",offset:[0,0]}),a=()=>{l.value=[null,null]},l=H([null,null]),u=C=>{const b=Hp();return C?it.fromJSDate(C,{zone:b}).toFormat("dd/MM/yyyy"):""},c=K(()=>i.value),d=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:l.value[0]===null&&l.value[1]===null,wrapperRef:o,active:c,bordered:!0})),{argsMain:h}=bo(d),f=H(!1),p=C=>{"start"in C&&C.start!==void 0&&(l.value[0]=C.start),"end"in C&&C.end!==void 0&&(l.value[1]=C.end)};t({getData:()=>l.value,clear:a,setData:C=>{l.value=C}});const m=n;nt(()=>l.value,C=>{m("updated",C)},{deep:!0});const v=H(null);return nt(()=>i.value,C=>{C&&setTimeout(()=>{var b;(b=v.value)==null||b.focus()},0)}),(C,b)=>(j(),le(Pt,null,[ae(So,qt({ref_key:"triggerRef",ref:o},Z(h),{style:{"--icon-size":"18px",cursor:"pointer"},bordered:!0}),{default:ye(({focused:_})=>[pe("div",{class:Y(C.$style["date-time"])},[pe("div",{class:Y(C.$style.date)},[l.value[0]==null&&(_||Z(i))?(j(),le("span",EK,"DD/MM/YYYY")):(j(),le("span",RK,yt(u(l.value[0])),1))],2),l.value[0]!==null||l.value[1]!==null||_||Z(i)?(j(),le("div",{key:0,class:Y(C.$style.separator)}," → ",2)):Xe("",!0),pe("div",{class:Y(C.$style.date)},[l.value[1]==null&&(_||Z(i))?(j(),le("span",_K,"DD/MM/YYYY")):(j(),le("span",DK,yt(u(l.value[1])),1))],2)],2)]),suffix:ye(({hovered:_,focused:w})=>[(l.value[0]!==null||l.value[1]!==null)&&(_||w||Z(i))?(j(),le("div",xK,[ae(pt,{onClick:Gt(a,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ae(ft,{src:"XMarkSolid",size:"8"})]),_:1})])):(j(),le("div",TK,[ae(ft,{src:"Calendar",size:"12",color:"#A6A6A6"})]))]),_:1},16),pe("div",{ref_key:"popupRef",ref:s},[Z(i)?(j(),Ue(gC,{key:0,immediatelyUpdate:!1,value:l.value,onConfirmed:p,ref_key:"calendarRef",ref:v,onClosed:Z(r),onStartUpdate:b[0]||(b[0]=_=>f.value=!0),onFinishUpdate:b[1]||(b[1]=_=>f.value=!1)},null,8,["value","onClosed"])):Xe("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_1695v_2","date-time":"_date-time_1695v_5",date:"_date_1695v_5",separator:"_separator_1695v_16"}}]]),FK=wt(ut({__name:"Switch",props:{modelValue:{type:String,required:!0,validator:e=>["AND","OR"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,s=c=>{n.disabled||n.modelValue===c||o("update:modelValue",c)},i=K(()=>n.modelValue==="AND"?"left":"right"),r=K(()=>n.modelValue==="AND"&&l.value?l.value.offsetWidth+"px":n.modelValue==="OR"&&u.value?u.value.offsetWidth+"px":"calc(50% - 2px)"),a=K(()=>n.modelValue==="AND"?"translateX(0)":n.modelValue==="OR"&&l.value?`translateX(${l.value.offsetWidth+2}px)`:"translateX(0)"),l=H(null),u=H(null);return(c,d)=>(j(),le("div",{class:Y(["switch-container",{disabled:e.disabled}])},[pe("div",{class:Y(["slider",i.value]),style:an({width:r.value,transform:a.value})},null,6),pe("div",{class:Y(["option",{active:e.modelValue==="AND"}]),onClick:d[0]||(d[0]=h=>s("AND")),ref_key:"andRef",ref:l}," AND ",2),pe("div",{class:Y(["option",{active:e.modelValue==="OR"}]),onClick:d[1]||(d[1]=h=>s("OR")),ref_key:"orRef",ref:u}," OR ",2)],2))}}),[["__scopeId","data-v-0d89a13b"]]),th=wt(ut({__name:"FilterRow",props:{logic:{},label:{}},setup(e){return(t,n)=>(j(),le("div",{class:Y(t.$style["filter-line"])},[pe("div",{class:Y(t.$style["filter-logic"])},[pe("span",{class:Y(t.$style["filter-tag"])},[Ft(t.$slots,"logic",{},()=>[at(yt(e.logic),1)],!0)],2)],2),pe("span",null,yt(e.label),1),pe("span",null,[Ft(t.$slots,"is",{},()=>[n[0]||(n[0]=at("is",-1))],!0)]),pe("div",{class:Y(t.$style.selector)},[Ft(t.$slots,"default",{},void 0,!0)],2)],2))}}),[["__cssModules",{$style:{"filter-line":"_filter-line_ad5v0_1","filter-tag":"_filter-tag_ad5v0_8",selector:"_selector_ad5v0_28"}}],["__scopeId","data-v-62027e29"]]),PK={style:{height:"18px",width:"18px",display:"flex","align-items":"center","justify-content":"center"}},IK=["fill"],AK=["fill"],kK=wt(ut({__name:"FilterBox",props:{loading:{type:Boolean}},emits:["update:assignees","apply-filter"],setup(e,{expose:t,emit:n}){const o=Jo,s=en,i={ACTIVE:"#000",DEFAULT:"#3C9BFA"},{hide:r,isVisible:a,triggerRef:l,popupRef:u}=lo({offset:[0,0],maxWidth:650}),c=BC(),{workspaceUserRoleId:d}=Is(c),h=n,f=H(null),p=H(null),m=H(null),v=H(null),C=H(null),b=H(null),_=H(null),w=(J,he)=>{b.value={...b.value,[J]:he}},R=K(()=>d.value||""),E=H("AND"),T=K(()=>k.value?i.ACTIVE:i.DEFAULT),x=K(()=>({border:k.value?"2px solid var(--primary-color)":"",backgroundColor:k.value?"#F0F7FF":"",padding:k.value?"2px 0 2px 7px":"2px 7px",gap:"0"})),k=K(()=>M(_.value)>0),I=K(()=>M(b.value)),F=K(()=>I.value===0),A=K(()=>I.value<=1),M=J=>{var $e,Se,ct;let he=0;return J&&(((($e=J.assignees)==null?void 0:$e.assignees)&&J.assignees.assignees.length>0||((Se=J.assignees)==null?void 0:Se.showMe)||((ct=J.assignees)==null?void 0:ct.showNoAssignee))&&he++,J.statuses&&J.statuses.length>0&&he++,J.archiveStatuses&&J.archiveStatuses.length>0&&he++,J.startDateRange&&(J.startDateRange[0]||J.startDateRange[1])&&he++,J.dueDateRange&&(J.dueDateRange[0]||J.dueDateRange[1])&&he++),he},V=J=>J?J.toISOString():null,X=J=>{var vt;const he={};if(!J)return he;const be=((vt=J.assignees)==null?void 0:vt.map(G=>G.id))||[],$e=J.showMe,Se=J.showNoAssignee,ct=J.selectedTypeId,Ct=$e&&R.value?[...be,R.value]:be;if(Ct.length>0){const G=Ct.join(",");ct==="any"?he.assignee_any_ina=G||"":ct==="all"&&(he.assignee_all_ina=G)}return Se&&ct==="any"&&(he.with_not_assigned="1"),he},O=(J,he)=>{const be={},[$e,Se]=J;if($e&&Se){const ct=V($e),Ct=V(Se);ct&&Ct&&(be[`${he}_btw`]=`${ct},${Ct}`)}else if($e){const ct=V($e);ct&&(be[`${he}_gte`]=ct)}else if(Se){const ct=V(Se);ct&&(be[`${he}_lte`]=ct)}return be},B=J=>{const he={};Object.assign(he,X(J.assignees));const{statuses:be,archiveStatuses:$e,startDateRange:Se,dueDateRange:ct}=J;return be&&be.length>0&&(he.status_ina=be.join(",")),E.value=="AND"?he.condition_combine_type="and":he.condition_combine_type="or",Se&&Object.assign(he,O(Se,"start_date")),ct&&Object.assign(he,O(ct,"due_date")),!$e||$e.length===0?he.preflight_status="1":$e&&$e.length===1?he.status_eq=$e[0]==="archived"?"0":"1":$e&&$e.length===2?he.status_eq="0,1":Object.keys(he).length===0&&(he.status_eq="1"),he},N=J=>{if(J===null||typeof J!="object")return J;if(J instanceof Date)return new Date(J.getTime());if(Array.isArray(J))return J.map(be=>N(be));const he={};for(const be in J)Object.prototype.hasOwnProperty.call(J,be)&&(he[be]=N(J[be]));return he},z=()=>{var J,he,be,$e,Se;return{assignees:((J=f.value)==null?void 0:J.getData())||{},statuses:((he=p.value)==null?void 0:he.getData())||[],startDateRange:((be=m.value)==null?void 0:be.getData())||[null,null],dueDateRange:(($e=v.value)==null?void 0:$e.getData())||[null,null],archiveStatuses:((Se=C.value)==null?void 0:Se.getData())||[]}},q=J=>{var he,be,$e,Se,ct,Ct,vt,G,W,fe,Ee,Te,Pe,Be,Ne,Le,Oe,Ye,Ge,ht;if(!J){(be=(he=f.value)==null?void 0:he.clear)==null||be.call(he),(Se=($e=p.value)==null?void 0:$e.clear)==null||Se.call($e),(Ct=(ct=m.value)==null?void 0:ct.clear)==null||Ct.call(ct),(G=(vt=v.value)==null?void 0:vt.clear)==null||G.call(vt),(fe=(W=C.value)==null?void 0:W.clear)==null||fe.call(W);return}J.assignees&&((Te=(Ee=f.value)==null?void 0:Ee.setData)==null||Te.call(Ee,J.assignees)),J.statuses&&((Be=(Pe=p.value)==null?void 0:Pe.setData)==null||Be.call(Pe,J.statuses)),J.startDateRange&&((Le=(Ne=m.value)==null?void 0:Ne.setData)==null||Le.call(Ne,J.startDateRange)),J.dueDateRange&&((Ye=(Oe=v.value)==null?void 0:Oe.setData)==null||Ye.call(Oe,J.dueDateRange)),J.archiveStatuses&&((ht=(Ge=C.value)==null?void 0:Ge.setData)==null||ht.call(Ge,J.archiveStatuses))},de=()=>{const J=z(),he=B(J);_.value=N(J),b.value=N(J),h("apply-filter",he),r()},ve=()=>{var J,he,be,$e,Se,ct,Ct,vt,G,W;(he=(J=f.value)==null?void 0:J.clear)==null||he.call(J),($e=(be=p.value)==null?void 0:be.clear)==null||$e.call(be),(ct=(Se=m.value)==null?void 0:Se.clear)==null||ct.call(Se),(vt=(Ct=v.value)==null?void 0:Ct.clear)==null||vt.call(Ct),(W=(G=C.value)==null?void 0:G.clear)==null||W.call(G),E.value="AND",b.value=null},se=()=>{ve(),_.value=null,b.value=null,h("apply-filter",{preflight_status:"1"})};nt(I,J=>{J==0&&(E.value="AND")});const te=()=>{_.value?(q(N(_.value)),b.value=N(_.value)):(q(null),b.value=null)};return nt(a,(J,he)=>{J&&!he?_.value&&(q(N(_.value)),b.value=N(_.value)):!J&&he&&te()}),t({getData:z,getParams:()=>B(z()),clear:se,revertToCache:te}),(J,he)=>{var be,$e;return j(),le(Pt,null,[qe((j(),Ue(pt,{variant:"secondary",ref_key:"triggerRef",ref:l,actived:Z(a)||k.value,style:an(x.value)},Gc({prefix:ye(()=>[pe("div",PK,[(j(),le("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:T.value,xmlns:"http://www.w3.org/2000/svg"},[pe("path",{d:"M0.0998533 0.587105C0.269063 0.228176 0.627991 0 1.02538 0H12.1009C12.4983 0 12.8572 0.228176 13.0264 0.587105C13.1956 0.946034 13.1443 1.36906 12.8931 1.67671L8.20395 7.40675V10.6653C8.20395 10.9755 8.02961 11.2601 7.75016 11.3986C7.47071 11.537 7.13998 11.5088 6.8913 11.3216L5.25048 10.091C5.04281 9.9372 4.92232 9.69364 4.92232 9.4347V7.40675L0.230606 1.67415C-0.0180804 1.36906 -0.0719197 0.94347 0.0998533 0.587105Z",fill:T.value},null,8,AK)],8,IK))])]),default:ye(()=>[pe("span",{style:an({color:T.value})},"Filter",4)]),_:2},[k.value?{name:"suffix",fn:ye(()=>[pe("div",{onClick:Gt(se,["stop","prevent"]),style:{height:"24px",width:"24px",display:"flex","align-items":"center","justify-content":"center"},class:"rotate-icon"},[ae(ft,{src:"Xmark",size:10,color:T.value},null,8,["color"])])]),key:"0"}:void 0]),1032,["actived","style"])),[[Z(o),{isLoading:e.loading,fullwidth:!0}]]),pe("div",{ref_key:"popupRef",ref:u},[pe("div",{class:Y(J.$style["basic-filter"])},[pe("div",{class:Y(J.$style.row)},[pe("span",{class:Y(J.$style["filter-header"])},[he[6]||(he[6]=at(" Filters ",-1)),qe(ae(FK,{modelValue:E.value,"onUpdate:modelValue":he[0]||(he[0]=Se=>E.value=Se),disabled:A.value},null,8,["modelValue","disabled"]),[[Z(s),{content:A.value?"Available only when more than one filter is selected.":"",bypassOverflowCheck:!0}]])],2),I.value>0||(($e=(be=b.value)==null?void 0:be.assignees)==null?void 0:$e.selectedTypeId)=="all"?(j(),le("div",{key:0,class:Y(J.$style.row)},[ae(pt,{size:"small",variant:"secondary",onClick:ve},{default:ye(()=>[...he[7]||(he[7]=[at(" Clear all ",-1)])]),_:1})],2)):Xe("",!0)],2),ae(th,{logic:E.value,label:"Assignee"},{logic:ye(()=>[...he[8]||(he[8]=[at("Where",-1)])]),default:ye(()=>[ae(yK,{ref_key:"FilterAssigneeRef",ref:f,onUpdated:he[1]||(he[1]=Se=>w("assignees",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Status"},{default:ye(()=>[ae(SK,{ref_key:"FilterStatusRef",ref:p,onUpdated:he[2]||(he[2]=Se=>w("statuses",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Start Date"},{default:ye(()=>[ae(aI,{ref_key:"FilterStartDateRangeRef",ref:m,onUpdated:he[3]||(he[3]=Se=>w("startDateRange",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Due Date"},{default:ye(()=>[ae(aI,{ref_key:"FilterDueDateRangeRef",ref:v,onUpdated:he[4]||(he[4]=Se=>w("dueDateRange",Se))},null,512)]),_:1},8,["logic"]),ae(th,{logic:E.value,label:"Archive Status"},{default:ye(()=>[ae(CK,{ref_key:"FilterArchiveStatusRef",ref:C,onUpdated:he[5]||(he[5]=Se=>w("archiveStatuses",Se))},null,512)]),_:1},8,["logic"]),pe("div",{class:Y([J.$style.row,J.$style["justify-end"]])},[ae(pt,{size:"small",onClick:de,disabled:F.value},{default:ye(()=>[...he[9]||(he[9]=[at(" Apply filter ",-1)])]),_:1},8,["disabled"])],2)],2)],512)],64)}}}),[["__cssModules",{$style:{row:"_row_19w8k_1","justify-end":"_justify-end_19w8k_7","basic-filter":"_basic-filter_19w8k_11","filter-grid":"_filter-grid_19w8k_22","filter-line":"_filter-line_19w8k_27","filter-tag":"_filter-tag_19w8k_34",selector:"_selector_19w8k_49","filter-header":"_filter-header_19w8k_59"}}]]),OK=ut({__name:"RatingRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},setup(e){var E;const t=Jo,n=e,{isEditing:o}=$d(n),{apiServices:s}=eo(!0,n),i=K(()=>{var T,x;return{value:r.value,metricConfig:(x=(T=n.params)==null?void 0:T.colDef)==null?void 0:x.context,error:n.error,hovered:!1,readOnly:n.disabled,disabled:n.readOnly,apiServices:s.value}}),r=H(Number(n.value)),a=H(!1),{componentState:l,metricConfig:u,ICON_SIZE:c,ratingParams:d,standardNameforIcon:h,isMetricReadonly:f}=PP(i,a),{updateCellData:p}=sI((E=n.params)==null?void 0:E.api),m=T=>{r.value=T,C(T)},v=T=>{var x,k,I;p({rowId:String((k=(x=n.params)==null?void 0:x.data)==null?void 0:k.id),field:`metric_${((I=u.value)==null?void 0:I.id)||""}`,value:T})},C=async T=>{var x,k,I,F;b.value=n.value,v(void 0);try{const A=await((F=s.value)==null?void 0:F.bulkUpdateMetric({workspaceId:n.workspaceId||"",itemIds:[((k=(x=n.params)==null?void 0:x.data)==null?void 0:k.id)||""],value:T==0||T===null?null:T.toString(),metricId:((I=u.value)==null?void 0:I.id)||""}));if((A==null?void 0:A.message)=="Done")v(T),b.value=T;else throw new Error("Update failed")}catch{v(b.value)}},b=H(r.value),_=()=>{Mt(()=>{setTimeout(()=>{C(r.value)},100)})},w=K(()=>({disabled:n.disabled,error:l.value.isError,clickable:!0,readOnly:f.value||n.readOnly,isEmpty:l.value.isEmpty})),{argsMain:R}=bo(w);return(T,x)=>(j(),Ue(So,qt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},Z(R),{ref:"wrapperRef",actived:Z(o),size:32,tabindex:"0"}),{default:ye(()=>[Z(l).isRating&&Z(d).maxRating?qe((j(),Ue(EP,{key:0,modelValue:r.value,"onUpdate:modelValue":x[0]||(x[0]=k=>r.value=k),params:Z(d),readOnly:n.readOnly||Z(f),disabled:n.disabled,onHandleEnter:m},{icon:ye(()=>[ae(ft,{onClick:_,source:"rating",src:Z(h)()||"Star",size:Z(c)},null,8,["src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[Z(t),{isLoading:Z(l).isLoading,fullwidth:!0}]]):Xe("",!0)]),_:1},16,["actived"]))}}),MK={style:{color:"#ff5200"}},lI=wt(ut({__name:"ImportVisual",props:{state:{},errorMessage:{},overwrite:{type:Boolean}},setup(e){return(t,n)=>(j(),le("div",{class:Y(t.$style["inform-layout"])},[e.state==="importing"?(j(),le("div",{key:0,class:Y(t.$style["import-error"]),style:{width:"500px"}},[ae(Z(sg),{src:"UploadInProgress","max-height":180,"max-width":180})],2)):e.state==="error"?(j(),le("div",{key:1,class:Y(t.$style["import-error"]),style:{width:"500px"}},[ae(Z(sg),{src:"Unsuccessful1","max-height":180,"max-width":180}),pe("span",{class:Y(t.$style["step-title"])}," File doesn’t meet requirements. Check file and try again. ",2),pe("div",MK,[pe("span",{class:Y(t.$style["step-description"])},"Error code",2),pe("span",{class:Y(t.$style["step-description"])},yt(e.errorMessage),3)])],2)):e.state==="success"?(j(),le(Pt,{key:2},[ae(Z(sg),{src:"Successful1","max-height":180,"max-width":180}),pe("span",{class:Y(t.$style["step-title"])},yt(e.overwrite?`Existing data will be overwritten in the background.
|
|
161
161
|
Refresh to see updates.`:"Work will be created in background. Refresh to see updates."),3)],64)):Xe("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_1og33_1","import-error":"_import-error_1og33_11","step-title":"_step-title_1og33_22","step-description":"_step-description_1og33_27"}}]]),uI=wt(ut({__name:"DateRule",setup(e){const n=(()=>{const s=(h,f,p,m)=>{const v=document.createElement("span");return v.textContent=h,v.style.fontWeight=f,v.style.fontSize=p,v.style.color=m,v},i=document.createElement("div");i.style.display="flex",i.style.flexDirection="column";const r=document.createElement("div"),a=document.createElement("div"),l=s("Valid formats:","normal","14px","#02C39A"),u=s("Invalid formats:","normal","14px","#FF5200"),c=s(" 2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=s(" 12.31.2025, 2025.31.12","normal","14px","");return r.appendChild(l),r.appendChild(c),a.appendChild(u),a.appendChild(d),i.appendChild(r),i.appendChild(a),i.outerHTML})(),o=en;return(s,i)=>(j(),le("div",{class:Y(s.$style["date-format-guide"])},[pe("span",{class:Y(s.$style["step-title-2"])},[i[0]||(i[0]=at(" Date format guide ",-1)),qe(ae(Z(ft),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[Z(o),{content:Z(n)}]])],2),pe("div",{class:Y(s.$style["date-rule-section"])},[i[3]||(i[3]=pe("span",null,"Enter dates in one of these formats:",-1)),pe("ul",{class:Y(s.$style["step-description"])},[pe("li",{class:Y(s.$style["date-rule"])},[...i[1]||(i[1]=[pe("b",null,"DD MM YYYY",-1),at(" (Day-Month-Year) ",-1)])],2),pe("li",{class:Y(s.$style["date-rule"])},[...i[2]||(i[2]=[pe("b",null,"YYYY MM DD",-1),at(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_ef59d_1","step-title-2":"_step-title-2_ef59d_13","date-rule-section":"_date-rule-section_ef59d_25","step-description":"_step-description_ef59d_29","date-rule":"_date-rule_ef59d_25"}}]]),LK={key:1},NK=wt(ut({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=H(null),s=e,i=()=>{o.value&&o.value.show()},r=H(""),a=H("idle"),l=K(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),u=H(null),c=H({file:null,format:null}),{apiServices:d}=eo(!1,s),h=async I=>{var A,M;if(((A=d==null?void 0:d.value)==null?void 0:A.getStatuses)===void 0){console.error("API services not available",(M=d==null?void 0:d.value)==null?void 0:M.getStatuses);return}return await d.value.getStatuses(s.workspaceId,s.entityId,I)},f=H(!1),p=async()=>{f.value=!0;const I=s.workspaceId,F=s.entityId;if(!I||!F||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(I,F))throw new Error("No response from downloadTemplate API")}catch(A){console.error("Error downloading template:",A)}f.value=!1},m=async I=>{var M,V,X;const F=new FormData,A=((M=I.name.split(".").pop())==null?void 0:M.toString())||"";if(F.append("file",I),F.append("format",A),F.append("template_flow_status_id",R.value||""),!d.value||!s.workspaceId||!s.entityId){console.error("API services not available");return}try{await d.value.addNewSceneViaImportFile(s.workspaceId,s.entityId,F),v()}catch(O){throw console.error("Error uploading file:",O),C(((X=(V=O.response)==null?void 0:V.data)==null?void 0:X.message)||"An unknown error occurred during file upload."),O}},v=()=>{a.value="success"},C=I=>{r.value=I,a.value="error"},b=n,_=()=>{b("import-success"),k()},w=async()=>{if(!c.value||!c.value.file){console.error("No file to upload");return}a.value="importing",await m(c.value.file)};t({open:i});const R=H(null),E=K(()=>!c.value.file||!c.value.format||!c.value.isValid||!R.value),T=H(null),x=()=>{var I,F;(I=u.value)==null||I.clear(),r.value="",c.value={file:null,format:null},R.value=null,(F=T==null?void 0:T.value)==null||F.clear(),a.value="idle"},k=()=>{var I;x(),(I=o.value)==null||I.hide()};return(I,F)=>(j(),Ue(Z(kP),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:x},Gc({default:ye(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),Ue(lI,{key:0,state:a.value,"error-message":r.value},null,8,["state","error-message"])):(j(),le("div",LK,[pe("div",{class:Y(I.$style["step-section"])},[pe("span",{class:Y(I.$style["step-title"])},"Step 1: Download sample file",2),pe("span",{class:Y(I.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),ae(Z(pt),{class:Y(I.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:f.value,onHandleClick:p},{prefix:ye(()=>[ae(Z(ft),{src:"Download"})]),default:ye(()=>[F[2]||(F[2]=at(" Download sample file ",-1))]),_:1},8,["class","disabled"])],2),pe("div",{class:Y(I.$style["step-section"])},[pe("span",{class:Y(I.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),ae(Z(rI),{modelValue:c.value,"onUpdate:modelValue":F[0]||(F[0]=A=>c.value=A),ref_key:"filUploaderRef",ref:u},null,8,["modelValue"])],2),pe("div",{class:Y(I.$style["step-section"])},[pe("span",{class:Y(I.$style["step-title"])},"Step 3: Select status",2),pe("span",{class:Y(I.$style["step-description"])},"Choose a status for the new work.",2),ae(Z(rK),{ref_key:"statusRef",ref:T,modelValue:R.value,"onUpdate:modelValue":F[1]||(F[1]=A=>R.value=A),"get-status-func":h,"workspace-id":s.workspaceId,id:s.entityId},null,8,["modelValue","workspace-id","id"])],2),pe("div",{class:Y(I.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ae(uI)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"secondary",onClick:k},{default:ye(()=>[...F[3]||(F[3]=[at(" Cancel ",-1)])]),_:1}),ae(Z(pt),{disabled:E.value,style:{flex:"1"},variant:"primary",onClick:w},{default:ye(()=>[...F[4]||(F[4]=[at(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"primary",onClick:_},{default:ye(()=>[...F[5]||(F[5]=[at(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"primary",onClick:x},{default:ye(()=>[...F[6]||(F[6]=[at(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_jt1wo_1","step-title":"_step-title_jt1wo_11","step-title-2":"_step-title-2_jt1wo_17","step-description":"_step-description_jt1wo_23","date-format-guide":"_date-format-guide_jt1wo_28","import-error":"_import-error_jt1wo_39","drop-area":"_drop-area_jt1wo_49","is-dragging":"_is-dragging_jt1wo_49","drop-area-content":"_drop-area-content_jt1wo_52",browse:"_browse_jt1wo_61","download-sample-btn":"_download-sample-btn_jt1wo_65"}}]]),cI={text:oa,id:void 0,assignees:i9,status:m9,dateRange:r9,isStarted:oa,isCompleted:oa,lastUpdated:oa,completedOn:oa,isDeleted:oa,isArchived:oa,isProcessing:oa,name:TP,options:r7,metric:IP,__checkboxSelection:void 0},VK={text:!1,id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1},BK={text:null,id:void 0,assignees:CP,status:xP,dateRange:a9,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:TP,options:FP,metric:void 0,__checkboxSelection:void 0},HK={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50],text:[200,300]},$K={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized",editable:!0}},GK=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},Cg=e=>{var t;if(((t=e==null?void 0:e.auth_permission)==null?void 0:t.permission)==2)return GK(e)};function HC(e,t){var i;const n=t==null?void 0:t.permissions;if(!t||!e)return{disabled:!1,readOnly:!1,type:void 0};if(e==="options")return{disabled:!1,readOnly:!1,type:void 0};if(e!=null&&e.includes("metric"))return{disabled:!1,readOnly:((i=t.auth_permission)==null?void 0:i.permission)!==2&&!t.formula,type:Cg(t)};if(!n)return{disabled:!1,readOnly:!1,type:void 0};const s={assignees:n.has_update_assignee_permission||0,completedOn:0,name:0,permissions:0,status:n.has_edit_template_flow_status_permission||0,dateRange:n.has_edit_date_permission||0,isStarted:0,isDeleted:0,isArchived:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1}[e]??0;return{disabled:s===-1,readOnly:s!==1,type:void 0}}class nh{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t){var r,a,l,u;const n=t.data||((r=t.node)==null?void 0:r.data),o=(a=t.colDef)==null?void 0:a.field,s=o&&n?n[o]:void 0,i=HC((l=t.colDef)==null?void 0:l.field,(u=t.colDef)==null?void 0:u.context);return{...t,value:s,disabled:i==null?void 0:i.disabled,readOnly:i==null?void 0:i.readOnly,type:i==null?void 0:i.type}}static resolveRendererComponent(t,n){let o;return t.includes("metric")&&cI.metric?Cg(n)==="rating"?o=OK:o=IP:o=cI[t]??void 0,o}static resolveEditorComponent(t,n){const o=t.includes("metric");let s;const i=Cg(n);return o&&["number","dropdown"].includes(i)?s=lK:s=BK[t],s}static canEditField(t,n){var i,r;if(n.data===void 0)return!1;const o=HC((i=n.colDef)==null?void 0:i.field,(r=n.colDef)==null?void 0:r.context),s=VK[t]??!0;return!(o!=null&&o.disabled)&&!(o!=null&&o.readOnly)&&s&&(o==null?void 0:o.type)!=="rating"}static resolveSize(t){const[n=200,o=300]=HK[t]??[];return{minWidth:n,maxWidth:o}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){var c;const{wrapVueCellEditor:n}=this.getWrappers(),o=String(t.field??""),s=this.resolveSize(o),i=$K[o]??{},r=(c=HC(o,t.context))==null?void 0:c.type,a=r==="number"||r==="rating",l=r=="rating"?t.context.range*24+20:s.minWidth;return{...t,headerName:t.headerName,...s,...t,cellEditorSelector:d=>{const h=this.resolveEditorComponent(o,t.context);return{component:n(h),params:t.cellRendererParams??this.buildCommonCellParams,popup:!a}},singleClickEdit:!0,cellEditorPopup:!a,cellEditorPopupPosition:a?void 0:"under",editable:d=>{let h;return d.data===void 0||d.node.data===void 0?h=!1:h=this.canEditField(o,d),h},minWidth:l,cellRendererSelector:d=>({component:n(this.resolveRendererComponent(o,t.context)),params:t.cellRendererParams??this.buildCommonCellParams}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...i,cellClass:d=>`${r}--${d.colDef.field}`}}}Qn(nh,"wrappers",null);const WK=wt(ut({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5}},setup(e){const t=K(()=>o.value=="MoreOption"?"100%":`${Math.floor(Math.random()*31)+60}%`),n=e,o=K(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),s=K(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),i=K(()=>o.value=="EmptyData"||"eGridHeader"in n.params?!1:o.value=="MoreOption"||o.value=="MoreOptionEditor"?!n.params.data:n.value===void 0),r=K(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData}));return(a,l)=>i.value?(j(),le("div",{key:0,style:an({"--width":t.value}),class:Y(a.$style.skeleton)},[pe("div",{class:Y(a.$style.shimmer)},null,2)],6)):(j(),Ue(BE(s.value),lv(qt({key:1},r.value)),null,16))}}),[["__cssModules",{$style:{skeleton:"_skeleton_pqal2_1","skeleton-loading":"_skeleton-loading_pqal2_1",shimmer:"_shimmer_pqal2_15"}}]]);function UK(e){return"stopEditing"in e}const zK=8;function dI(e){return class{constructor(){Qn(this,"container");Qn(this,"vNode",null);Qn(this,"componentInstance",null);Qn(this,"params");Qn(this,"isEditor",!1);Qn(this,"_destroyed",!1)}init(n){var l,u,c;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const o=performance.now();this.params=n,this.isEditor=UK(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const s=n.context.apiClass,i=n,r={component:e,params:Object.freeze(n),disabled:!1,readOnly:i.readOnly??!1,value:n.value,maxRating:i.maxRating??void 0,data:n.data,id:(l=n==null?void 0:n.data)==null?void 0:l.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:s,tooltip:i.tooltip??void 0,isSearching:i.isSearching??!1,isFiltering:i.isFiltering??!1,isNoData:i.isNoData??!1};this.vNode=ae(WK,r),a_(this.vNode,this.container);const a=performance.now()-o;a>zK&&console.warn(`[Vue3CellWrapper] Slow render (${a.toFixed(1)}ms) for "${(u=n.colDef)==null?void 0:u.field}"`),this.componentInstance=(c=this.vNode.component)==null?void 0:c.proxy}getGui(){return this.container}refresh(n){return!0}getValue(){var n,o,s;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((s=(o=this.componentInstance).getValue)==null?void 0:s.call(o))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var r,a,l,u,c;const o=(l=(a=(r=this.params)==null?void 0:r.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),s=((u=this.params)==null?void 0:u.context)&&Cg(this.params.context);return o||(s==="number"||s==="rating")||!this.isEditor?!1:(c=this.componentInstance)!=null&&c.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var o,s,i;return this.isEditor?(o=this.componentInstance)!=null&&o.getPopupPosition?this.componentInstance.getPopupPosition():((i=(s=this.params)==null?void 0:s.colDef)==null?void 0:i.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const n=this.componentInstance;if(n){try{typeof n.$destroy=="function"&&n.$destroy()}catch(s){console.warn("[Vue3CellWrapper] Error during $destroy:",s)}try{typeof n.destroy=="function"&&n.destroy()}catch(s){console.warn("[Vue3CellWrapper] Error during destroy():",s)}}(typeof queueMicrotask=="function"?queueMicrotask:s=>Promise.resolve().then(s))(()=>{try{a_(null,this.container)}catch(s){console.warn("[Vue3CellWrapper] Error during unmount:",s)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function bg(e){return dI(e)}function hI(e){return dI(e)}var pl=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const o=t?this.allAsyncListeners:this.allSyncListeners;let s=o.get(e);return!s&&n&&(s=new Set,o.set(e,s)),s}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const o=this.getListeners(e,n,!1);o&&(o.delete(t),o.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:o}=this,s=a=>{const l=o?()=>o.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},i=this.getListeners(n,t,!1);if(((i==null?void 0:i.size)??0)>0){const a=new Set(i);for(const l of a)i!=null&&i.has(l)&&s(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)s(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function Cr(e){return e==null||e===""?null:e}function et(e){return e!=null&&e!==""}function Sn(e){return!et(e)}function $C(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function oh(e,t){const n=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return n===o}function jK(e,t,n=!1){const o=e==null,s=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),o&&s)return 0;if(o)return-1;if(s)return 1;function i(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!n)return i(e,t);try{return e.localeCompare(t)}catch{return i(e,t)}}var KK=/[&<>"']/g,qK={"&":"&","<":"<",">":">",'"':""","'":"'"};function Wu(e){return(e==null?void 0:e.toString().toString())??null}function sh(e){var t;return((t=Wu(e))==null?void 0:t.replace(KK,n=>qK[n]))??null}function Ii(e){return e.eRootDiv.getRootNode()}function Dn(e){return Ii(e).activeElement}function no(e){const{gos:t,eRootDiv:n}=e;let o=null;const s=t.get("getDocument");return s&&et(s)?o=s():n&&(o=n.ownerDocument),o&&et(o)?o:document}function fI(e){const t=Dn(e);return t===null||t===no(e).body}function pI(e){return no(e).defaultView||window}function GC(e){let t=null,n=null;try{t=no(e).fullscreenElement}catch{}finally{t||(t=Ii(e));const o=t.querySelector("body");o?n=o:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function YK(e){const t=GC(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function ZK(e){const t=GC(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function si(e,t,n){n==null||typeof n=="string"&&n==""?gI(e,t):ks(e,t,n)}function ks(e,t,n){e.setAttribute(mI(t),n.toString())}function gI(e,t){e.removeAttribute(mI(t))}function mI(e){return`aria-${e}`}function aa(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function XK(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function JK(e){return e.getAttribute("aria-label")}function Uu(e,t){si(e,"label",t)}function ih(e,t){si(e,"labelledby",t)}function vI(e,t){si(e,"live",t)}function QK(e,t){si(e,"atomic",t)}function eq(e,t){si(e,"relevant",t)}function tq(e,t){si(e,"invalid",t)}function nq(e,t){si(e,"disabled",t)}function yI(e,t){si(e,"hidden",t)}function WC(e,t){ks(e,"expanded",t)}function oq(e,t){ks(e,"setsize",t)}function sq(e,t){ks(e,"posinset",t)}function iq(e,t){ks(e,"multiselectable",t)}function rq(e,t){ks(e,"rowcount",t)}function Sg(e,t){ks(e,"rowindex",t)}function aq(e,t){ks(e,"rowspan",t)}function lq(e,t){ks(e,"colcount",t)}function wI(e,t){ks(e,"colindex",t)}function uq(e,t){ks(e,"colspan",t)}function cq(e,t){ks(e,"sort",t)}function dq(e){gI(e,"sort")}function CI(e,t){si(e,"selected",t)}function hq(e,t){si(e,"controls",t)}function fq(e,t){hq(e,t.id),ih(t,e.id)}function bI(e,t){si(e,"owns",t)}function Eg(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var pq="[tabindex], input, select, button, textarea, [href]",SI="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function rh(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(SI)?!1:Ai(e)}function En(e,t,n={}){const{skipAriaHidden:o}=n;e.classList.toggle("ag-hidden",!t),o||yI(e,!t)}function gq(e,t,n={}){const{skipAriaHidden:o}=n;e.classList.toggle("ag-invisible",!t),o||yI(e,!t)}function ah(e,t){const n="disabled",o=t?i=>i.setAttribute(n,""):i=>i.removeAttribute(n);o(e);const s=e.querySelectorAll("input")??[];for(const i of s)o(i)}function gl(e,t,n){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++o>n)break}else if(e===n)break}return!1}function ml(e){const{height:t,width:n,borderTopWidth:o,borderRightWidth:s,borderBottomWidth:i,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:u,paddingLeft:c,marginTop:d,marginRight:h,marginBottom:f,marginLeft:p,boxSizing:m}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(n||"0"),borderTopWidth:v(o||"0"),borderRightWidth:v(s||"0"),borderBottomWidth:v(i||"0"),borderLeftWidth:v(r||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(u||"0"),paddingLeft:v(c||"0"),marginTop:v(d||"0"),marginRight:v(h||"0"),marginBottom:v(f||"0"),marginLeft:v(p||"0"),boxSizing:m}}function UC(e){const t=ml(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function lh(e){const t=ml(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function EI(e){const{height:t,marginBottom:n,marginTop:o}=ml(e);return Math.floor(t+n+o)}function Rg(e){const{width:t,marginLeft:n,marginRight:o}=ml(e);return Math.floor(t+n+o)}function RI(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:o,borderRightWidth:s,borderBottomWidth:i}=ml(e);return{top:t.top+(n||0),left:t.left+(o||0),right:t.right+(s||0),bottom:t.bottom+(i||0)}}function _g(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function Dg(e,t,n){n&&(t*=-1),e.scrollLeft=t}function co(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function ii(e){e!=null&&e.parentNode&&e.remove()}function _I(e){return!!e.offsetParent}function Ai(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!_I(e)||window.getComputedStyle(e).visibility!=="visible")}function zC(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function DI(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function xI(e,t){for(let n=0;n<t.length;n++){const o=t[n],s=e.children[n];s!==o&&e.insertBefore(o,s)}}function mq(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function uh(e,t){if(t)for(const n of Object.keys(t)){const o=t[n];if(!(n!=null&&n.length)||o==null)continue;const s=mq(n),i=o.toString(),r=i.replace(/\s*!important/g,""),a=r.length!=i.length?"important":void 0;e.style.setProperty(s,r,a)}}function xg(e){return()=>{const t=e();return t?jC(t)||TI(t):!0}}function jC(e){return e.clientWidth<e.scrollWidth}function TI(e){return e.clientHeight<e.scrollHeight}function Tg(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):ki(e,t)}function ki(e,t){t=KC(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function ch(e,t){t=KC(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function KC(e){return typeof e=="number"?`${e}px`:e}function qC(e){return e instanceof Node||e instanceof HTMLElement}function cs(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function la(e,t,n){const s=pI(e).ResizeObserver,i=s?new s(n):null;return i==null||i.observe(t),()=>i==null?void 0:i.disconnect()}function br(e,t){const n=pI(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var FI="data-ref",YC;function PI(){return YC??(YC=document.createTextNode(" ")),YC.cloneNode()}function dh(e){const{attrs:t,children:n,cls:o,ref:s,role:i,tag:r}=e,a=document.createElement(r);if(o&&(a.className=o),s&&a.setAttribute(FI,s),i&&a.setAttribute("role",i),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const u of n)u&&(typeof u=="string"?(a.appendChild(document.createTextNode(u)),l=!1):typeof u=="function"?a.appendChild(u()):(l&&(a.appendChild(PI()),l=!1),a.append(dh(u)),a.appendChild(PI())))}return a}var vq=["touchstart","touchend","touchmove","touchcancel","scroll"],yq=["wheel"],ZC={},II=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof ZC[n]=="boolean")return ZC[n];const o=document.createElement(e[n]||"div");return n="on"+n,ZC[n]=n in o}})();function wq(e,t){return!t||!e?!1:bq(t).indexOf(e)>=0}function Cq(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function bq(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Cq(t)}function Sq(e,t,n){const o=Eq(t);let s;o!=null&&(s={passive:o}),e.addEventListener(t,n,s)}var Eq=e=>{const t=vq.includes(e),n=yq.includes(e);if(t)return!0;if(n)return!1};function AI(e,t,n){if(n===0)return!1;const o=Math.abs(e.clientX-t.clientX),s=Math.abs(e.clientY-t.clientY);return Math.max(o,s)<=n}var hh=(e,t)=>{const n=e.identifier;for(let o=0,s=t.length;o<s;++o){const i=t[o];if(i.identifier===n)return i}return null};function fh(e,t){return e.gos.isElementInThisInstance(t.target)}function Rq(e,t,n){const s=e.getBoundingClientRect().height,i=YK(n)-2,r=ZK(n)-2;if(!e.offsetParent)return;const l=RI(e.offsetParent),{clientY:u,clientX:c}=t;let d=u-l.top-s/2,h=c-l.left-10;const f=no(n),p=f.defaultView||window,m=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;i>0&&h+e.clientWidth>i+v&&(h=i+v-e.clientWidth),h<0&&(h=0),r>0&&d+e.clientHeight>r+m&&(d=r+m-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Fg=(e,...t)=>{for(const n of t){const[o,s,i,r]=n;o.addEventListener(s,i,r),e.push(n)}},XC=e=>{if(e){for(const[t,n,o,s]of e)t.removeEventListener(n,o,s);e.length=0}},ua=e=>{e.cancelable&&e.preventDefault()};function _q(e,t){return t}function kI(e){return(e==null?void 0:e.getLocaleTextFunc())??_q}function Dq(e,t,n,o){const s=t[n];return e.getLocaleTextFunc()(n,typeof s=="function"?s(o):s,o)}function xq(e){return(t,n,o)=>e({key:t,defaultValue:n,variableValues:o})}function Tq(e){return(t,n,o)=>{let s=e==null?void 0:e[t];if(s&&(o!=null&&o.length)){let i=0;for(;!(i>=o.length||s.indexOf("${variable}")===-1);)s=s.replace("${variable}",o[i++])}return s??n}}var Oi=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new pl),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var o;(o=this.localEventService)==null||o.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const o of Object.keys(t)){const s=t[o];s&&n.push(this._setupListener(e,o,s))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let o;if(Fq(e))e.__addEventListener(t,n),o=()=>(e.__removeEventListener(t,n),null);else{const s=Pq(e);e instanceof HTMLElement?Sq(e,t,n):s?e.addListener(t,n):e.addEventListener(t,n),o=s?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==o),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const o=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,o=s=>{if(s.changeSet){if(s.changeSet&&s.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=s.changeSet.id}const i={type:"propertyChanged",changeSet:s.changeSet,source:s.source};t(i)};for(const s of e)this.setupPropertyListener(s,o)}getLocaleTextFunc(){return kI(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Fq(e){return e.__addEventListener!==void 0}function Pq(e){return e.eventServiceType==="global"}var Fe=class extends Oi{},OI={};function JC(e,t){OI[t]||(e(),OI[t]=!0)}var Iq={pending:!1,funcs:[]},Aq={pending:!1,funcs:[]};function QC(e,t="setTimeout",n){const o=t==="raf"?Aq:Iq;if(o.funcs.push(e),o.pending)return;o.pending=!0;const s=()=>{const i=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const r of i)r()};t==="raf"?br(n,s):window.setTimeout(s,0)}function ho(e,t,n){let o;return function(...s){const i=this;window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(i,s)},n)}}function MI(e,t){let n=0;return function(...o){const s=this,i=Date.now();i-n<t||(n=i,e.apply(s,o))}}function kq(e,t,n,o=100){const s=Date.now();let i=null,r=!1;const a=()=>{i!=null&&(window.clearInterval(i),i=null)};e.addDestroyFunc(a);const l=()=>{const u=Date.now()-s>o;(t()||u)&&(n(),r=!0,a())};l(),r||(i=window.setInterval(l,10))}var LI=new Set(["__proto__","constructor","prototype"]);function Oq(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(o=>!LI.has(o)))t(n,e[n])}}function Lo(e,t,n=!0,o=!1){et(t)&&Oq(t,(s,i)=>{let r=e[s];r!==i&&(o&&r==null&&i!=null&&typeof i=="object"&&i.constructor===Object&&(r={},e[s]=r),NI(i)&&NI(r)&&!Array.isArray(r)?Lo(r,i,n,o):(n||i!==void 0)&&(e[s]=i))})}function NI(e){return typeof e=="object"&&e!==null}var eb=class Nr{static applyGlobalGridOptions(t){if(!Nr.gridOptions)return{...t};let n={};return Lo(n,Nr.gridOptions,!0,!0),Nr.mergeStrategy==="deep"?Lo(n,t,!0,!0):n={...n,...t},Nr.gridOptions.context&&(n.context=Nr.gridOptions.context),t.context&&(Nr.mergeStrategy==="deep"&&n.context&&Lo(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Nr.mergeStrategy==="deep"){const o=Mq(t);if(o&&typeof o=="object"&&typeof n=="object")return Nr.applyGlobalGridOptions({[t]:n})[t]}return n}};eb.gridOptions=void 0,eb.mergeStrategy="shallow";var tb=eb;function Mq(e){var t;return(t=tb.gridOptions)==null?void 0:t[e]}var Lq={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},VI="https://www.ag-grid.com";function ca(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function ph(e,...t){JC(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function zu(e,...t){JC(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var BI=new Set,Pg={},ju={},Ig,HI=!1,$I=!1,Nq=!1;function Vq(e){const[t,n]=e.version.split(".")||[],[o,s]=Ig.split(".")||[];return t===o&&n===s}function Bq(e){var o;Ig||(Ig=e.version);const t=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;e.version?Vq(e)||zu(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${Ig}.`)):zu(t(`'${e.moduleName}' is incompatible.`));const n=(o=e.validate)==null?void 0:o.call(e);n&&!n.isValid&&zu(`${n.message}`)}function gh(e,t,n=!1){n||(HI=!0),Bq(e);const o=e.rowModels??["all"];BI.add(e);let s;t!==void 0?($I=!0,ju[t]===void 0&&(ju[t]={}),s=ju[t]):s=Pg;for(const i of o)s[i]===void 0&&(s[i]={}),s[i][e.moduleName]=e;if(e.dependsOn)for(const i of e.dependsOn)gh(i,t,n)}function Hq(e){delete ju[e]}function nb(e,t,n){const o=s=>{var i,r,a;return!!((i=Pg[s])!=null&&i[e])||!!((a=(r=ju[t])==null?void 0:r[s])!=null&&a[e])};return o(n)||o("all")}function ob(){return $I}function $q(e,t){const n=ju[e]??{};return[...Object.values(Pg.all??{}),...Object.values(n.all??{}),...Object.values(Pg[t]??{}),...Object.values(n[t]??{})]}function Gq(){return new Set(BI)}function Wq(){return HI}function Uq(){return Nq}var zq=class{static register(e){gh(e,void 0)}static registerModules(e){for(const t of e)gh(t,void 0)}},Je="34.3.1",GI=2e3,WI=100,UI="_version_",Ag=null,Ku=`${VI}/javascript-data-grid`;function jq(e){Ag=e}function Kq(e){Ku=e}function zI(e,t,n){return(Ag==null?void 0:Ag(e,t))??[Xq(e,t,n)]}function sb(e,t,n,o,s){e(`${o?"warning":"error"} #${t}`,...zI(t,n,s))}function qq(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function Yq(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=qq(e)),t}function kg(e){return e===void 0?"undefined":e===null?"null":e}function ib(e,t){return`${e}?${t.toString()}`}function Zq(e,t,n){const o=Array.from(t.entries()).sort((i,r)=>r[1].length-i[1].length);let s=ib(e,t);for(const[i,r]of o){if(i===UI)continue;const a=s.length-n;if(a<=0)break;const l="...",u=a+l.length,c=r.length-u>WI?r.slice(0,r.length-u)+l:r.slice(0,WI)+l;t.set(i,c),s=ib(e,t)}return s}function jI(e,t){const n=new URLSearchParams;if(n.append(UI,Je),t)for(const i of Object.keys(t))n.append(i,Yq(t[i]));const o=`${Ku}/errors/${e}`,s=ib(o,n);return s.length<=GI?s:Zq(o,n,GI)}var Xq=(e,t,n)=>{const o=jI(e,t);return`${`${n?n+`
|
|
162
162
|
`:""}Visit ${o}`}${n?"":`
|
|
163
163
|
Alternatively register the ValidationModule to see the full message in the console.`}`};function Ve(...e){sb(ph,e[0],e[1],!0)}function dn(...e){sb(zu,e[0],e[1],!1)}function mh(e,t,n){sb(zu,e,t,!1,n)}function Jq(e,t){const n=t[0];return`error #${n} `+zI(n,t[1],e).join(" ")}function Mi(...e){return Jq(void 0,e)}function KI(e,t){return e.get("rowModelType")===t}function Nn(e,t){return KI(e,"clientSide")}function qu(e,t){return KI(e,"serverSide")}function fo(e,t){return e.get("domLayout")===t}function vl(e){return Lg(e)!==void 0}function qI(e){return typeof e.get("getRowHeight")=="function"}function Qq(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function da(e,t,n=!1,o){const{gos:s,environment:i}=e;if(o==null&&(o=i.getDefaultRowHeight()),qI(s)){if(n)return{height:o,estimated:!0};const l={node:t,data:t.data},u=s.getCallback("getRowHeight")(l);if(rb(u))return u===0&&Ve(23),{height:Math.max(1,u),estimated:!1}}if(t.detail&&s.get("masterDetail"))return eY(s);const r=s.get("rowHeight");return{height:r&&rb(r)?r:o,estimated:!1}}function eY(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return rb(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function yl(e){const{environment:t,gos:n}=e,o=n.get("rowHeight");if(!o||Sn(o))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(Ve(24),t.getDefaultRowHeight())}function rb(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function YI(e,t,n){const o=t[e.getDomDataKey()];return o?o[n]:void 0}function wl(e,t,n,o){const s=e.getDomDataKey();let i=t[s];Sn(i)&&(i={},t[s]=i),i[n]=o}function Yu(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function ZI(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||fo(e,"print"))}function Li(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function ab(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function XI(e){return e.get("grandTotalRow")}function JI(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function QI(e,t,n){return!!t.group&&!t.footer&&JI(e,n)}function Zu(e){const t=e.getCallback("getRowId");return t===void 0?t:n=>{let o=t(n);return typeof o!="string"&&(JC(()=>Ve(25,{id:o}),"getRowIdString"),o=String(o)),o}}function tY(e,t){const n=e.get("groupHideParentOfSingleChild");return!!(n===!0||n==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function nY(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function Xu(e){return(e==null?void 0:e.checkboxes)??!0}function Og(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function Mg(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function lb(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function oY(e){return typeof e.get("rowSelection")!="string"}function Sr(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function eA(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const n=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return n&&o?!1:n?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function sY(e){const t=eA(e);return t===!0||t==="enableSelection"}function iY(e){const t=eA(e);return t===!0||t==="enableDeselection"}function ub(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function Lg(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t==null?void 0:t.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function vh(e){return Lg(e)==="multiRow"}function rY(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function Ng(e){const t=e.get("rowSelection");if(typeof t=="string"){const n=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return n&&o?"filteredDescendants":n?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function tA(e,t=!0){const n=e.get("rowSelection");return typeof n!="object"?t?"all":void 0:n.mode==="multiRow"?n.selectAll:"all"}function aY(e){const t=e.get("rowSelection");return typeof t=="string"?!1:(t==null?void 0:t.mode)==="multiRow"?t.ctrlASelectsRows??!1:!1}function yh(e){const t=Ng(e);return t==="descendants"||t==="filteredDescendants"}function nA(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function lY(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function ds(e){return e.get("columnMenu")==="legacy"}function uY(e){return!ds(e)}function cY(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function Et(e,t){return e.addCommon(t)}function oA({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var dY={resizable:!0,sortable:!0},hY=0;function sA(){return hY++}function ha(e){return e instanceof Cl}var Cl=class extends Fe{constructor(e,t,n,o){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=n,this.primary=o,this.isColumn=!0,this.instanceId=sA(),this.autoHeaderHeight=null,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new pl,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=sh(n)}destroy(){var e;super.destroy(),(e=this.beans.rowSpanSvc)==null||e.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:n,colFlex:o}}=this;t==null||t.initCol(this);const s=e.hide;s!==void 0?this.visible=!s:this.visible=!e.initialHide,n==null||n.initCol(this),o==null||o.initCol(this)}setColDef(e,t,n){var s;const o=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),o&&((s=this.beans.rowSpanSvc)==null||s.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",n)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:n}}=this,o=e.get("suppressFieldDotNotation");this.fieldContainsDots=et(t)&&t.includes(".")&&!o,this.tooltipFieldContainsDots=et(n)&&n.includes(".")&&!o}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){var e;(e=this.beans.tooltipSvc)==null||e.initCol(this)}initRowSpan(){var e;this.colDef.spanRows&&((e=this.beans.rowSpanSvc)==null||e.register(this))}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:n=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,n.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const n=e.width,o=e.initialWidth;return n!=null?t=n:o!=null?t=o:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){var t;return((t=this.beans.showRowGroupCols)==null?void 0:t.isRowGroupDisplayed(this,e))??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){var o,s,i;this.frameworkEventListenerService=(s=(o=this.beans.frameworkOverrides).createLocalEventListenerWrapper)==null?void 0:s.call(o,this.frameworkEventListenerService,this.colEventSvc);const n=((i=this.frameworkEventListenerService)==null?void 0:i.wrap(e,t))??t;this.colEventSvc.addEventListener(e,n)}removeEventListener(e,t){var o;const n=((o=this.frameworkEventListenerService)==null?void 0:o.unwrap(e,t))??t;this.colEventSvc.removeEventListener(e,n)}createColumnFunctionCallbackParams(e){return Et(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){var t;return((t=this.beans.cellNavigation)==null?void 0:t.isSuppressNavigable(this,e))??!1}isCellEditable(e){var t;return((t=this.beans.editSvc)==null?void 0:t.isCellEditable({rowNode:e,column:this}))??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){var t;return((t=this.beans.selectionSvc)==null?void 0:t.isCellCheckboxSelection(this,e))??!1}isSuppressPaste(e){var t;return this.isColumnFunc(e,((t=this.colDef)==null?void 0:t.suppressPaste)??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??dY[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const n=this.createColumnFunctionCallbackParams(e);return t(n)}return!1}createColumnEvent(e,t){return Et(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return Sn(this.sort)}isSorting(){return et(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){var e;return Ve(261),!!((e=this.beans.colHover)!=null&&e.isHovered(this))}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const n=e===!0;this.visible!==n&&(this.visible=n,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e!=null&&e.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!(e!=null&&e.isPadding()))return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let n=!0;for(;e;){if(!e.isPadding()){n=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:n}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return Et(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(Sn(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.colSpan(t);return Math.max(n,1)}getRowSpan(e){if(Sn(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.rowSpan(t);return Math.max(n,1)}setActualWidth(e,t,n=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),n||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,n){const o=this.createColumnEvent(e,t);n&&Lo(o,n),this.colEventSvc.dispatchEvent(o)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function Ro(e){return e instanceof Vg}var Vg=class extends Fe{constructor(e,t,n,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=n,this.level=o,this.isColumn=!1,this.expandable=!1,this.instanceId=sA(),this.expandableListenerRemoveCallback=null,this.expanded=!!(e!=null&&e.openByDefault)}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)ha(t)?e(t):Ro(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)ha(t)?e.push(t):Ro(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,n=!1;const o=this.findChildrenRemovingPadding();for(let i=0,r=o.length;i<r;i++){const a=o[i];if(!a.isVisible())continue;const l=a.getColumnGroupShow();l==="open"?(e=!0,n=!0):l==="closed"?(t=!0,n=!0):(e=!0,t=!0)}const s=e&&t&&n;this.expandable!==s&&(this.expandable=s,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=n=>{for(const o of n)Ro(o)&&o.isPadding()?t(o.children):e.push(o)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},fY={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function iA(e,t,n){const o={},s=e.gos;return Object.assign(o,s.get("defaultColGroupDef")),Object.assign(o,t),s.validateColDef(o,n),o}var pY=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=$C(e);let n=0;for(;;){let o=e??t;if(o?n!==0&&(o+="_"+n):o=n,!this.existingKeys[o]){const s=String(o);return e&&n>0&&Ve(273,{providedId:e,usedId:s}),this.existingKeys[s]=!0,s}n++}}};function fn(e){if(e!=null&&e.length)return e[e.length-1]}function fa(e,t,n){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const o=e.length;if(o!==t.length)return!1;for(let s=0;s<o;s++)if(e[s]!==t[s]&&!(n!=null&&n(e[s],t[s])))return!1;return!0}function wh(e,t){if(e)for(const n of e)t(n)}function ri(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function rA(e,t,n){for(let o=0;o<t.length;o++)ri(e,t[o]);for(let o=t.length-1;o>=0;o--)e.splice(n,0,t[o])}var Bg="ag-Grid-AutoColumn",aA="ag-Grid-SelectionColumn",lA="ag-Grid-RowNumbersColumn";function uA(e){const t=[],n=o=>{for(let s=0;s<o.length;s++){const i=o[s];ha(i)?t.push(i):Ro(i)&&n(i.getChildren())}};return n(e),t}function Er(e){return e.reduce((t,n)=>t+n.getActualWidth(),0)}function Hg(e,t,n){const o={};if(!t)return;Dr(null,t,i=>{o[i.getInstanceId()]=i}),n&&Dr(null,n,i=>{o[i.getInstanceId()]=null});const s=Object.values(o).filter(i=>i!=null);e.context.destroyBeans(s)}function cb(e){return e.getId().startsWith(Bg)}function Rr(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(aA))??!1}function _r(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(lA))??!1}function gY(e){return Rr(e)||_r(e)}function $g(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function mY(e,t){return fa(e,t,(n,o)=>n.getColId()===o.getColId())}function vY(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function Ju(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Ch(e,t){const n=e===t,o=e.getColDef()===t,s=e.getColId()==t;return n||o||s}var yY=(e,t)=>(n,o)=>{const s={value1:void 0,value2:void 0};let i=!1;return e&&(e[n]!==void 0&&(s.value1=e[n],i=!0),et(o)&&e[o]!==void 0&&(s.value2=e[o],i=!0)),!i&&t&&(t[n]!==void 0&&(s.value1=t[n]),et(o)&&t[o]!==void 0&&(s.value2=t[o])),s},wY=(e,t)=>{Ro(e)&&e.setupExpandable(),e.originalParent=t};function CY(e,t=null,n,o,s){const i=new pY,{existingCols:r,existingGroups:a,existingColKeys:l}=bY(o);i.addExistingKeys(l);const u=cA(e,t,0,n,r,i,a,s),{colGroupSvc:c}=e,d=(c==null?void 0:c.findMaxDepth(u,0))??0,h=c?c.balanceColumnTree(u,0,d,i):u;return Dr(null,h,wY),{columnTree:h,treeDepth:d}}function bY(e){const t=[],n=[],o=[];return e&&Dr(null,e,s=>{if(Ro(s)){const i=s;n.push(i)}else{const i=s;o.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:n,existingColKeys:o}}function cA(e,t,n,o,s,i,r,a){if(!t)return[];const{colGroupSvc:l}=e,u=new Array(t.length);for(let c=0;c<u.length;c++){const d=t[c];l&&xY(d)?u[c]=l.createProvidedColumnGroup(o,d,n,s,i,r,a):u[c]=SY(e,o,d,s,i,a)}return u}function SY(e,t,n,o,s,i){var l;const r=RY(n,o);r&&(o==null||o.splice(r.idx,1));let a=r==null?void 0:r.column;if(a){const u=db(e,n,a.getColId());a.setColDef(u,n,i),EY(e,a,u,i)}else{const u=s.getUniqueKey(n.colId,n.field),c=db(e,n,u);a=new Cl(c,n,u,t),e.context.createBean(a)}return(l=e.dataTypeSvc)==null||l.addColumnListeners(a),a}function dA(e,t,n,o,s,i,r,a){const{sortSvc:l,pinnedCols:u,colFlex:c}=e;n!==void 0&&t.setVisible(!n,a),l&&(l.updateColSort(t,o,a),s!==void 0&&l.setColSortIndex(t,s)),i!==void 0&&(u==null||u.setColPinned(t,i)),r!==void 0&&(c==null||c.setColFlex(t,r))}function EY(e,t,n,o){dA(e,t,n.hide,n.sort,n.sortIndex,n.pinned,n.flex,o);const s=t.getFlex();if(!(s!=null&&s>0))if(n.width!=null)t.setActualWidth(n.width,o);else{const i=t.getActualWidth();t.setActualWidth(i,o)}}function RY(e,t){if(t)for(let n=0;n<t.length;n++){const o=t[n].getUserProvidedColDef();if(!o)continue;if(e.colId!=null){if(t[n].getId()===e.colId)return{idx:n,column:t[n]};continue}if(e.field!=null){if(o.field===e.field)return{idx:n,column:t[n]};continue}if(o===e)return{idx:n,column:t[n]}}}function db(e,t,n,o){const{gos:s,dataTypeSvc:i}=e,r={},a=s.get("defaultColDef");Lo(r,a,!1,!0);const l=_Y(e,r,t,n);l&&DY(e,l,r);const u=r.cellDataType;Lo(r,t,!1,!0),u!==void 0&&(r.cellDataType=u);const c=s.get("autoGroupColumnDef"),d=Li(s);return t.rowGroup&&c&&d&&Lo(r,{sort:c.sort,initialSort:c.initialSort},!1,!0),i&&(i.postProcess(r),i.validateColDef(r)),s.validateColDef(r,n,o),r}function _Y(e,t,n,o){var r;const s=(r=e.dataTypeSvc)==null?void 0:r.updateColDefAndGetColumnType(t,n,o),i=n.type??s??t.type;return t.type=i,i?$g(i):void 0}function DY(e,t,n){if(!t.length)return;const o=Object.assign({},fY),s=e.gos.get("columnTypes")||{};for(const i of Object.keys(s)){const r=s[i];i in o?Ve(34,{key:i}):(r.type&&Ve(35),o[i]=r)}for(const i of t){const r=o[i.trim()];r?Lo(n,r,!1,!0):Ve(36,{t:i})}}function xY(e){return e.children!==void 0}function Dr(e,t,n){if(t)for(let o=0;o<t.length;o++){const s=t[o];Ro(s)&&Dr(s,s.getChildren(),n),n(s,e)}}function hA(e,t){const n=[],o=[],s=[];return e.forEach(r=>{const a=r.getColDef().lockPosition;a==="right"?s.push(r):a==="left"||a===!0?n.push(r):o.push(r)}),t.get("enableRtl")?[...s,...o,...n]:[...n,...o,...s]}function fA(e,t){let n=!0;return Dr(null,t,o=>{if(!Ro(o))return;const s=o,i=s.getColGroupDef();if(!(i==null?void 0:i.marryChildren))return;const a=[];for(const h of s.getLeafColumns()){const f=e.indexOf(h);a.push(f)}const l=Math.max.apply(Math,a),u=Math.min.apply(Math,a),c=l-u,d=s.getLeafColumns().length-1;c>d&&(n=!1)}),n}function pA(e,t){if(!e||e.length==0)return;const n=t(e[0]);for(let o=1;o<e.length;o++)if(n!==t(e[o]))return;return n}function gA(e,t,n){if(!t.length)return;const o=t.length===1?t[0]:null,s=pA(t,i=>i.getPinned());e.dispatchEvent({type:"columnPinned",pinned:s??null,columns:t,column:o,source:n})}function TY(e,t,n){if(!t.length)return;const o=t.length===1?t[0]:null,s=pA(t,i=>i.isVisible());e.dispatchEvent({type:"columnVisible",visible:s,columns:t,column:o,source:n})}function FY(e,t,n,o){e.dispatchEvent({type:t,columns:n,column:n&&n.length==1?n[0]:null,source:o})}function Qu(e,t,n,o,s=null){t!=null&&t.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:s,finished:n,source:o})}function ai(e,t,n){var R;const{colModel:o,rowGroupColsSvc:s,pivotColsSvc:i,autoColSvc:r,selectionColSvc:a,colAnimation:l,visibleCols:u,pivotResultCols:c,environment:d,valueColsSvc:h,eventSvc:f,gos:p}=e,m=o.getColDefCols()??[],v=a==null?void 0:a.getColumns();if(!m.length&&!(v!=null&&v.length))return!1;if(t!=null&&t.state&&!t.state.forEach)return Ve(32),!1;const C=(E,T,x,k,I)=>{if(!E)return;const F=yY(T,t.defaultState),A=F("flex").value1;if(dA(e,E,F("hide").value1,F("sort").value1,F("sortIndex").value1,F("pinned").value1,A,n),A==null){const M=F("width").value1;if(M!=null){const V=E.getColDef().minWidth??d.getDefaultColumnMinWidth();V!=null&&M>=V&&E.setActualWidth(M,n)}}I||!E.isPrimary()||(h==null||h.syncColumnWithState(E,n,F),s==null||s.syncColumnWithState(E,n,F,x),i==null||i.syncColumnWithState(E,n,F,k))},b=(E,T,x)=>{var de,ve;const k=mA(e,n),I=T.slice(),F={},A={},M=[],V=[],X=[];let O=0;const B=(s==null?void 0:s.columns.slice())??[],N=(i==null?void 0:i.columns.slice())??[];for(const se of E){const te=se.colId;if(te.startsWith(Bg)){M.push(se),X.push(se);continue}if(Rr(te)){V.push(se),X.push(se);continue}const he=x(te);he?(C(he,se,F,A,!1),ri(I,he)):(X.push(se),O+=1)}const z=se=>C(se,null,F,A,!1);I.forEach(z),s==null||s.sortColumns(yA.bind(s,F,B)),i==null||i.sortColumns(yA.bind(i,A,N)),o.refreshCols(!1,n);const q=(se,te,J=[])=>{for(const he of te){const be=se(he.colId);ri(J,be),C(be,he,null,null,!0)}J.forEach(z)};return q(se=>(r==null?void 0:r.getColumn(se))??null,M,(de=r==null?void 0:r.getColumns())==null?void 0:de.slice()),q(se=>(a==null?void 0:a.getColumn(se))??null,V,(ve=a==null?void 0:a.getColumns())==null?void 0:ve.slice()),IY(t,o,p),u.refresh(n),f.dispatchEvent({type:"columnEverythingChanged",source:n}),k(),{unmatchedAndAutoStates:X,unmatchedCount:O}};l==null||l.start();let{unmatchedAndAutoStates:_,unmatchedCount:w}=b(t.state||[],m,E=>o.getColDefCol(E));if(_.length>0||et(t.defaultState)){const E=((R=c==null?void 0:c.getPivotResultCols())==null?void 0:R.list)??[];w=b(_,E,T=>(c==null?void 0:c.getPivotResultCol(T))??null).unmatchedCount}return l==null||l.finish(),w===0}function PY(e,t){var b,_;const{colModel:n,autoColSvc:o,selectionColSvc:s,eventSvc:i,gos:r}=e,a=n.getColDefCols();if(!(a!=null&&a.length))return;const l=n.getColDefColTree(),u=uA(l),c=[];let d=1e3,h=1e3;const f=w=>{const R=vA(w);Sn(R.rowGroupIndex)&&R.rowGroup&&(R.rowGroupIndex=d++),Sn(R.pivotIndex)&&R.pivot&&(R.pivotIndex=h++),c.push(R)};(b=o==null?void 0:o.getColumns())==null||b.forEach(f),(_=s==null?void 0:s.getColumns())==null||_.forEach(f),u==null||u.forEach(f),ai(e,{state:c},t);const p=(o==null?void 0:o.getColumns())??[],C=[...(s==null?void 0:s.getColumns())??[],...p,...a].map(w=>({colId:w.colId}));ai(e,{state:C,applyOrder:!0},t),i.dispatchEvent(Et(r,{type:"columnsReset",source:t}))}function mA(e,t){const{rowGroupColsSvc:n,pivotColsSvc:o,valueColsSvc:s,colModel:i,sortSvc:r,eventSvc:a}=e,l={rowGroupColumns:(n==null?void 0:n.columns.slice())??[],pivotColumns:(o==null?void 0:o.columns.slice())??[],valueColumns:(s==null?void 0:s.columns.slice())??[]},u=Gg(e),c={};for(const d of u)c[d.colId]=d;return()=>{const d=(E,T,x,k)=>{const I=T.map(k),F=x.map(k);if(fa(I,F))return;const M=new Set(T);for(const X of x)M.delete(X)||M.add(X);const V=[...M];a.dispatchEvent({type:E,columns:V,column:V.length===1?V[0]:null,source:t})},h=E=>{const T=[];return i.forAllCols(x=>{const k=c[x.getColId()];k&&E(k,x)&&T.push(x)}),T},f=E=>E.getColId();d("columnRowGroupChanged",l.rowGroupColumns,(n==null?void 0:n.columns)??[],f),d("columnPivotChanged",l.pivotColumns,(o==null?void 0:o.columns)??[],f);const m=h((E,T)=>{const x=E.aggFunc!=null,k=x!=T.isValueActive(),I=x&&E.aggFunc!=T.getAggFunc();return k||I});m.length>0&&FY(a,"columnValueChanged",m,t),Qu(a,h((E,T)=>E.width!=T.getActualWidth()),!0,t),gA(a,h((E,T)=>E.pinned!=T.getPinned()),t),TY(a,h((E,T)=>E.hide==T.isVisible()),t);const w=h((E,T)=>E.sort!=T.getSort()||E.sortIndex!=T.getSortIndex());w.length>0&&(r==null||r.dispatchSortChangedEvents(t,w));const R=Gg(e);kY(u,R,t,i,a)}}function Gg(e){const{colModel:t,rowGroupColsSvc:n,pivotColsSvc:o}=e,s=t.getColDefCols();if(Sn(s)||!t.isAlive())return[];const i=n==null?void 0:n.columns,r=o==null?void 0:o.columns,a=[],l=c=>{const d=c.isRowGroupActive()&&i?i.indexOf(c):null,h=c.isPivotActive()&&r?r.indexOf(c):null,f=c.isValueActive()?c.getAggFunc():null,p=c.getSort()!=null?c.getSort():null,m=c.getSortIndex()!=null?c.getSortIndex():null;a.push({colId:c.getColId(),width:c.getActualWidth(),hide:!c.isVisible(),pinned:c.getPinned(),sort:p,sortIndex:m,aggFunc:f,rowGroup:c.isRowGroupActive(),rowGroupIndex:d,pivot:c.isPivotActive(),pivotIndex:h,flex:c.getFlex()??null})};t.forAllCols(c=>l(c));const u=new Map(t.getCols().map((c,d)=>[c.getColId(),d]));return a.sort((c,d)=>{const h=u.has(c.colId)?u.get(c.colId):-1,f=u.has(d.colId)?u.get(d.colId):-1;return h-f}),a}function vA(e){const t=(p,m)=>p??m??null,n=e.getColDef(),o=t(n.sort,n.initialSort),s=t(n.sortIndex,n.initialSortIndex),i=t(n.hide,n.initialHide),r=t(n.pinned,n.initialPinned),a=t(n.width,n.initialWidth),l=t(n.flex,n.initialFlex);let u=t(n.rowGroupIndex,n.initialRowGroupIndex),c=t(n.rowGroup,n.initialRowGroup);u==null&&!c&&(u=null,c=null);let d=t(n.pivotIndex,n.initialPivotIndex),h=t(n.pivot,n.initialPivot);d==null&&!h&&(d=null,h=null);const f=t(n.aggFunc,n.initialAggFunc);return{colId:e.getColId(),sort:o,sortIndex:s,hide:i,pinned:r,width:a,flex:l,rowGroup:c,rowGroupIndex:u,pivot:h,pivotIndex:d,aggFunc:f}}function IY(e,t,n){if(!e.applyOrder||!e.state)return;const o=[];for(const s of e.state)s.colId!=null&&o.push(s.colId);AY(t.cols,o,t,n)}function AY(e,t,n,o){if(e==null)return;let s=[];const i={};for(const a of t){if(i[a])continue;const l=e.map[a];l&&(s.push(l),i[a]=!0)}let r=0;for(const a of e.list){const l=a.getColId();if(i[l]!=null)continue;l.startsWith(Bg)?s.splice(r++,0,a):s.push(a)}if(s=hA(s,o),!fA(s,n.getColTree())){Ve(39);return}e.list=s}function kY(e,t,n,o,s){const i={};for(const c of t)i[c.colId]=c;const r={};for(const c of e)i[c.colId]&&(r[c.colId]=!0);const a=e.filter(c=>r[c.colId]),l=t.filter(c=>r[c.colId]),u=[];l.forEach((c,d)=>{const h=a==null?void 0:a[d];if(h&&h.colId!==c.colId){const f=o.getCol(h.colId);f&&u.push(f)}}),u.length&&s.dispatchEvent({type:"columnMoved",columns:u,column:u.length===1?u[0]:null,finished:!0,source:n})}var yA=(e,t,n,o)=>{const s=e[n.getId()],i=e[o.getId()],r=s!=null,a=i!=null;if(r&&a)return s-i;if(r)return-1;if(a)return 1;const l=t.indexOf(n),u=t.indexOf(o),c=l>=0,d=u>=0;return c&&d?l-u:c?-1:1},OY=class extends Fe{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(Ju(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Ju(e.source)))}createColsFromColDefs(e){var b,_,w;const{beans:t}=this,{valueCache:n,colAutosize:o,rowGroupColsSvc:s,pivotColsSvc:i,valueColsSvc:r,visibleCols:a,eventSvc:l,groupHierarchyColSvc:u}=t,c=this.colDefs?mA(t,e):void 0;n==null||n.expire();const d=(b=this.colDefCols)==null?void 0:b.list,h=(_=this.colDefCols)==null?void 0:_.tree,f=CY(t,this.colDefs,!0,h,e);Hg(t,(w=this.colDefCols)==null?void 0:w.tree,f.columnTree);const p=f.columnTree,m=f.treeDepth,v=uA(p),C={};for(const R of v)C[R.getId()]=R;this.colDefCols={tree:p,treeDepth:m,list:v,map:C},this.createColumnsForService([u],this.colDefCols,e),s==null||s.extractCols(e,d),i==null||i.extractCols(e,d),r==null||r.extractCols(e,d),this.ready=!0,this.refreshCols(!0,e),a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),c&&(this.changeEventsDispatching=!0,c(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&(o==null||o.applyAutosizeStrategy())}refreshCols(e,t){var v;if(!this.colDefCols)return;const n=(v=this.cols)==null?void 0:v.tree;this.saveColOrder();const{autoColSvc:o,selectionColSvc:s,rowNumbersSvc:i,quickFilter:r,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:u,visibleCols:c,colViewport:d,eventSvc:h}=this.beans,f=this.selectCols(a,this.colDefCols);this.createColumnsForService([o,s,i],f,t);const p=Qq(this.gos,this.showingPivotResult);(!e||p)&&this.restoreColOrder(f),this.positionLockedCols(f),l==null||l.refresh(),r==null||r.refreshCols(),this.setColSpanActive(),u==null||u.setAutoHeightActive(f),c.clear(),d.clear(),!fa(n,this.cols.tree)&&h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,n){for(const o of e)o&&(o.createColumns(t,s=>{this.lastOrder=s(this.lastOrder),this.lastPivotOrder=s(this.lastPivotOrder)},n),o.addColumns(t))}selectCols(e,t){const n=(e==null?void 0:e.getPivotResultCols())??null;this.showingPivotResult=n!=null;const{map:o,list:s,tree:i,treeDepth:r}=n??t;return this.cols={list:s.slice(),map:{...o},tree:i.slice(),treeDepth:r},n&&(n.list.some(l=>{var u;return((u=this.cols)==null?void 0:u.map[l.getColId()])!==void 0})||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{valueColsSvc:e,selectionColSvc:t,gos:n}=this.beans,o=this.isPivotMode()&&!this.showingPivotResult,s=t==null?void 0:t.isSelectionColumnEnabled(),i=n.get("rowNumbers"),r=e==null?void 0:e.columns;return this.cols.list.filter(l=>{const u=cb(l);if(o){const c=r==null?void 0:r.includes(l);return u||c||s&&Rr(l)||i&&_r(l)}else return u||l.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,n){ai(this.beans,{state:e.map(o=>({colId:typeof o=="string"?o:o.getColId(),hide:!t}))},n)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const n=t.filter(d=>e.map[d.getId()]!=null);if(n.length===0)return;if(n.length===e.list.length){e.list=n;return}const o=d=>{const h=d.getOriginalParent();return h?h.getChildren().length>1?!0:o(h):!1};if(!n.some(d=>o(d))){const d=new Set(n);for(const h of e.list)d.has(h)||n.push(h);e.list=n;return}const s=new Map;for(let d=0;d<n.length;d++){const h=n[d];s.set(h,d)}const i=e.list.filter(d=>!s.has(d));if(i.length===0){e.list=n;return}const r=(d,h)=>{const f=h?h.getOriginalParent():d.getOriginalParent();if(!f)return null;let p=null,m=null;for(const v of f.getChildren())if(!(v===h||v===d)){if(v instanceof Cl){const C=s.get(v);if(C==null)continue;(p==null||p<C)&&(p=C,m=v);continue}v.forEachLeafColumn(C=>{const b=s.get(C);b!=null&&(p==null||p<b)&&(p=b,m=C)})}return m??r(d,f)},a=[],l=new Map;for(const d of i){const h=r(d,null);if(h==null){a.push(d);continue}const f=l.get(h);f===void 0?l.set(h,d):Array.isArray(f)?f.push(d):l.set(h,[f,d])}const u=new Array(e.list.length);let c=u.length-1;for(let d=a.length-1;d>=0;d--)u[c--]=a[d];for(let d=n.length-1;d>=0;d--){const h=n[d],f=l.get(h);if(f)if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];u[c--]=m}else u[c--]=f;u[c--]=h}e.list=u}positionLockedCols(e){e.list=hA(e.list,this.gos)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=((e=this.cols)==null?void 0:e.list)??null:this.lastOrder=((t=this.cols)==null?void 0:t.list)??null}getColumnDefs(e){var t,n;return this.colDefCols&&((n=this.beans.colDefFactory)==null?void 0:n.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,((t=this.cols)==null?void 0:t.list)??[],e))}setColSpanActive(){var e;this.colSpanActive=!!((e=this.cols)!=null&&e.list.some(t=>t.getColDef().colSpan!=null))}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:n,eventSvc:o}=this.beans;n.refresh(t),o.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){var t;const e=(t=this.beans.pivotColsSvc)==null?void 0:t.columns;return this.pivotMode&&!!(e!=null&&e.length)}recreateColumnDefs(e){var n;if(!this.cols)return;(n=this.beans.autoColSvc)==null||n.updateColumns(e);const t=Ju(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e;Hg(this.beans,(e=this.colDefCols)==null?void 0:e.tree),super.destroy()}getColTree(){var e;return((e=this.cols)==null?void 0:e.tree)??[]}getColDefColTree(){var e;return((e=this.colDefCols)==null?void 0:e.tree)??[]}getColDefCols(){var e;return((e=this.colDefCols)==null?void 0:e.list)??null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}forAllCols(e){var i,r,a,l,u;const{pivotResultCols:t,autoColSvc:n,selectionColSvc:o,groupHierarchyColSvc:s}=this.beans;wh((i=this.colDefCols)==null?void 0:i.list,e),wh((r=n==null?void 0:n.columns)==null?void 0:r.list,e),wh((a=o==null?void 0:o.columns)==null?void 0:a.list,e),wh((l=s==null?void 0:s.columns)==null?void 0:l.list,e),wh((u=t==null?void 0:t.getPivotResultCols())==null?void 0:u.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){var t;return((t=this.cols)==null?void 0:t.map[e])??null}getColFromCollection(e,t){if(t==null)return null;const{map:n,list:o}=t;if(typeof e=="string"&&n[e])return n[e];for(let a=0;a<o.length;a++)if(Ch(o[a],e))return o[a];const{autoColSvc:s,selectionColSvc:i,groupHierarchyColSvc:r}=this.beans;return(s==null?void 0:s.getColumn(e))??(i==null?void 0:i.getColumn(e))??(r==null?void 0:r.getColumn(e))??null}},wA=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let n;return typeof t!="number"?n=0:n=t+1,this.existingIds[e]=n,n}};function bh(e,t,n){return n&&e.addDestroyFunc(()=>t.destroyBean(n)),n??e}var Qe=null;function CA(e){return typeof(e==null?void 0:e.getGui)=="function"}var bA=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){var o;if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){for(const i of s)this.toggleCss(i,t);return}}this.cssClassStates[e]!==t&&e.length&&((o=this.getGui())==null||o.classList.toggle(e,t),this.cssClassStates[e]=t)}},MY=0,Sh=class extends Oi{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=MY++,this.cssManager=new bA(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(n=>[n.selector,n])),e&&this.setTemplate(e)}preConstruct(){var t,n;this.wireTemplate(this.getGui());const e="component-"+((n=(t=Object.getPrototypeOf(this))==null?void 0:t.constructor)==null?void 0:n.name);for(const o of this.css??[])this.beans.environment.addGlobalCSS(o,e)}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(FI):null}applyElementsToComponent(e,t,n,o=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const s=this[t];if(s===Qe)this[t]=o??e;else{const i=n==null?void 0:n[t];if(!this.suppressDataRefValidation&&!i)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${s}`)}}}createChildComponentsFromTags(e,t){const n=[];for(const o of e.childNodes??[])n.push(o);for(const o of n){if(!(o instanceof HTMLElement))continue;const s=this.createComponentFromElement(o,i=>{const r=i.getGui();if(r)for(const a of o.attributes??[])r.setAttribute(a.name,a.value)},t);if(s){if(s.addItems&&o.children.length){this.createChildComponentsFromTags(o,t);const i=Array.prototype.slice.call(o.children);s.addItems(i)}this.swapComponentForNode(s,e,o)}else o.childNodes&&this.createChildComponentsFromTags(o,t)}}createComponentFromElement(e,t,n){const o=e.nodeName,s=this.getDataRefAttribute(e),i=o.indexOf("AG-")===0,r=i?this.componentSelectors.get(o):null;let a=null;if(r){const l=n&&s?n[s]:void 0;a=new r.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(i)throw new Error(`selector: ${o}`);return this.applyElementsToComponent(e,s,n,a),a}swapComponentForNode(e,t,n){const o=e.getGui();t.replaceChild(o,n),t.insertBefore(document.createComment(n.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const n of e)n.setAttribute("tabindex",t.toString())}setTemplate(e,t,n){let o;typeof e=="string"||e==null?o=zC(e):o=dh(e),this.setTemplateFromElement(o,t,n)}setTemplateFromElement(e,t,n,o=!1){if(this.eGui=e,this.suppressDataRefValidation=o,t)for(let s=0;s<t.length;s++){const i=t[s];this.componentSelectors.set(i.selector,i)}this.wireTemplate(e,n)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let n=t;return e==null?null:(n||(n=this.eGui),qC(e)?{element:e,parent:n}:{element:e.getGui(),parent:n})}prependChild(e,t){const{element:n,parent:o}=this.getContainerAndElement(e,t)||{};!n||!o||o.insertAdjacentElement("afterbegin",n)}appendChild(e,t){const{element:n,parent:o}=this.getContainerAndElement(e,t)||{};!n||!o||o.appendChild(n)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:n}=t;gq(this.eGui,e,{skipAriaHidden:n})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:n}=t;En(this.eGui,e,{skipAriaHidden:n});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,n){this.eGui.addEventListener(e,t,n),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css||(this.css=[]),this.css.push(e)}},rn=class extends Sh{};function SA(e){return typeof e=="object"&&!!e.component}function LY(e,t){return new Pn(n=>{n(window.setInterval(e,t))})}var Pn=class of{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(n=>this.onDone(n),n=>this.onReject(n))}static all(t){return t.length?new of(n=>{let o=t.length;const s=new Array(o);t.forEach((i,r)=>{i.then(a=>{s[r]=a,o--,o===0&&n(s)})})}):of.resolve()}static resolve(t=null){return new of(n=>n(t))}then(t){return new of(n=>{this.status===1?n(t(this.resolution)):this.waiters.push(o=>n(t(o)))})}onDone(t){this.status=1,this.resolution=t;for(const n of this.waiters)n(t)}onReject(t){}};function NY(e){return e?e.prototype&&"getGui"in e.prototype:!1}function EA(e,t,n,o){const{name:s}=n;let i,r,a,l,u,c;if(t){const d=t,h=d[s+"Selector"],f=h?h(o):null,p=m=>{typeof m=="string"?i=m:m!=null&&m!==!0&&(e.isFrameworkComponent(m)?a=m:r=m)};f?(p(f.component),l=f.params,u=f.popup,c=f.popupPosition):p(d[s])}return{compName:i,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:u,popupPositionFromSelector:c}}var VY=class extends Fe{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,n,o=!1){return this.getCompDetails(this.gridOptions,e,t,n,o)}getCompDetails(e,t,n,o,s=!1){var _;const{name:i,cellRenderer:r}=t;let{compName:a,jsComp:l,fwComp:u,paramsFromSelector:c,popupFromSelector:d,popupPositionFromSelector:h}=EA(this.beans.frameworkOverrides,e,t,o),f,p;const m=w=>{const R=this.registry.getUserComponent(i,w);R&&(l=R.componentFromFramework?void 0:R.component,u=R.componentFromFramework?R.component:void 0,f=R.params,p=R.processParams)};if(a!=null&&m(a),l==null&&u==null&&n!=null&&m(n),l&&r&&!NY(l)&&(l=(_=this.agCompUtils)==null?void 0:_.adaptFunction(t,l)),!l&&!u){const{validation:w}=this.beans;s&&(a!==n||!n)?a?w!=null&&w.isProvidedUserComp(a)||dn(50,{compName:a}):n?w||dn(260,{...this.gos.getModuleErrorParams(),propName:i,compName:n}):dn(216,{name:i}):n&&!w&&dn(146,{comp:n});return}const v=this.mergeParams(e,t,o,c,f,p),C=l==null,b=l??u;return{componentFromFramework:C,componentClass:b,params:v,type:t,popupFromSelector:d,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(b,C,v,t)}}newAgStackInstance(e,t,n,o){var a;const s=!t;let i;s?i=new e:i=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(i);const r=(a=i.init)==null?void 0:a.call(i,n);return r==null?Pn.resolve(i):r.then(()=>i)}mergeParams(e,t,n,o=null,s,i){const r={...n,...s},a=e,l=a==null?void 0:a[t.name+"Params"];if(typeof l=="function"){const u=l(n);Lo(r,u)}else typeof l=="object"&&Lo(r,l);return Lo(r,o),i?i(r):r}},BY={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},HY={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},$Y={name:"headerComponent",optionalMethods:["refresh"]},GY={name:"innerHeaderComponent"},WY={name:"innerHeaderGroupComponent"},UY={name:"headerGroupComponent"},zY={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},jY={name:"loadingCellRenderer",cellRenderer:!0},KY={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},qY={name:"loadingOverlayComponent",optionalMethods:["refresh"]},YY={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},ZY={name:"tooltipComponent"},hb={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},XY={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},JY={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},QY={name:"loadingCellRenderer",cellRenderer:!0},eZ={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},tZ={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function nZ(e,t){return e.getCompDetailsFromGridOptions(HY,"agDragAndDropImage",t,!0)}function oZ(e,t,n){return e.getCompDetails(t,$Y,"agColumnHeader",n)}function sZ(e,t,n){return e.getCompDetails(t,GY,void 0,n)}function iZ(e,t){const n=t.columnGroup.getColGroupDef();return e.getCompDetails(n,UY,"agColumnGroupHeader",t)}function rZ(e,t,n){return e.getCompDetails(t,WY,void 0,n)}function aZ(e,t){return e.getCompDetailsFromGridOptions(JY,void 0,t,!0)}function lZ(e,t){return e.getCompDetailsFromGridOptions(QY,"agLoadingCellRenderer",t,!0)}function uZ(e,t){return e.getCompDetailsFromGridOptions(eZ,"agGroupRowRenderer",t,!0)}function cZ(e,t){return e.getCompDetailsFromGridOptions(tZ,"agDetailCellRenderer",t,!0)}function RA(e,t,n){return e.getCompDetails(t,zY,void 0,n)}function _A(e,t,n){return e.getCompDetails(t,jY,"agSkeletonCellRenderer",n,!0)}function DA(e,t,n){return e.getCompDetails(t,KY,"agCellEditor",n,!0)}function dZ(e,t,n,o){const s=t.filter;return SA(s)&&(t={filter:s.component,filterParams:t.filterParams}),e.getCompDetails(t,hb,o,n,!0)}function hZ(e,t,n){return e.getCompDetails(t,BY,"agDateInput",n,!0)}function fZ(e,t){return e.getCompDetailsFromGridOptions(qY,"agLoadingOverlay",t,!0)}function pZ(e,t){return e.getCompDetailsFromGridOptions(YY,"agNoRowsOverlay",t,!0)}function gZ(e,t){return e.getCompDetails(t.colDef,ZY,"agTooltipComponent",t,!0)}function mZ(e,t,n,o){return e.getCompDetails(t,XY,o,n)}function xA(e,t){return EA(e,t,hb)}function fb(e,t,n){return e.mergeParams(t,hb,n)}function Eh(e){const t=e;return(t==null?void 0:t.getFrameworkComponentInstance)!=null?t.getFrameworkComponentInstance():e}function vZ(e){return typeof e=="object"&&!!e.getComp}var we={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},pb=class extends Sh{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;(e==null?void 0:e.isAlive())&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},gb,mb,vb,yb,wb,Cb,bb;function pa(){return gb===void 0&&(gb=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),gb}function TA(){return mb===void 0&&(mb=/(firefox)/i.test(navigator.userAgent)),mb}function FA(){return vb===void 0&&(vb=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),vb}function bl(){return yb===void 0&&(yb=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),yb}function Sb(e){if(!e)return null;const t=e.tabIndex,n=e.getAttribute("tabIndex");return t===-1&&(n===null||n===""&&!TA())?null:t.toString()}function yZ(){if(bb!==void 0)return bb;if(!document.body)return-1;let e=1e6;const t=TA()?6e6:1e9,n=document.createElement("div");for(document.body.appendChild(n);;){const o=e*2;if(n.style.height=o+"px",o>t||n.clientHeight!==o)break;e=o}return n.remove(),bb=e,e}function wZ(){return Cb==null&&PA(),Cb}function PA(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let n=t.offsetWidth-t.clientWidth;n===0&&t.clientWidth===0&&(n=null),t.parentNode&&t.remove(),n!=null&&(Cb=n,wb=n===0)}function IA(){return wb==null&&PA(),wb}var Eb="T",CZ=new RegExp(`[${Eb} ]`),bZ=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${Eb}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Ni(e,t){return e.toString().padStart(t,"0")}function hs(e,t=!0,n=Eb){if(!e)return null;let o=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(s=>Ni(s,2)).join("-");return t&&(o+=n+[e.getHours(),e.getMinutes(),e.getSeconds()].map(s=>Ni(s,2)).join(":")),o}function Wg(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),Ni(e.getDate(),2),Ni(e.getHours(),2),`:${Ni(e.getMinutes(),2)}`,`:${Ni(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,Ni(e.getDate(),2)].map(String):null}var Rb=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},AA=["January","February","March","April","May","June","July","August","September","October","November","December"],_b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Db(e,t){if(t==null)return hs(e,!1);const n=Ni(e.getFullYear(),4),o={YYYY:()=>n.slice(n.length-4,n.length),YY:()=>n.slice(n.length-2,n.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>AA[e.getMonth()],MMM:()=>AA[e.getMonth()].slice(0,3),MM:()=>Ni(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Rb(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Rb(e.getDate())}`,DD:()=>Ni(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>_b[e.getDay()],ddd:()=>_b[e.getDay()].slice(0,3),dd:()=>_b[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Rb(e.getDay())}`,d:()=>`${e.getDay()}`},s=new RegExp(Object.keys(o).join("|"),"g");return t.replace(s,i=>i in o?o[i]():i)}function Ug(e,t=!1){return!!Uo(e,t)}function SZ(e){return Ug(e,!0)}function Uo(e,t=!1,n){if(!e||!n&&!bZ.test(e))return null;const[o,s]=e.split(CZ);if(!o)return null;const i=o.split("-").map(f=>Number.parseInt(f,10));if(i.filter(f=>!isNaN(f)).length!==3)return null;const[r,a,l]=i,u=new Date(r,a-1,l);if(u.getFullYear()!==r||u.getMonth()!==a-1||u.getDate()!==l||!s&&t)return null;if(!s||s==="00:00:00")return u;const[c,d,h]=s.split(":").map(f=>Number.parseInt(f,10));if(c>=0&&c<24)u.setHours(c);else if(t)return null;if(d>=0&&d<60)u.setMinutes(d);else if(t)return null;if(h>=0&&h<60)u.setSeconds(h);else if(t)return null;return u}function xb(e){const{inputValue:t,allSuggestions:n,hideIrrelevant:o,filterByPercentageOfBestMatch:s}=e;let i=(n??[]).map((l,u)=>({value:l,relevance:EZ(t,l),idx:u}));if(i.sort((l,u)=>l.relevance-u.relevance),o&&(i=i.filter(l=>l.relevance<Math.max(l.value.length,t.length))),i.length>0&&s&&s>0){const u=i[0].relevance*s;i=i.filter(c=>u-c.relevance<0)}const r=[],a=[];for(const l of i)r.push(l.value),a.push(l.idx);return{values:r,indices:a}}function EZ(e,t){e.length<t.length&&([e,t]=[t,e]);let n=[],o=[];const s=e.length,i=t.length;for(let a=0;a<=i;a++)n[a]=a;let r=0;for(let a=1;a<=s;a++){o[0]=a;for(let l=1;l<=i;l++){const u=e[a-1],c=t[l-1];if(u.toLocaleLowerCase()===c.toLocaleLowerCase())++r,u===c&&++r,a>1&&l>1&&e[a-2].toLocaleLowerCase()===t[l-2].toLocaleLowerCase()&&(++r,e[a-2]===t[l-2]&&++r),a<s/2-10&&++r,o[l]=n[l-1];else{const d=o[l-1],h=n[l],f=n[l-1];o[l]=1+Math.min(d,h,f)}}[n,o]=[o,n]}return n[i]/(r+1)}function kA(e){var n;return e.altKey||e.ctrlKey||e.metaKey?!1:((n=e.key)==null?void 0:n.length)===1}var Tb=!1,zg=0;function RZ(e){zg>0||(e.addEventListener("keydown",jg),e.addEventListener("mousedown",jg))}function _Z(e){zg>0||(e.removeEventListener("keydown",jg),e.removeEventListener("mousedown",jg))}function jg(e){const t=Tb,n=e.type==="keydown";n&&(e.ctrlKey||e.metaKey||e.altKey)||t!==n&&(Tb=n)}function DZ(e){const t=no(e);return RZ(t),zg++,()=>{zg--,_Z(t)}}function xZ(){return Tb}function ec(e,t,n=!1){const o=pq;let s=SI;t&&(s+=", "+t),n&&(s+=', [tabindex="-1"]');const i=Array.prototype.slice.apply(e.querySelectorAll(o)).filter(l=>Ai(l)),r=Array.prototype.slice.apply(e.querySelectorAll(s));return r.length?((l,u)=>l.filter(c=>u.indexOf(c)===-1))(i,r):i}function Sl(e,t=!1,n=!1,o=!1){const s=ec(e,o?".ag-tab-guard":null,n),i=t?fn(s):s[0];return i?(i.focus({preventScroll:!0}),!0):!1}function El(e,t,n,o){const s=ec(t,n?':not([tabindex="-1"])':null),i=Dn(e);let r;n?r=s.findIndex(l=>l.contains(i)):r=s.indexOf(i);const a=r+(o?-1:1);return a<0||a>=s.length?null:s[a]}function OA(e,t=5){let n=0;for(;e&&Sb(e)===null&&++n<=t;)e=e.parentElement;return Sb(e)===null?null:e}var TZ=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",FZ=class extends Sh{constructor(e,t,n){super(t,n),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(TZ)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:n,labelAlignment:o,disabled:s}=this.config;s!=null&&this.setDisabled(s),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),n!=null&&this.setLabelWidth(n),this.setLabelAlignment(o||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;co(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(En(t,!1),aa(t,"presentation")):(En(t,!0),aa(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const n=this.getGui().classList;return n.toggle("ag-label-align-left",e==="left"),n.toggle("ag-label-align-right",e==="right"),n.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(Tg(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return ah(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},MA=class extends FZ{constructor(e,t,n,o){super(e,t,n),this.className=o}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:n}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),n!=null&&this.onValueChange(n),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),n=this.getLabel();n==null||n==""||JK(e)!==null?ih(e,""):ih(e,t??"")}setAriaLabel(e){return Uu(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return ki(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function PZ(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var Rl=class extends MA{constructor(e,t,n="text",o="input"){super(e,(e==null?void 0:e.template)??PZ(o),[],t),this.inputType=n,this.displayFieldTag=o,this.eLabel=Qe,this.eWrapper=Qe,this.eInput=Qe}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:n,className:o}=this;e.classList.add(`${o}-label`),t.classList.add(`${o}-input-wrapper`),n.classList.add(`${o}-input`),this.addCss("ag-input-field"),n.id=n.id||`ag-${this.getCompId()}-input`;const{inputName:s,inputWidth:i}=this.config;s!=null&&this.setInputName(s),i!=null&&this.setInputWidth(i),this.addInputListeners(),this.activateTabIndex([n])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,cs(this.eInput,"type",e))}getInputElement(){return this.eInput}setInputWidth(e){return Tg(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return cs(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Uu(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ah(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)cs(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";cs(this.eInput,"autocomplete",t)}return this}},Fb=class extends Rl{constructor(e,t="ag-checkbox",n="checkbox"){super(e,t,n),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const n=this.eInput;n.checked=e,n.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,n){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:n});const o=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:o.id,name:o.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),n=this.selected=e.target.checked;this.refreshSelectedClass(n),this.dispatchChange(n,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},Pb={selector:"AG-CHECKBOX",component:Fb},IZ=class extends Fb{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},_l=class extends Rl{constructor(e,t="ag-text-field",n="text"){super(e,t,n)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const n=this.eInput;return n.value!==e&&(n.value=et(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=n=>{kA(n)&&n.key&&!e.test(n.key)&&n.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:n=>{var s;const o=(s=n.clipboardData)==null?void 0:s.getData("text");o!=null&&o.split("").some(i=>!e.test(i))&&n.preventDefault()}})}},Kg={selector:"AG-INPUT-TEXT-FIELD",component:_l},AZ=class extends Rl{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const n=super.setValue(e,t);return this.eInput.value=e,n}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},kZ={selector:"AG-INPUT-TEXT-AREA",component:AZ},Ib=class extends _l{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const i=Number.parseFloat(e.value),r=isNaN(i)?"":this.normalizeValue(i.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:n,max:o,step:s}=this.config;typeof t=="number"&&this.setPrecision(t),typeof n=="number"&&this.setMin(n),typeof o=="number"&&this.setMax(o),typeof s=="number"&&this.setStep(s)}onWheel(e){Dn(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const n=this.precision;if(n==null)return e;if(t){const s=Number.parseFloat(e).toFixed(n);return Number.parseFloat(s).toString()}const o=String(e).split(".");if(o.length>1){if(o[1].length<=n)return e;if(n>0)return`${o[0]}.${o[1].slice(0,n)}`}return o[0]}setMin(e){return this.min===e?this:(this.min=e,cs(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,cs(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,cs(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(n=>super.setValue(n,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,n){if(et(n)){let o=this.isScientificNotation(n);if(o&&this.eInput.validity.valid)return e(n);if(!o){n=this.adjustPrecision(n);const s=this.normalizeValue(n);o=n!=s}if(o)return t(n)}return e(n)}getValue(){const e=this.eInput;if(!e.validity.valid)return;const t=e.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},OZ={selector:"AG-INPUT-NUMBER-FIELD",component:Ib},MZ=class extends _l{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=pa();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Dn(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?hs(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,cs(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?hs(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,cs(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,cs(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return Uo(this.getValue())??void 0}setDate(e,t){this.setValue(hs(e??null,this.includeTime),t)}},LA={selector:"AG-INPUT-DATE-FIELD",component:MZ},LZ=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",NZ="ag-active-item",VZ=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",ref:"eText",children:t}]}),BZ=class extends Sh{constructor(e,t,n){super(VZ(e,t)),this.label=t,this.value=n,this.eText=Qe}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(NZ,e),CI(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const n=this.getGui();sq(n,e),oq(n,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>jC(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},HZ=class extends Sh{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(LZ)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case we.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const n=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(n)}break;case we.DOWN:case we.UP:e.preventDefault(),this.navigate(t);break;case we.PAGE_DOWN:case we.PAGE_UP:case we.PAGE_HOME:case we.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:n}=e,o=n??t;return this.options.push({value:t,text:o}),this.renderOption(t,o),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();co(this.getGui()),this.listItems=[],this.refreshAriaRole()}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const n=this.options.findIndex(o=>o.value===e);if(n!==-1){const o=this.options[n];this.value=o.value,this.displayValue=o.text,this.highlightItem(this.listItems[n]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!Ai(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const n=this.getGui(),{scrollTop:o,clientHeight:s}=n,{offsetTop:i,offsetHeight:r}=t;(i+r>o+s||i<o)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){var e,t;(t=(e=this.highlightedItem)==null?void 0:e.tooltipFeature)==null||t.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){var e;(e=this.highlightedItem)==null||e.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const n=new BZ(this.cssIdentifier,t,e);n.setParentComponent(this);const o=this.createManagedBean(n);this.listItems.push(o),this.getGui().appendChild(o.getGui())}navigate(e){const t=e===we.DOWN;let n;const{listItems:o,highlightedItem:s}=this;if(!s)n=t?o[0]:fn(o);else{let r=o.indexOf(s)+(t?1:-1);r=Math.min(Math.max(r,0),o.length-1),n=o[r]}this.highlightItem(n)}navigateToPage(e){const{listItems:t,highlightedItem:n}=this;if(!n||t.length===0)return;const o=t.indexOf(n),s=this.options.length-1,i=t[0].getHeight(),r=Math.floor(this.getGui().clientHeight/i);let a=-1;e===we.PAGE_HOME?a=0:e===we.PAGE_END?a=s:e===we.PAGE_DOWN?a=Math.min(o+r,s):e===we.PAGE_UP&&(a=Math.max(o-r,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){aa(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((n,o)=>{n.setIndex(o+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},$Z=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.ag-picker-has-focus),&:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:disabled{opacity:.5}}",GZ={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},WZ=class extends MA{constructor(e){if(super(e,(e==null?void 0:e.template)||GZ,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=Qe,this.eWrapper=Qe,this.eDisplayField=Qe,this.eIcon=Qe,this.registerCSS($Z),this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:n,variableWidth:o,minPickerWidth:s,maxPickerWidth:i}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!o,n!=null&&this.setPickerMaxHeight(n),s!=null&&this.setPickerMinWidth(s),i!=null&&this.setPickerMaxWidth(i)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:n,inputWidth:o}=this.config;if(n){const s=this.beans.iconSvc.createIconNoSpan(n);s&&this.eIcon.appendChild(s)}o!=null&&this.setInputWidth(o)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),WC(e,!1),this.ariaRole&&aa(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case we.UP:case we.DOWN:case we.ENTER:case we.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case we.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:n,pickerAriaLabelValue:o,modalPicker:s=!0},maxPickerHeight:i,minPickerWidth:r,maxPickerWidth:a,variableWidth:l,beans:u,eWrapper:c}=this,d={modal:s,eChild:e,closeOnEsc:!0,closedCallback:()=>{const m=fI(u);this.beforeHidePicker(),m&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(n,o),anchorToElement:c};e.style.position="absolute";const h=u.popupSvc,f=h.addPopup(d);l?(r&&(e.style.minWidth=r),e.style.width=KC(Rg(c)),a&&(e.style.maxWidth=a)):Tg(e,a??Rg(c));const p=i??`${UC(h.getPopupParent())}px`;return e.style.setProperty("max-height",p),this.alignPickerToComponent(),f.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:n,gos:o},eWrapper:s,pickerComponent:i}=this,r=o.get("enableRtl")?"right":"left";n.positionPopupByComponent({type:t,eventSource:s,ePopup:i.getGui(),position:"under",alignSide:r,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();WC(t,e);const n=this.eWrapper.classList;n.toggle("ag-picker-expanded",e),n.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return Tg(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},UZ=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}",Ab=class extends WZ{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(UZ)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:xg(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:n}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),n&&t==null&&(this.eDisplayField.textContent=n),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new HZ("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),n=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",n),fq(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:o=>{o==null||o.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){var e;(e=this.listComponent)==null||e.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){var n;const{key:t}=e;switch(t===we.TAB&&this.hidePicker(),t){case we.ENTER:case we.UP:case we.DOWN:case we.PAGE_UP:case we.PAGE_DOWN:case we.PAGE_HOME:case we.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(n=this.listComponent)==null||n.handleKeyDown(e):super.onKeyDown(e);break;case we.ESCAPE:super.onKeyDown(e);break;case we.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this.setValue(void 0,!0),this}setValue(e,t,n){const{listComponent:o,config:{placeholder:s},eDisplayField:i,tooltipFeature:r}=this;if(this.value===e||!o)return this;if(n||o.setValue(e,!0),o.getValue()===this.getValue())return this;let l=o.getDisplayValue();return l==null&&s&&(l=s),i.textContent=l,r==null||r.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},zZ={selector:"AG-SELECT",component:Ab},jZ=':where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}&:where(button){color:inherit}}:where(.ag-root-wrapper,ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-popup-child{top:0;z-index:5;&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}',kb=typeof window!="object"||!((RL=(EL=window==null?void 0:window.document)==null?void 0:EL.fonts)!=null&&RL.forEach),tc=(e,t,n,o,s,i)=>{if(kb)return;o&&(e=`@layer ${CSS.escape(o)} { ${e} }`);let r=nc.map.get(t);if(r||(r=[],nc.map.set(t,r)),r.some(c=>c.css===e))return;const a=document.createElement("style");i&&a.setAttribute("nonce",i),a.dataset.agGlobalCss=n,a.textContent=e;const l={css:e,el:a,priority:s};let u;for(const c of r){if(c.priority>s)break;u=c}if(u){u.el.insertAdjacentElement("afterend",a);const c=r.indexOf(u);r.splice(c+1,0,l)}else t.insertBefore(a,t.querySelector(":not(title, meta)")),r.push(l)},NA=(e,t,n,o)=>{tc(jZ,e,"shared",t,0,n),o==null||o.forEach((s,i)=>s.forEach(r=>tc(r,e,i,t,0,n)))},KZ=e=>{nc.grids.add(e)},qZ=e=>{if(nc.grids.delete(e),nc.grids.size===0){nc.map=new WeakMap;for(const t of document.head.querySelectorAll("style[data-ag-global-css]"))t.remove()}},VA,nc=(VA=typeof window=="object"?window:{}).agStyleInjectionState??(VA.agStyleInjectionState={map:new WeakMap,grids:new Set}),Vi=e=>new BA(e),ga="$default",YZ=0,BA=class{constructor({feature:e,params:t,modeParams:n={},css:o,cssImports:s}){this.feature=e,this.css=o,this.cssImports=s,this.modeParams={[ga]:{...n[ga]??{},...t??{}},...n}}use(e,t,n){let o=this._inject;if(o==null){let{css:s}=this;if(s){const i=`ag-theme-${this.feature??"part"}-${++YZ}`;typeof s=="function"&&(s=s()),s=`:where(.${i}) {
|
|
@@ -223,9 +223,9 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
|
|
|
223
223
|
`)}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[QM]=this[QM]={accessors:{}}).accessors,s=this.prototype;function i(r){const a=Uh(r);o[a]||(uhe(s,r),o[a]=!0)}return Re.isArray(t)?t.forEach(i):i(t),this}};qo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(qo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),Re.freezeMethods(qo);function e0(e,t){const n=this||Wh,o=t||n,s=qo.from(o.headers);let i=o.data;return Re.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function eL(e){return!!(e&&e.__CANCEL__)}function wc(e,t,n){Ht.call(this,e??"canceled",Ht.ERR_CANCELED,t,n),this.name="CanceledError"}Re.inherits(wc,Ht,{__CANCEL__:!0});function tL(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new Ht("Request failed with status code "+n.status,[Ht.ERR_BAD_REQUEST,Ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function che(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dhe(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=o[i];r||(r=u),n[s]=l,o[s]=u;let d=i,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-r<t)return;const f=c&&u-c;return f?Math.round(h*1e3/f):void 0}}function hhe(e,t){let n=0,o=1e3/t,s,i;const r=(u,c=Date.now())=>{n=c,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=o?r(u,c):(s=u,i||(i=setTimeout(()=>{i=null,r(s)},o-d)))},()=>s&&r(s)]}const km=(e,t,n=3)=>{let o=0;const s=dhe(50,250);return hhe(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-o,u=s(l),c=r<=a;o=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-r)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},nL=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},oL=e=>(...t)=>Re.asap(()=>e(...t)),fhe=Do.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Do.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Do.origin),Do.navigator&&/(msie|trident)/i.test(Do.navigator.userAgent)):()=>!0,phe=Do.hasStandardBrowserEnv?{write(e,t,n,o,s,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Re.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Re.isString(o)&&a.push(`path=${o}`),Re.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),Re.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ghe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mhe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function sL(e,t,n){let o=!ghe(t);return e&&(o||n==!1)?mhe(e,t):t}const iL=e=>e instanceof qo?{...e}:e;function kl(e,t){t=t||{};const n={};function o(u,c,d,h){return Re.isPlainObject(u)&&Re.isPlainObject(c)?Re.merge.call({caseless:h},u,c):Re.isPlainObject(c)?Re.merge({},c):Re.isArray(c)?c.slice():c}function s(u,c,d,h){if(Re.isUndefined(c)){if(!Re.isUndefined(u))return o(void 0,u,d,h)}else return o(u,c,d,h)}function i(u,c){if(!Re.isUndefined(c))return o(void 0,c)}function r(u,c){if(Re.isUndefined(c)){if(!Re.isUndefined(u))return o(void 0,u)}else return o(void 0,c)}function a(u,c,d){if(d in t)return o(u,c);if(d in e)return o(void 0,u)}const l={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(u,c,d)=>s(iL(u),iL(c),d,!0)};return Re.forEach(Object.keys({...e,...t}),function(c){const d=l[c]||s,h=d(e[c],t[c],c);Re.isUndefined(h)&&d!==a||(n[c]=h)}),n}const rL=e=>{const t=kl({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=qo.from(r),t.url=YM(sL(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Re.isFormData(n)){if(Do.hasStandardBrowserEnv||Do.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Re.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&r.set(c,d)})}}if(Do.hasStandardBrowserEnv&&(o&&Re.isFunction(o)&&(o=o(t)),o||o!==!1&&fhe(t.url))){const l=s&&i&&phe.read(i);l&&r.set(s,l)}return t},vhe=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const s=rL(e);let i=s.data;const r=qo.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=s,c,d,h,f,p;function m(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(c),s.signal&&s.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function C(){if(!v)return;const _=qo.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:_,config:e,request:v};tL(function(T){n(T),m()},function(T){o(T),m()},R),v=null}"onloadend"in v?v.onloadend=C:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(C)},v.onabort=function(){v&&(o(new Ht("Request aborted",Ht.ECONNABORTED,e,v)),v=null)},v.onerror=function(w){const R=w&&w.message?w.message:"Network Error",E=new Ht(R,Ht.ERR_NETWORK,e,v);E.event=w||null,o(E),v=null},v.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||XM;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),o(new Ht(w,R.clarifyTimeoutError?Ht.ETIMEDOUT:Ht.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Re.forEach(r.toJSON(),function(w,R){v.setRequestHeader(R,w)}),Re.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),u&&([h,p]=km(u,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=km(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(c=_=>{v&&(o(!_||_.type?new wc(null,e,v):_),v.abort(),v=null)},s.cancelToken&&s.cancelToken.subscribe(c),s.signal&&(s.signal.aborted?c():s.signal.addEventListener("abort",c)));const b=che(s.url);if(b&&Do.protocols.indexOf(b)===-1){o(new Ht("Unsupported protocol "+b+":",Ht.ERR_BAD_REQUEST,e));return}v.send(i||null)})},yhe=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,s;const i=function(u){if(!s){s=!0,a();const c=u instanceof Error?u:this.reason;o.abort(c instanceof Ht?c:new wc(c instanceof Error?c.message:c))}};let r=t&&setTimeout(()=>{r=null,i(new Ht(`timeout ${t} of ms exceeded`,Ht.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=o;return l.unsubscribe=()=>Re.asap(a),l}},whe=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},Che=async function*(e,t){for await(const n of bhe(e))yield*whe(n,t)},bhe=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()}},aL=(e,t,n,o)=>{const s=Che(e,t);let i=0,r,a=l=>{r||(r=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await s.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},lL=64*1024,{isFunction:Om}=Re,She=(({Request:e,Response:t})=>({Request:e,Response:t}))(Re.global),{ReadableStream:uL,TextEncoder:cL}=Re.global,dL=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ehe=e=>{e=Re.merge.call({skipUndefined:!0},She,e);const{fetch:t,Request:n,Response:o}=e,s=t?Om(t):typeof fetch=="function",i=Om(n),r=Om(o);if(!s)return!1;const a=s&&Om(uL),l=s&&(typeof cL=="function"?(p=>m=>p.encode(m))(new cL):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&a&&dL(()=>{let p=!1;const m=new n(Do.origin,{body:new uL,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),c=r&&a&&dL(()=>Re.isReadableStream(new o("").body)),d={stream:c&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,v)=>{let C=m&&m[p];if(C)return C.call(m);throw new Ht(`Response type '${p}' is not supported`,Ht.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Re.isBlob(p))return p.size;if(Re.isSpecCompliantForm(p))return(await new n(Do.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Re.isArrayBufferView(p)||Re.isArrayBuffer(p))return p.byteLength;if(Re.isURLSearchParams(p)&&(p=p+""),Re.isString(p))return(await l(p)).byteLength},f=async(p,m)=>{const v=Re.toFiniteNumber(p.getContentLength());return v??h(m)};return async p=>{let{url:m,method:v,data:C,signal:b,cancelToken:_,timeout:w,onDownloadProgress:R,onUploadProgress:E,responseType:T,headers:x,withCredentials:k="same-origin",fetchOptions:I}=rL(p),F=t||fetch;T=T?(T+"").toLowerCase():"text";let A=yhe([b,_&&_.toAbortSignal()],w),M=null;const V=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let X;try{if(E&&u&&v!=="get"&&v!=="head"&&(X=await f(x,C))!==0){let de=new n(m,{method:"POST",body:C,duplex:"half"}),ve;if(Re.isFormData(C)&&(ve=de.headers.get("content-type"))&&x.setContentType(ve),de.body){const[se,te]=nL(X,km(oL(E)));C=aL(de.body,lL,se,te)}}Re.isString(k)||(k=k?"include":"omit");const O=i&&"credentials"in n.prototype,B={...I,signal:A,method:v.toUpperCase(),headers:x.normalize().toJSON(),body:C,duplex:"half",credentials:O?k:void 0};M=i&&new n(m,B);let N=await(i?F(M,I):F(m,B));const z=c&&(T==="stream"||T==="response");if(c&&(R||z&&V)){const de={};["status","statusText","headers"].forEach(J=>{de[J]=N[J]});const ve=Re.toFiniteNumber(N.headers.get("content-length")),[se,te]=R&&nL(ve,km(oL(R),!0))||[];N=new o(aL(N.body,lL,se,()=>{te&&te(),V&&V()}),de)}T=T||"text";let q=await d[Re.findKey(d,T)||"text"](N,p);return!z&&V&&V(),await new Promise((de,ve)=>{tL(de,ve,{data:q,headers:qo.from(N.headers),status:N.status,statusText:N.statusText,config:p,request:M})})}catch(O){throw V&&V(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new Ht("Network Error",Ht.ERR_NETWORK,p,M),{cause:O.cause||O}):Ht.from(O,O&&O.code,p,M)}}},Rhe=new Map,hL=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:s}=t,i=[o,s,n];let r=i.length,a=r,l,u,c=Rhe;for(;a--;)l=i[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:Ehe(t)),c=u;return u};hL();const t0={http:jde,xhr:vhe,fetch:{get:hL}};Re.forEach(t0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const fL=e=>`- ${e}`,_he=e=>Re.isFunction(e)||e===null||e===!1;function Dhe(e,t){e=Re.isArray(e)?e:[e];const{length:n}=e;let o,s;const i={};for(let r=0;r<n;r++){o=e[r];let a;if(s=o,!_he(o)&&(s=t0[(a=String(o)).toLowerCase()],s===void 0))throw new Ht(`Unknown adapter '${a}'`);if(s&&(Re.isFunction(s)||(s=s.get(t))))break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
|
|
224
224
|
`+r.map(fL).join(`
|
|
225
225
|
`):" "+fL(r[0]):"as no adapter specified";throw new Ht("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const pL={getAdapter:Dhe,adapters:t0};function n0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wc(null,e)}function gL(e){return n0(e),e.headers=qo.from(e.headers),e.data=e0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pL.getAdapter(e.adapter||Wh.adapter,e)(e).then(function(o){return n0(e),o.data=e0.call(e,e.transformResponse,o),o.headers=qo.from(o.headers),o},function(o){return eL(o)||(n0(e),o&&o.response&&(o.response.data=e0.call(e,e.transformResponse,o.response),o.response.headers=qo.from(o.response.headers))),Promise.reject(o)})}const mL="1.13.2",Mm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mm[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const vL={};Mm.transitional=function(t,n,o){function s(i,r){return"[Axios v"+mL+"] Transitional option '"+i+"'"+r+(o?". "+o:"")}return(i,r,a)=>{if(t===!1)throw new Ht(s(r," has been removed"+(n?" in "+n:"")),Ht.ERR_DEPRECATED);return n&&!vL[r]&&(vL[r]=!0,console.warn(s(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,r,a):!0}},Mm.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function xhe(e,t,n){if(typeof e!="object")throw new Ht("options must be an object",Ht.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const i=o[s],r=t[i];if(r){const a=e[i],l=a===void 0||r(a,i,e);if(l!==!0)throw new Ht("option "+i+" must be "+l,Ht.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ht("Unknown option "+i,Ht.ERR_BAD_OPTION)}}const Lm={assertOptions:xhe,validators:Mm},Ui=Lm.validators;let Ol=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ZM,response:new ZM}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
226
|
-
`+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=kl(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:i}=n;o!==void 0&&Lm.assertOptions(o,{silentJSONParsing:Ui.transitional(Ui.boolean),forcedJSONParsing:Ui.transitional(Ui.boolean),clarifyTimeoutError:Ui.transitional(Ui.boolean)},!1),s!=null&&(Re.isFunction(s)?n.paramsSerializer={serialize:s}:Lm.assertOptions(s,{encode:Ui.function,serialize:Ui.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Lm.assertOptions(n,{baseUrl:Ui.spelling("baseURL"),withXsrfToken:Ui.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Re.merge(i.common,i[n.method]);i&&Re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=qo.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let c,d=0,h;if(!l){const p=[gL.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(v){m.call(this,v);break}}try{c=gL.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=kl(this.defaults,t);const n=sL(t.baseURL,t.url,t.allowAbsoluteUrls);return YM(n,t.params,t.paramsSerializer)}};Re.forEach(["delete","get","head","options"],function(t){Ol.prototype[t]=function(n,o){return this.request(kl(o||{},{method:t,url:n,data:(o||{}).data}))}}),Re.forEach(["post","put","patch"],function(t){function n(o){return function(i,r,a){return this.request(kl(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}Ol.prototype[t]=n(),Ol.prototype[t+"Form"]=n(!0)});let The=class tN{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const o=this;this.promise.then(s=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](s);o._listeners=null}),this.promise.then=s=>{let i;const r=new Promise(a=>{o.subscribe(a),i=a}).then(s);return r.cancel=function(){o.unsubscribe(i)},r},t(function(i,r,a){o.reason||(o.reason=new wc(i,r,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 tN(function(s){t=s}),cancel:t}}};function Fhe(e){return function(n){return e.apply(null,n)}}function Phe(e){return Re.isObject(e)&&e.isAxiosError===!0}const o0={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(o0).forEach(([e,t])=>{o0[t]=e});function yL(e){const t=new Ol(e),n=OM(Ol.prototype.request,t);return Re.extend(n,Ol.prototype,t,{allOwnKeys:!0}),Re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return yL(kl(e,s))},n}const Hn=yL(Wh);Hn.Axios=Ol,Hn.CanceledError=wc,Hn.CancelToken=The,Hn.isCancel=eL,Hn.VERSION=mL,Hn.toFormData=Im,Hn.AxiosError=Ht,Hn.Cancel=Hn.CanceledError,Hn.all=function(t){return Promise.all(t)},Hn.spread=Fhe,Hn.isAxiosError=Phe,Hn.mergeConfig=kl,Hn.AxiosHeaders=qo,Hn.formToJSON=e=>JM(Re.isHTMLForm(e)?new FormData(e):e),Hn.getAdapter=pL.getAdapter,Hn.HttpStatusCode=o0,Hn.default=Hn;const{Axios:Qye,AxiosError:ewe,CanceledError:twe,isCancel:nwe,CancelToken:owe,VERSION:swe,all:iwe,Cancel:rwe,isAxiosError:Ihe,spread:awe,toFormData:lwe,AxiosHeaders:uwe,HttpStatusCode:cwe,formToJSON:dwe,getAdapter:hwe,mergeConfig:fwe}=Hn,Ahe=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const o=n.pop();return(o==null?void 0:o.split(";").shift())??null}return null},khe=6e4,wL=1e3/5;let CL=0;const Nm=[];let Vm=!1;const s0=()=>{if(Vm||Nm.length===0)return;Vm=!0;const t=Date.now()-CL;if(t>=wL){const n=Nm.shift();CL=Date.now(),n==null||n(),Vm=!1,Nm.length>0&&s0()}else{const n=wL-t;setTimeout(()=>{Vm=!1,s0()},n)}},Ohe=()=>new Promise(e=>{Nm.push(e),s0()}),Mhe=(()=>{const e=Hn.create({timeout:khe,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{await Ohe();const n=Ahe("account.token");return n&&t.headers&&(t.headers.Authorization=`Bearer ${n}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>t,async t=>{var o,s;const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const i=t.response.headers["retry-after"],r=i?parseInt(i)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(a=>setTimeout(a,r)),e(n)}return((s=t.response)==null?void 0:s.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class zh extends Error{constructor(t,n,o,s,i){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=i,Object.setPrototypeOf(this,zh.prototype)}}const jh=e=>{var t,n;if(Ihe(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,i=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",r=(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===Lu.UNAUTHORIZED||o===Lu.FORBIDDEN?l="AUTH":o===Lu.UNPROCESSABLE_ENTITY||o===Lu.BAD_REQUEST?l="VALIDATION":o>=Lu.BAD_REQUEST&&(l="CLIENT"),new zh(i,o,r,a,l)}return e instanceof Error?new zh(e.message,void 0,void 0,void 0,"UNKNOWN"):new zh("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class Lhe{constructor(){this.axios=Mhe}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,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(s,String(r))):typeof i=="object"?n.append(s,JSON.stringify(i)):n.append(s,String(i)))});const o=n.toString();return o?`?${o}`:""}async get(t="",n,o){try{const s=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${s}${i}`,o)).data}catch(s){throw jh(s)}}async post(t="",n,o,s){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,o,s)).data}catch(i){throw jh(i)}}async put(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.put(s,n,o)).data}catch(s){throw jh(s)}}async patch(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.patch(s,n,o)).data}catch(s){throw jh(s)}}async delete(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.delete(s,{data:n,...o})).data}catch(s){throw jh(s)}}}const Nhe=({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}/workspace/${t}/entities/${n}/items/export-format?format=xlsx`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/workspace/${t}/entities/${n}/items/import`,method:"post",code:"importItems"},exportItems:{url:`${e}/workspace/${t}/entities/${n}/items/export?format=xlsx`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/workspace/${t}/entities/${n}/items/update-from-file`,method:"post",code:"updateFromFile"},getStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"getStatuses"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/workspace/${t}/items/{itemId}`,method:"put",code:"item"},createNewScene:{url:`${e}/workspace/${t}/items`,method:"post",code:"createNewScene"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/workspace/${t}/ws-user-roles`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"}}),Vhe=(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 bL extends Lhe{constructor(t,n){const o=n==null?void 0:n.domainApi,s=(n==null?void 0:n.wsCode)||"w:yngazem",i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=Nhe({domainApi:o,wsCode:s,entityId:i}),a={};Object.entries(r).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var 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(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:i,responseType:r}){var u,c;const a=this.buildHeaders(s);let l;try{if(l=await this.axios.request({method:t,url:n,params:o,data:s,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";Vhe(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:o,payload:s,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),this.emit("call-api",{path:n,params:o,payload:s,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,i])=>{o=o.replace(`{${s}}`,String(i))}),o}async request(t,n,o={}){const{url:s,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:r,path:a,params:o.params,payload:o.payload,code:i,responseType:o.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,o={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property",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"},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:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",include_permission:1,per_page:i||20,page:o||1,name_like:s||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const i={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:0},payload:i})}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 this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const i={id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:i})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail(t,n){const o={item_ids:n};return this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition(t,n,o=!1){const s={item_ids:n,delete_all:o?1:void 0};return this.request("delete_rendition",{workspaceId:t},{payload:s})}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}){const i={item_ids:n,start_date:o,due_date:s};return this.request("bulkDateUpdate",{workspaceId:t},{payload:i})}async updateAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:s})}async removeAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("removeAssignee",{workspaceId:t},{payload:s})}async replaceAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("bulkAssignUpdate",{workspaceId:t},{params:{replace:1},payload:s})}async addAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:s})}async unAssignAll(t,n,o){const s={item_ids:o,ws_user_role_ids:[]};return this.request("removeAssignee",{workspaceId:t,entityId:n},{payload:s})}async createNewScene({workspaceId:t,entityId:n,name:o}){const s={entity_id:n,name:o};return this.request("createNewScene",{workspaceId:t},{payload:s})}async updateItemStatus({workspaceId:t,itemIds:n,statusId:o}){const s={item_ids:n,template_flow_status_id:o};return this.request("bulkStatusUpdate",{workspaceId:t},{payload:s})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems(t,n){const o={item_ids:n};return this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems(t,n){const o={item_ids:n,status:1};return this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems(t,n){const o={item_ids:n,status:0};return this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:i,clear:r}=t,a={item_ids:o,metric_id:s,metric_value:i,clear:r??(i==null?1:0)};return this.request("bulkMetricUpdate",{workspaceId:n},{payload:a})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:500}})}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){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob"})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob"})}async getStatuses(t,n,o){return this.request("getStatuses",{workspaceId:t,entityId:n},{params:o})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:i,include:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:i,include:r}})}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}})}}const Bhe=()=>{const e=Fn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},Hhe=e=>{var I,F,A;const{showMessage:t}=Ud(),n=vo(),o={domainApi:Bhe(),wsCode:Fn.getInstance().getItem("ws.code"),entityId:e.value.entityId},s=(A=(F=(I=n==null?void 0:n.appContext)==null?void 0:I.config)==null?void 0:F.globalProperties)==null?void 0:A.apiConfig;if(!s||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new bL(s,o);i.on("call-api",M=>{var V,X;M.success?t(M.apiCode,"success"):t(((X=(V=M.res)==null?void 0:V.data)==null?void 0:X.message)||M.apiCode,"error")});const r=vs({}),a=H([]),l=H(!1),u=H(null),c=H(null),d=H(1),h=H(20),{setCachedUsers:f}=R5(),p=M=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:M}),m=50,v=async(M,V,X)=>{if(!M.length)return[];const O=OU(M,V);return(await Promise.all(O.map(X))).flat()},C=async M=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:M})).data.map(X=>[X.id,X.permission])}catch(V){return console.error("Failed to fetch item permissions chunk:",V),[]}},b=async(M,V)=>{try{const X=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:M,per_page:M.length*V.length,metric_ids:V}),O=X.data.map(N=>{const z=new Map(N.item_metrics.map(de=>[de.metric_id,de.value])),q=Object.fromEntries(V.map(de=>[de,z.get(de)??null]));return[N.id,q]}),B=new Set(X.data.map(N=>N.id));for(const N of M)if(!B.has(N)){const z=Object.fromEntries(V.map(q=>[q,null]));O.push([N,z])}return O}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),[]}},_=async M=>{try{const V=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:M,per_page:M.length}),X=V.data.flatMap(O=>O.assignees);return f(X),V.data.map(O=>[O.id,O.assignees])}catch(V){return console.error("Failed to fetch a chunk of assigned users:",V),[]}},w=async M=>{if(!M.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const V=await v(M,m,C);return Object.fromEntries(V)}catch(V){return console.error("Failed to fetch item permissions:",V),{}}},R=async(M,V)=>{if(!M.length||!V.length)return{};try{const B=[];for(let z=0;z<V.length;z+=4){const q=V.slice(z,z+4),de=await Promise.all(q.map(async ve=>await v(M,m,se=>b(se,[ve]))));B.push(...de),z+4<V.length&&await new Promise(ve=>setTimeout(ve,2e3))}const N={};for(const z of B.flat()){const[q,de]=z;N[q]||(N[q]={}),Object.assign(N[q],de)}return N}catch(X){return console.error("Failed to fetch metric values:",X),{}}},E=async M=>{if(!M.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const V=await v(M,m,_);return Object.fromEntries(V)}catch(V){return console.error("Failed to fetch assigned users:",V),{}}};return{items:a,loading:l,error:u,pagination:c,currentPage:d,pageSize:h,cusorMap:r,fetchItems:async M=>{const{cursor:V,offset:X,size:O,searchQuery:B}=M;let N=[];l.value=!0,u.value=null;try{const z=await i.getAllItem_cursor({...M,cursor:V||void 0,offset:X||void 0,pageSize:O||h.value,...p(B),sortBy:M.sort_by});return a.value=z.data,c.value=z.meta,d.value=z.meta.current_page||0,N=z.data.map(q=>q.id),z}catch(z){throw u.value=z,console.error("Failed to fetch items (cursor):",z),z}finally{const z=async()=>{try{const[q,de]=await Promise.all([E(N),w(N)]);e.value.updateItemData({assignees:q,permission:de},N);const ve=await R(N,e.value.metricIds);e.value.updateItemData({metricValues:ve},N)}catch(q){console.error("Post-fetch processing failed:",q)}};l.value=!1,setTimeout(z)}},getAssignableStatus:async M=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:M})}catch(V){throw console.error("Failed to fetch assignable status:",V),V}},getMetricList:async M=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:M})}catch(V){throw console.error("Failed to fetch metric list:",V),V}},getMetricValues:R,getAssignedUsers:E}};function $he(e){return{updateRowData:(o,s)=>{if(!e.value)return;const i=[],r=new Map,a=new Set,u=e.value.getColumnDefs().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 h;const d=(h=e.value)==null?void 0:h.getRowNode(c);if(d){if(i.push(d),o.assignees){const f=d5((o.assignees[c]||[]).map(iT));d.data.assignees=f,a.add("assignees")}if(o.permission&&o.permission[c]!==void 0&&(d.data.permissions=o.permission[c]),u.forEach(f=>{d.data[f]=d.data[f]??null}),o.metricValues&&o.metricValues[c]){const f=o.metricValues[c];Object.keys(f).forEach(p=>{const m=`metric_${p}`;d.data[m]=f[p]||null,r.set(m,!0),a.add(m)})}}}),i.length>0&&e.value.refreshCells({rowNodes:i,columns:Array.from(a),force:!0})},setMetricValues:(o,s,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(s).map(u=>[u,new Map(i.map(c=>[c,null]))]));Object.entries(o).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==null||f.set(d,h)})});const l=Array.from(a.entries()).map(([u,c])=>{const d=r.getRowNode(u);return d!=null&&d.data?(c.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=h}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(u=>`metric_${u}`),force:!0})}}}function Ghe(e,t,n,o,s){let i=!0;return{async getRows(r){try{o(!0),i&&(s(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),o(!1),s(!1)}}}}function Whe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:i}=e,r=H(!0),a=H(!0),l=H(!1),u=()=>{n.value=!n.value},c=p=>{if(r.value=!1,s.value=p,!p)return null;const{addEventListener:m,setGridOption:v}=p;if(!i)return console.error("Fetcher function is undefined"),null;const C=Ghe(i,e.perPage,()=>o.value,b=>{r.value=b},b=>{a.value=b});return v==null||v("datasource",C),m==null||m("selectionChanged",()=>{t.value=p.getSelectedRows()}),p||null},d=p=>{var m,v;if((m=s.value)==null||m.hideOverlay(),p!==void 0&&(o.value=p),(v=s.value)==null||v.deselectAll(),t.value=[],r.value=!0,!s.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var p;(p=s.value)==null||p.deselectAll(),t.value=[]},f=_i(p=>{d(p)},pr);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l}}const Uhe={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."]}}},zhe=e=>{var t;return(t=Object.entries(Uhe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},jhe={key:1},Khe=wt(ut({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=H(null),s=e,i=()=>{o.value&&o.value.show()},r=H(""),a=H("idle"),l=H({file:null,format:null}),{apiServices:u}=eo(!1,{}),c=H(!1),d=async()=>{c.value=!0;const T=s.workspaceId,x=s.entityId;if(!T||!x||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,x))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}c.value=!1},h=n,f=()=>{h("import-success"),b()},p=async T=>{var I,F,A;const x=new FormData,k=((I=T.name.split(".").pop())==null?void 0:I.toString())||"";if(x.append("file",T),x.append("format",k),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,x),m()}catch(M){throw console.error("Error uploading file:",M),v(((A=(F=M.response)==null?void 0:F.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),M}},m=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var T;E(),(T=o.value)==null||T.hide()};t({close:b,open:i});const _=K(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=K(()=>l.value.file?!1:(console.error("No file selected"),!0)),R=H(null),E=()=>{var T;(T=R.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,x)=>(j(),Ue(Z(kP),{"popup-name":_.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},Gc({default:ye(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),Ue(lI,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),le("div",jhe,[pe("div",{class:Y(T.$style["step-section"])},[pe("span",{class:Y(T.$style["step-title"])},"Step 1: Download current data",2),pe("span",{class:Y(T.$style["step-description"])},[...x[1]||(x[1]=[at(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),pe("br",null,null,-1),pe("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ae(Z(pt),{class:Y(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:ye(()=>[ae(Z(ft),{src:"Download"})]),default:ye(()=>[x[2]||(x[2]=at(" Download file ",-1))]),_:1},8,["class","disabled"])],2),pe("div",{class:Y(T.$style["step-section"])},[pe("span",{class:Y(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ae(Z(rI),{modelValue:l.value,"onUpdate:modelValue":x[0]||(x[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:R},null,8,["modelValue"])],2),pe("div",{class:Y(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ae(uI)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"secondary",onClick:b},{default:ye(()=>[...x[3]||(x[3]=[at(" Cancel ",-1)])]),_:1}),ae(Z(pt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ye(()=>[...x[4]||(x[4]=[at(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ye(()=>[...x[5]||(x[5]=[at(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"primary",onClick:E},{default:ye(()=>[...x[6]||(x[6]=[at(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_13ctn_1","step-title":"_step-title_13ctn_11","step-title-2":"_step-title-2_13ctn_17","step-description":"_step-description_13ctn_23","date-format-guide":"_date-format-guide_13ctn_28","import-error":"_import-error_13ctn_39","drop-area":"_drop-area_13ctn_49","is-dragging":"_is-dragging_13ctn_49","drop-area-content":"_drop-area-content_13ctn_52",browse:"_browse_13ctn_61","download-sample-btn":"_download-sample-btn_13ctn_65"}}]]),qhe={style:{cursor:"help"}},Yhe=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
226
|
+
`+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=kl(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:i}=n;o!==void 0&&Lm.assertOptions(o,{silentJSONParsing:Ui.transitional(Ui.boolean),forcedJSONParsing:Ui.transitional(Ui.boolean),clarifyTimeoutError:Ui.transitional(Ui.boolean)},!1),s!=null&&(Re.isFunction(s)?n.paramsSerializer={serialize:s}:Lm.assertOptions(s,{encode:Ui.function,serialize:Ui.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Lm.assertOptions(n,{baseUrl:Ui.spelling("baseURL"),withXsrfToken:Ui.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Re.merge(i.common,i[n.method]);i&&Re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=qo.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let c,d=0,h;if(!l){const p=[gL.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(v){m.call(this,v);break}}try{c=gL.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=kl(this.defaults,t);const n=sL(t.baseURL,t.url,t.allowAbsoluteUrls);return YM(n,t.params,t.paramsSerializer)}};Re.forEach(["delete","get","head","options"],function(t){Ol.prototype[t]=function(n,o){return this.request(kl(o||{},{method:t,url:n,data:(o||{}).data}))}}),Re.forEach(["post","put","patch"],function(t){function n(o){return function(i,r,a){return this.request(kl(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}Ol.prototype[t]=n(),Ol.prototype[t+"Form"]=n(!0)});let The=class tN{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const o=this;this.promise.then(s=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](s);o._listeners=null}),this.promise.then=s=>{let i;const r=new Promise(a=>{o.subscribe(a),i=a}).then(s);return r.cancel=function(){o.unsubscribe(i)},r},t(function(i,r,a){o.reason||(o.reason=new wc(i,r,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 tN(function(s){t=s}),cancel:t}}};function Fhe(e){return function(n){return e.apply(null,n)}}function Phe(e){return Re.isObject(e)&&e.isAxiosError===!0}const o0={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(o0).forEach(([e,t])=>{o0[t]=e});function yL(e){const t=new Ol(e),n=OM(Ol.prototype.request,t);return Re.extend(n,Ol.prototype,t,{allOwnKeys:!0}),Re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return yL(kl(e,s))},n}const Hn=yL(Wh);Hn.Axios=Ol,Hn.CanceledError=wc,Hn.CancelToken=The,Hn.isCancel=eL,Hn.VERSION=mL,Hn.toFormData=Im,Hn.AxiosError=Ht,Hn.Cancel=Hn.CanceledError,Hn.all=function(t){return Promise.all(t)},Hn.spread=Fhe,Hn.isAxiosError=Phe,Hn.mergeConfig=kl,Hn.AxiosHeaders=qo,Hn.formToJSON=e=>JM(Re.isHTMLForm(e)?new FormData(e):e),Hn.getAdapter=pL.getAdapter,Hn.HttpStatusCode=o0,Hn.default=Hn;const{Axios:Qye,AxiosError:ewe,CanceledError:twe,isCancel:nwe,CancelToken:owe,VERSION:swe,all:iwe,Cancel:rwe,isAxiosError:Ihe,spread:awe,toFormData:lwe,AxiosHeaders:uwe,HttpStatusCode:cwe,formToJSON:dwe,getAdapter:hwe,mergeConfig:fwe}=Hn,Ahe=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const o=n.pop();return(o==null?void 0:o.split(";").shift())??null}return null},khe=6e4,wL=1e3/5;let CL=0;const Nm=[];let Vm=!1;const s0=()=>{if(Vm||Nm.length===0)return;Vm=!0;const t=Date.now()-CL;if(t>=wL){const n=Nm.shift();CL=Date.now(),n==null||n(),Vm=!1,Nm.length>0&&s0()}else{const n=wL-t;setTimeout(()=>{Vm=!1,s0()},n)}},Ohe=()=>new Promise(e=>{Nm.push(e),s0()}),Mhe=(()=>{const e=Hn.create({timeout:khe,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{await Ohe();const n=Ahe("account.token");return n&&t.headers&&(t.headers.Authorization=`Bearer ${n}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>t,async t=>{var o,s;const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const i=t.response.headers["retry-after"],r=i?parseInt(i)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(a=>setTimeout(a,r)),e(n)}return((s=t.response)==null?void 0:s.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class zh extends Error{constructor(t,n,o,s,i){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=i,Object.setPrototypeOf(this,zh.prototype)}}const jh=e=>{var t,n;if(Ihe(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,i=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",r=(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===Lu.UNAUTHORIZED||o===Lu.FORBIDDEN?l="AUTH":o===Lu.UNPROCESSABLE_ENTITY||o===Lu.BAD_REQUEST?l="VALIDATION":o>=Lu.BAD_REQUEST&&(l="CLIENT"),new zh(i,o,r,a,l)}return e instanceof Error?new zh(e.message,void 0,void 0,void 0,"UNKNOWN"):new zh("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class Lhe{constructor(){this.axios=Mhe}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,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(s,String(r))):typeof i=="object"?n.append(s,JSON.stringify(i)):n.append(s,String(i)))});const o=n.toString();return o?`?${o}`:""}async get(t="",n,o){try{const s=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${s}${i}`,o)).data}catch(s){throw jh(s)}}async post(t="",n,o,s){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,o,s)).data}catch(i){throw jh(i)}}async put(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.put(s,n,o)).data}catch(s){throw jh(s)}}async patch(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.patch(s,n,o)).data}catch(s){throw jh(s)}}async delete(t="",n,o){try{const s=this.buildUrl(t);return(await this.axios.delete(s,{data:n,...o})).data}catch(s){throw jh(s)}}}const Nhe=({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}/workspace/${t}/entities/${n}/items/export-format?format=xlsx`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/workspace/${t}/entities/${n}/items/import`,method:"post",code:"importItems"},exportItems:{url:`${e}/workspace/${t}/entities/${n}/items/export?format=xlsx`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/workspace/${t}/entities/${n}/items/update-from-file`,method:"post",code:"updateFromFile"},getStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"getStatuses"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/workspace/${t}/items/{itemId}`,method:"put",code:"item"},createNewScene:{url:`${e}/workspace/${t}/items`,method:"post",code:"createNewScene"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/workspace/${t}/ws-user-roles`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"}}),Vhe=(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 bL extends Lhe{constructor(t,n){const o=n==null?void 0:n.domainApi,s=(n==null?void 0:n.wsCode)||"w:yngazem",i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=Nhe({domainApi:o,wsCode:s,entityId:i}),a={};Object.entries(r).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var 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(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:i,responseType:r}){var u,c;const a=this.buildHeaders(s);let l;try{if(l=await this.axios.request({method:t,url:n,params:o,data:s,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";Vhe(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:o,payload:s,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),this.emit("call-api",{path:n,params:o,payload:s,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,i])=>{o=o.replace(`{${s}}`,String(i))}),o}async request(t,n,o={}){const{url:s,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:r,path:a,params:o.params,payload:o.payload,code:i,responseType:o.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,o={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property",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:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",include_permission:1,per_page:i||20,page:o||1,name_like:s||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const i={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:0},payload:i})}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 this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const i={id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:i})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail(t,n){const o={item_ids:n};return this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition(t,n,o=!1){const s={item_ids:n,delete_all:o?1:void 0};return this.request("delete_rendition",{workspaceId:t},{payload:s})}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}){const i={item_ids:n,start_date:o,due_date:s};return this.request("bulkDateUpdate",{workspaceId:t},{payload:i})}async updateAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:s})}async removeAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("removeAssignee",{workspaceId:t},{payload:s})}async replaceAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("bulkAssignUpdate",{workspaceId:t},{params:{replace:1},payload:s})}async addAssignee(t,n,o){const s={item_ids:n,ws_user_role_ids:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:s})}async unAssignAll(t,n,o){const s={item_ids:o,ws_user_role_ids:[]};return this.request("removeAssignee",{workspaceId:t,entityId:n},{payload:s})}async createNewScene({workspaceId:t,entityId:n,name:o}){const s={entity_id:n,name:o};return this.request("createNewScene",{workspaceId:t},{payload:s})}async updateItemStatus({workspaceId:t,itemIds:n,statusId:o}){const s={item_ids:n,template_flow_status_id:o};return this.request("bulkStatusUpdate",{workspaceId:t},{payload:s})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems(t,n){const o={item_ids:n};return this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems(t,n){const o={item_ids:n,status:1};return this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems(t,n){const o={item_ids:n,status:0};return this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:i,clear:r}=t,a={item_ids:o,metric_id:s,metric_value:i,clear:r??(i==null?1:0)};return this.request("bulkMetricUpdate",{workspaceId:n},{payload:a})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:500}})}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){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob"})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob"})}async getStatuses(t,n,o){return this.request("getStatuses",{workspaceId:t,entityId:n},{params:o})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:i,include:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:i,include:r}})}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}})}}const Bhe=()=>{const e=Fn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},Hhe=e=>{var I,F,A;const{showMessage:t}=Ud(),n=vo(),o={domainApi:Bhe(),wsCode:Fn.getInstance().getItem("ws.code"),entityId:e.value.entityId},s=(A=(F=(I=n==null?void 0:n.appContext)==null?void 0:I.config)==null?void 0:F.globalProperties)==null?void 0:A.apiConfig;if(!s||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new bL(s,o);i.on("call-api",M=>{var V,X;M.success?t(M.apiCode,"success"):t(((X=(V=M.res)==null?void 0:V.data)==null?void 0:X.message)||M.apiCode,"error")});const r=vs({}),a=H([]),l=H(!1),u=H(null),c=H(null),d=H(1),h=H(20),{setCachedUsers:f}=R5(),p=M=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:M}),m=50,v=async(M,V,X)=>{if(!M.length)return[];const O=OU(M,V);return(await Promise.all(O.map(X))).flat()},C=async M=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:M})).data.map(X=>[X.id,X.permission])}catch(V){return console.error("Failed to fetch item permissions chunk:",V),[]}},b=async(M,V)=>{try{const X=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:M,per_page:M.length*V.length,metric_ids:V}),O=X.data.map(N=>{const z=new Map(N.item_metrics.map(de=>[de.metric_id,de.value])),q=Object.fromEntries(V.map(de=>[de,z.get(de)??null]));return[N.id,q]}),B=new Set(X.data.map(N=>N.id));for(const N of M)if(!B.has(N)){const z=Object.fromEntries(V.map(q=>[q,null]));O.push([N,z])}return O}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),[]}},_=async M=>{try{const V=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:M,per_page:M.length}),X=V.data.flatMap(O=>O.assignees);return f(X),V.data.map(O=>[O.id,O.assignees])}catch(V){return console.error("Failed to fetch a chunk of assigned users:",V),[]}},w=async M=>{if(!M.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const V=await v(M,m,C);return Object.fromEntries(V)}catch(V){return console.error("Failed to fetch item permissions:",V),{}}},R=async(M,V)=>{if(!M.length||!V.length)return{};try{const B=[];for(let z=0;z<V.length;z+=4){const q=V.slice(z,z+4),de=await Promise.all(q.map(async ve=>await v(M,m,se=>b(se,[ve]))));B.push(...de),z+4<V.length&&await new Promise(ve=>setTimeout(ve,2e3))}const N={};for(const z of B.flat()){const[q,de]=z;N[q]||(N[q]={}),Object.assign(N[q],de)}return N}catch(X){return console.error("Failed to fetch metric values:",X),{}}},E=async M=>{if(!M.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const V=await v(M,m,_);return Object.fromEntries(V)}catch(V){return console.error("Failed to fetch assigned users:",V),{}}};return{items:a,loading:l,error:u,pagination:c,currentPage:d,pageSize:h,cusorMap:r,fetchItems:async M=>{const{cursor:V,offset:X,size:O,searchQuery:B}=M;let N=[];l.value=!0,u.value=null;try{const z=await i.getAllItem_cursor({...M,cursor:V||void 0,offset:X||void 0,pageSize:O||h.value,...p(B),sortBy:M.sort_by});return a.value=z.data,c.value=z.meta,d.value=z.meta.current_page||0,N=z.data.map(q=>q.id),z}catch(z){throw u.value=z,console.error("Failed to fetch items (cursor):",z),z}finally{const z=async()=>{try{const[q,de]=await Promise.all([E(N),w(N)]);e.value.updateItemData({assignees:q,permission:de},N);const ve=await R(N,e.value.metricIds);e.value.updateItemData({metricValues:ve},N)}catch(q){console.error("Post-fetch processing failed:",q)}};l.value=!1,setTimeout(z)}},getAssignableStatus:async M=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:M})}catch(V){throw console.error("Failed to fetch assignable status:",V),V}},getMetricList:async M=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:M})}catch(V){throw console.error("Failed to fetch metric list:",V),V}},getMetricValues:R,getAssignedUsers:E}};function $he(e){return{updateRowData:(o,s)=>{if(!e.value)return;const i=[],r=new Map,a=new Set,u=e.value.getColumnDefs().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 h;const d=(h=e.value)==null?void 0:h.getRowNode(c);if(d){if(i.push(d),o.assignees){const f=d5((o.assignees[c]||[]).map(iT));d.data.assignees=f,a.add("assignees")}if(o.permission&&o.permission[c]!==void 0&&(d.data.permissions=o.permission[c]),u.forEach(f=>{d.data[f]=d.data[f]??null}),o.metricValues&&o.metricValues[c]){const f=o.metricValues[c];Object.keys(f).forEach(p=>{const m=`metric_${p}`;d.data[m]=f[p]||null,r.set(m,!0),a.add(m)})}}}),i.length>0&&e.value.refreshCells({rowNodes:i,columns:Array.from(a),force:!0})},setMetricValues:(o,s,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(s).map(u=>[u,new Map(i.map(c=>[c,null]))]));Object.entries(o).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==null||f.set(d,h)})});const l=Array.from(a.entries()).map(([u,c])=>{const d=r.getRowNode(u);return d!=null&&d.data?(c.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=h}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(u=>`metric_${u}`),force:!0})}}}function Ghe(e,t,n,o,s){let i=!0;return{async getRows(r){try{o(!0),i&&(s(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),o(!1),s(!1)}}}}function Whe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:i}=e,r=H(!0),a=H(!0),l=H(!1),u=()=>{n.value=!n.value},c=p=>{if(r.value=!1,s.value=p,!p)return null;const{addEventListener:m,setGridOption:v}=p;if(!i)return console.error("Fetcher function is undefined"),null;const C=Ghe(i,e.perPage,()=>o.value,b=>{r.value=b},b=>{a.value=b});return v==null||v("datasource",C),m==null||m("selectionChanged",()=>{t.value=p.getSelectedRows()}),p||null},d=p=>{var m,v;if((m=s.value)==null||m.hideOverlay(),p!==void 0&&(o.value=p),(v=s.value)==null||v.deselectAll(),t.value=[],r.value=!0,!s.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var p;(p=s.value)==null||p.deselectAll(),t.value=[]},f=_i(p=>{d(p)},pr);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l}}const Uhe={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."]}}},zhe=e=>{var t;return(t=Object.entries(Uhe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},jhe={key:1},Khe=wt(ut({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=H(null),s=e,i=()=>{o.value&&o.value.show()},r=H(""),a=H("idle"),l=H({file:null,format:null}),{apiServices:u}=eo(!1,{}),c=H(!1),d=async()=>{c.value=!0;const T=s.workspaceId,x=s.entityId;if(!T||!x||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,x))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}c.value=!1},h=n,f=()=>{h("import-success"),b()},p=async T=>{var I,F,A;const x=new FormData,k=((I=T.name.split(".").pop())==null?void 0:I.toString())||"";if(x.append("file",T),x.append("format",k),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,x),m()}catch(M){throw console.error("Error uploading file:",M),v(((A=(F=M.response)==null?void 0:F.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),M}},m=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var T;E(),(T=o.value)==null||T.hide()};t({close:b,open:i});const _=K(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=K(()=>l.value.file?!1:(console.error("No file selected"),!0)),R=H(null),E=()=>{var T;(T=R.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,x)=>(j(),Ue(Z(kP),{"popup-name":_.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},Gc({default:ye(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),Ue(lI,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),le("div",jhe,[pe("div",{class:Y(T.$style["step-section"])},[pe("span",{class:Y(T.$style["step-title"])},"Step 1: Download current data",2),pe("span",{class:Y(T.$style["step-description"])},[...x[1]||(x[1]=[at(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),pe("br",null,null,-1),pe("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ae(Z(pt),{class:Y(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:ye(()=>[ae(Z(ft),{src:"Download"})]),default:ye(()=>[x[2]||(x[2]=at(" Download file ",-1))]),_:1},8,["class","disabled"])],2),pe("div",{class:Y(T.$style["step-section"])},[pe("span",{class:Y(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ae(Z(rI),{modelValue:l.value,"onUpdate:modelValue":x[0]||(x[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:R},null,8,["modelValue"])],2),pe("div",{class:Y(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ae(uI)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"secondary",onClick:b},{default:ye(()=>[...x[3]||(x[3]=[at(" Cancel ",-1)])]),_:1}),ae(Z(pt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ye(()=>[...x[4]||(x[4]=[at(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ye(()=>[...x[5]||(x[5]=[at(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ye(()=>[ae(Z(pt),{style:{flex:"1"},variant:"primary",onClick:E},{default:ye(()=>[...x[6]||(x[6]=[at(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_13ctn_1","step-title":"_step-title_13ctn_11","step-title-2":"_step-title-2_13ctn_17","step-description":"_step-description_13ctn_23","date-format-guide":"_date-format-guide_13ctn_28","import-error":"_import-error_13ctn_39","drop-area":"_drop-area_13ctn_49","is-dragging":"_is-dragging_13ctn_49","drop-area-content":"_drop-area-content_13ctn_52",browse:"_browse_13ctn_61","download-sample-btn":"_download-sample-btn_13ctn_65"}}]]),qhe={style:{cursor:"help"}},Yhe=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
227
227
|
<rect width="32" height="32" rx="4" fill="#CCF3EB"/>
|
|
228
228
|
<path d="M11 9C9.89688 9 9 9.89688 9 11V21C9 22.1031 9.89688 23 11 23H21C22.1031 23 23 22.1031 23 21V11C23 9.89688 22.1031 9 21 9H11ZM19.5312 14.5312L15.5312 18.5312C15.2375 18.825 14.7625 18.825 14.4719 18.5312L12.4719 16.5312C12.1781 16.2375 12.1781 15.7625 12.4719 15.4719C12.7656 15.1813 13.2406 15.1781 13.5312 15.4719L15 16.9406L18.4688 13.4688C18.7625 13.175 19.2375 13.175 19.5281 13.4688C19.8187 13.7625 19.8219 14.2375 19.5281 14.5281L19.5312 14.5312Z" fill="#00A18D"/>
|
|
229
229
|
</svg>
|
|
230
|
-
`,Zhe=wt(ut({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Jo,o=uC(),{setUserPermissions:s,setEntityPermissions:i}=o,{entityPermissions:r}=Is(o),{addNotification:a}=Ud(),l=en,u=H(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=K(()=>{var Ae;const Ie=((Ae=r.value)==null?void 0:Ae.has_create_item_permission)===1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ie},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ie,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ie,id:"overwrite_scenes_option"}]}),h=e;nh.initialize({wrapVueCellRenderer:bg,wrapVueCellEditor:hI});const f=H(null),p=H([]),m=mC(),{rowCount:v}=Is(m),C=H(!1),b=H(""),_=SP(),{metricList:w}=Is(_),R=H(""),E=H(!1),T=H(new Set),x=H(new Map),{apiServices:k}=eo(!1,h),{columnDefs:I,checkboxColumn:F,saveColumnConfig:A}=ade(w,h.entityId,f),M=H();nt(()=>I,()=>{var Ie;(Ie=M.value)==null||Ie.updateColumnDefs(I.value)},{deep:!0});const V=(Ie,Ae)=>{A(Ie,Ae)},{updateRowData:X,setMetricValues:O}=$he(f),B=K(()=>({isSearching:b.value.length>0,isFiltering:Object.keys(vt.value||{}).length>0})),N=K(Hp),z=K(()=>I.value.filter(Ie=>{var Ae;return((Ae=Ie.field)==null?void 0:Ae.startsWith("metric_"))&&!Ie.hide}).map(Ie=>{var Ae;return((Ae=Ie.field)==null?void 0:Ae.replace("metric_",""))||""}));Ba("timezone",N);const q=K(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:z.value,updateItemData:X})),{fetchItems:de,getMetricList:ve,cusorMap:se,getMetricValues:te}=Hhe(q),J=K(()=>{if(!f.value)return!1;const Ie=f.value.getSelectedRows().length;return Ie>0&&Ie>=v.value.total}),he=K(()=>{var Ie;return((Ie=u.value)==null?void 0:Ie.name)||"Items"}),be=(Ie,Ae)=>{var Rt,gn,kr;v.value.total=Ie.meta.total??0,(Rt=Ie.meta.next)!=null&&Rt.cursor&&(se[Ae+1]=Ie.meta.next.cursor),R.value=Ie.meta["X-Tsr-signature"]||"",Ie.meta.total===0?(gn=f.value)==null||gn.showNoRowsOverlay():(kr=f.value)==null||kr.hideOverlay()},$e=iI(),Se=H(null),{sortingAPIConfiguration:ct,isSortingRunning:Ct}=Is($e),vt=H({
|
|
231
|
-
`)});function xe(Ie){var Ae;Ie==="new_scene"?(Ae=$n.value)==null||Ae.show():Ie==="import_scenes"?Kt():Ie==="overwrite_scenes"&&Wt()}const ke=Ie=>{p.value=Ie.api.getSelectedRows().map(Ae=>Ae.id)},dt=Ie=>{const Ae=Te(Ie);return Ae&&(Ae.addEventListener("modelUpdated",ht),Ae.addEventListener("bodyScroll",()=>Ae.stopEditing()),Ae.addEventListener("selectionChanged",Oe),Ae.addEventListener("columnMoved",gn=>V(gn,!0)),Ae.addEventListener("columnResized",gn=>V(gn,!0)),Ae.addEventListener("firstDataRendered",()=>{Ne.value=!1}),!document.querySelector(".ag-body-viewport")),Ae},xt=(Ie,Ae)=>{if(!f.value)return;const Rt=f.value.getRowNode(Ie);Rt?(f.value.ensureIndexVisible(Number(Rt.rowIndex),"middle"),f.value.flashCells({rowNodes:[Rt],flashDuration:3e3,fadeDuration:1e3})):f.value.ensureIndexVisible(v.value.total-1,"bottom")},Lt=async Ie=>{var Rt;let Ae;if(!(!k.value||!Ie.trim())){fe.value=!0;try{Ae=await k.value.createNewScene({workspaceId:h.workspaceId,entityId:h.entityId,name:Ie}),v.value.total<50&&await hn()}catch(gn){console.error("Error creating new scene:",gn)}finally{fe.value=!1,Ae!=null&&Ae.id&&a({id:String(Ae==null?void 0:Ae.id),message:`${Ie} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{xt(String(Ae==null?void 0:Ae.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const gn=os({type:"scene_hub",config:{ws_code:h.workspaceId,baseDomain:Fn.getInstance().getItem("BASE_URL")||"",scene_id:String(Ae==null?void 0:Ae.id)}}).url;window.open(gn,"_blank")},btnIcon:"CustomSceneHub"}],icon:Yhe,type:"interactive"}),(Rt=$n.value)==null||Rt.hide()}}},ze=Ie=>Ie.metric_type.code==="number"?"number":"default",io=async()=>{if(h.entityId)try{const Ie=await ve(h.entityId);w.value=Ie.data.map(Ae=>({...Ae,sortType:ze(Ae)}))}catch(Ie){console.error("Failed to initialize metric list:",Ie),w.value=[]}},ci=async()=>{if(k.value)try{const Ie=await k.value.getUserPermission(h.workspaceId);s(Ie)}catch(Ie){console.error("Failed to fetch user permissions:",Ie)}},Ea=async()=>{if(k.value)try{const Ie=await k.value.getEntityDetail(h.workspaceId,h.entityId);i(Ie.permission),u.value=Ie}catch(Ie){console.error("Failed to fetch entity details:",Ie)}},fs=BC(),{setUser:Ar}=fs,Ra=async()=>{if(k.value)try{const Ie=await k.value.getMe();return Ar(Ie),Ie}catch(Ie){console.error("Failed to fetch user details:",Ie)}},zi=async()=>{var Ie;if(k.value)try{const Ae=await k.value.getWorkspaces(h.workspaceId),Rt=(Ie=Ae.data[0])==null?void 0:Ie.ws_user_role_id;return Rt&&fs.setUserRoleId(Rt),Ae}catch(Ae){console.error("Failed to fetch workspace details:",Ae)}};nt(()=>[h.entityId,h.workspaceId],async([Ie,Ae])=>{!Ie||!Ae||(Ra(),zi(),io(),ci(),Ea())},{immediate:!0,deep:!0}),nt(z,(Ie,Ae)=>{const Rt=Ie.filter(gn=>!(Ae!=null&&Ae.includes(gn)));Rt.length>0&&te(Array.from(T.value),Rt).then(gn=>{O(gn,T.value,Rt)})},{immediate:!0,deep:!0}),nt(R,(Ie,Ae)=>{E.value=!!(Ae&&Ie&&Ae!==Ie)}),t({refreshTable:hn});const ji=Ie=>{vt.value=Ie,hn()},Hs=Ie=>{G.value=Ie,hn()},Ki=Ie=>{I.value=Ie||[]};return(Ie,Ae)=>(j(),Ue(Z(l9),{"is-sidebar-open":C.value,onCloseSidebar:Z(Ee),onSidebarClear:Z(Ee),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:Z(Ee)},{"header-left":ye(()=>[pe("h1",{class:Y(Ie.$style.tableTitle)},"Scenes",2),pe("div",{class:Y(Ie.$style["beta-tag"])},"Beta",2),ae(Z(vC),{variant:["primary"],options:d.value,onSelect:xe,onHandleClick:Ae[1]||(Ae[1]=Rt=>xe("new_scene")),id:"create_scene_dropdown"},{prefix:ye(()=>[ae(Z(pt),{id:"create_new_scene",variant:["primary"],onClick:Ae[0]||(Ae[0]=Rt=>xe("new_scene")),label:"New"})]),_:1},8,["options"]),qe((j(),le("span",qhe,[at(yt(pn.value),1)])),[[Z(l),so.value||""]])]),"header-actions":ye(()=>[ae(Z(kK),{"onUpdate:assignees":Hs,onApplyFilter:ji,loading:Z(Ne)},null,8,["loading"]),qe(ae(Z(pC),{modelValue:b.value,"onUpdate:modelValue":Ae[2]||(Ae[2]=Rt=>b.value=Rt),onSearch:Z(Be),class:Y(Ie.$style.itemSearchBox),onClear:Ae[3]||(Ae[3]=Rt=>Z(Be)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),[[Z(n),{isLoading:Z(Ne),fullwidth:!0}]]),qe((j(),Ue(Z(mP),{status:Z(fe)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":E.value},{default:ye(()=>[ae(Z(pt),{variant:"secondary",disabled:Z(fe),onClick:hn},{prefix:ye(()=>[ae(Z(ft),{src:"ArrowsRotate"})]),default:ye(()=>[Ae[5]||(Ae[5]=at(" Refresh ",-1))]),_:1},8,["disabled"])]),_:1},8,["status","show-badge"])),[[Z(n),{isLoading:Z(Ne),fullwidth:!0}]]),qe(ae(Z(sK),{"model-value":Z(I),onChange:Ae[4]||(Ae[4]=Rt=>Ki(Rt)),id:"table_customization",gridApi:f.value,ref_key:"tableCustomizationRef",ref:M,"checkbox-column":Z(F)},null,8,["model-value","gridApi","checkbox-column"]),[[Z(n),{isLoading:Z(Ne),fullwidth:!0}]])]),grid:ye(({availableHeight:Rt})=>[ae(Z(nde),qt({id:"item_table_main",ref_key:"agGrid",ref:Se},Ge.value,{height:Rt+"px",isSorting:Z(Ct),onOnGridReady:dt,onSelectionChanged:ke}),null,16,["height","isSorting"])]),footer:ye(()=>[pe("div",{class:Y(Ie.$style.tableFooter),id:"table_footer"},[pe("span",null,[Ae[6]||(Ae[6]=at(" Showing ",-1)),pe("b",null,yt(Z(v).loaded)+" of "+yt(Z(v).total),1)])],2)]),"new-row":ye(()=>[ae(Z(dK),{onCreateNewItem:Lt,ref_key:"createNewSceneRef",ref:$n},null,512)]),"bulk-update-actions":ye(()=>[qe(ae(Z(e9),{selectRowData:Le.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":f.value,onUnselect:Z(Pe),"take-name":he.value,"selected-all":J.value,onUpdated:Oe},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"]),[[wi,!C.value&&p.value.length>0]])]),snackbar:ye(()=>[ae(Z(w9))]),popup:ye(()=>[ae(NK,{ref_key:"popupCreateSceneRef",ref:bt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:hn},null,8,["workspace-id","entity-id"]),ae(Khe,{ref_key:"popupOverwriteScenesRef",ref:Ot,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:hn},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1lefh_1",tableFooter:"_tableFooter_1lefh_7",footerStart:"_footerStart_1lefh_17",newRow:"_newRow_1lefh_25","warning-text":"_warning-text_1lefh_44","has-error":"_has-error_1lefh_49",itemSearchBox:"_itemSearchBox_1lefh_53","beta-tag":"_beta-tag_1lefh_57"}}]]),SL="0.0.
|
|
230
|
+
`,Zhe=wt(ut({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Jo,o=uC(),{setUserPermissions:s,setEntityPermissions:i}=o,{entityPermissions:r}=Is(o),{addNotification:a}=Ud(),l=en,u=H(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=K(()=>{var Ae;const Ie=((Ae=r.value)==null?void 0:Ae.has_create_item_permission)===1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ie},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ie,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ie,id:"overwrite_scenes_option"}]}),h=e;nh.initialize({wrapVueCellRenderer:bg,wrapVueCellEditor:hI});const f=H(null),p=H([]),m=mC(),{rowCount:v}=Is(m),C=H(!1),b=H(""),_=SP(),{metricList:w}=Is(_),R=H(""),E=H(!1),T=H(new Set),x=H(new Map),{apiServices:k}=eo(!1,h),{columnDefs:I,checkboxColumn:F,saveColumnConfig:A}=ade(w,h.entityId,f),M=H();nt(()=>I,()=>{var Ie;(Ie=M.value)==null||Ie.updateColumnDefs(I.value)},{deep:!0});const V=(Ie,Ae)=>{A(Ie,Ae)},{updateRowData:X,setMetricValues:O}=$he(f),B=K(()=>({isSearching:b.value.length>0,isFiltering:Object.keys(vt.value||{}).length>0})),N=K(Hp),z=K(()=>I.value.filter(Ie=>{var Ae;return((Ae=Ie.field)==null?void 0:Ae.startsWith("metric_"))&&!Ie.hide}).map(Ie=>{var Ae;return((Ae=Ie.field)==null?void 0:Ae.replace("metric_",""))||""}));Ba("timezone",N);const q=K(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:z.value,updateItemData:X})),{fetchItems:de,getMetricList:ve,cusorMap:se,getMetricValues:te}=Hhe(q),J=K(()=>{if(!f.value)return!1;const Ie=f.value.getSelectedRows().length;return Ie>0&&Ie>=v.value.total}),he=K(()=>{var Ie;return((Ie=u.value)==null?void 0:Ie.name)||"Items"}),be=(Ie,Ae)=>{var Rt,gn,kr;v.value.total=Ie.meta.total??0,(Rt=Ie.meta.next)!=null&&Rt.cursor&&(se[Ae+1]=Ie.meta.next.cursor),R.value=Ie.meta["X-Tsr-signature"]||"",Ie.meta.total===0?(gn=f.value)==null||gn.showNoRowsOverlay():(kr=f.value)==null||kr.hideOverlay()},$e=iI(),Se=H(null),{sortingAPIConfiguration:ct,isSortingRunning:Ct}=Is($e),vt=H({preflight_status:"1"}),G=H([]),W=async({page:Ie,pageSize:Ae,filterText:Rt})=>{var Nl;(Nl=f.value)==null||Nl.hideOverlay();const gn=se[Ie],kr=!gn&&Ie>1?(Ie-1)*Ae:void 0,Ll=ct.value;Ll.length>0&&(Ct.value=!0);try{const Kh={cursor:gn,size:Ae,searchQuery:Rt,offset:kr,sort_by:Ll,...vt.value},$s=await de(Kh);if(!$s)return{rows:[],total:0};const qi=(Cc=>{const Bm=Cc.data.map(ps=>aT(ps,N.value));return Bm.forEach(ps=>{T.value.add(String(ps.id)),x.value.set(String(ps.id),{})}),Bm})($s);return be($s,Ie),{rows:qi,total:v.value.total}}catch(Kh){return console.error("Failed to fetch items:",Kh),{rows:[],total:0}}finally{Ct.value=!1}},{isLoading:fe,toggleSidebar:Ee,onGridReady:Te,handleUnSelect:Pe,onSearch:Be,firstLoad:Ne}=Whe({selectRowData:H([]),isSidebarOpen:C,quickFilterText:b,gridApi:f,perPage:c.ROWS_PER_PAGE,fetcher:W}),Le=H([]),Oe=()=>{var Ie;Le.value=((Ie=f.value)==null?void 0:Ie.getSelectedRows())||[]},Ye=vs({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Ge=K(()=>({blockLoadDebounceMillis:1e3,columnDefs:I.value,rowModelType:"infinite",cacheBlockSize:c.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:c.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:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:ht,noRowsOverlayComponent:bg(uK),noRowsOverlayComponentParams:()=>B.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ie=>Ie.data.id,getRowClass:Ie=>{if(!Ie.data)return["row-empty"];const Ae=["row-highlight"];return Ie.data.id||Ae.push("row-inactive"),Ie.data.isDeleted&&Ae.push("row-deleted"),Ie.data.isArchived&&Ae.push("row-archived"),Ae},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:k.value,sorting:Ct.value},suppressKeyboardEvent:Ie=>{const Ae=Ie.event.key;return Ie.editing&&Ae==="Enter"?!1:Ae==="Enter"?(Ie.event.preventDefault(),Ie.event.stopPropagation(),!0):Ae==="ArrowUp"||Ae==="ArrowDown"||Ae==="ArrowLeft"||Ae==="ArrowRight"||Ae==="Tab"||Ae==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ie=>{const Ae=Ie.api.getFirstDisplayedRowIndex(),Rt=Ie.api.getLastDisplayedRowIndex();Ye.rowsDisplay.fromIndex=Ae,Ye.rowsDisplay.toIndex=Rt,Ye.columnsDisplay=Ie.api.getAllDisplayedVirtualColumns().map(gn=>gn.getColId())},onViewportChanged:Ie=>{Ye.columnsDisplay=Ie.api.getAllDisplayedVirtualColumns().map(Ae=>Ae.getColId())},suppressHeaderFocus:!0}));function ht(){if(!f.value)return;const Ie=f.value.getCacheBlockState();if(!Ie)return;const Ae=Object.values(Ie).reduce((Rt,gn)=>(gn==null?void 0:gn.pageStatus)==="loaded"?Rt+(gn.endRow-gn.startRow):Rt,0);v.value.loaded=Math.min(Ae,v.value.total)}nt(()=>ct,()=>{f.value&&(R.value="",T.value.clear(),f.value.deselectAll(),Object.keys(se).forEach(Ie=>delete se[Number(Ie)]),f.value.purgeInfiniteCache(),f.value.ensureIndexVisible(0),f.value.refreshCells({force:!0}))},{deep:!0});const bt=H(),Ot=H(),Wt=()=>{var Ie;(Ie=Ot.value)==null||Ie.open()},Kt=()=>{var Ie;(Ie=bt.value)==null||Ie.open()},hn=async()=>{Ne.value=!0,f.value&&(R.value="",T.value.clear(),Object.keys(se).forEach(Ie=>delete se[Number(Ie)]),await f.value.deselectAll(),await f.value.ensureIndexVisible(0,"top"),await f.value.purgeInfiniteCache(),await f.value.refreshInfiniteCache())},pn=K(()=>Fn.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),$n=H(),so=K(()=>{var Ie;return(Ie=zhe(pn.value))==null?void 0:Ie.map(Ae=>`<div>• ${Ae}</div>`).join(`
|
|
231
|
+
`)});function xe(Ie){var Ae;Ie==="new_scene"?(Ae=$n.value)==null||Ae.show():Ie==="import_scenes"?Kt():Ie==="overwrite_scenes"&&Wt()}const ke=Ie=>{p.value=Ie.api.getSelectedRows().map(Ae=>Ae.id)},dt=Ie=>{const Ae=Te(Ie);return Ae&&(Ae.addEventListener("modelUpdated",ht),Ae.addEventListener("bodyScroll",()=>Ae.stopEditing()),Ae.addEventListener("selectionChanged",Oe),Ae.addEventListener("columnMoved",gn=>V(gn,!0)),Ae.addEventListener("columnResized",gn=>V(gn,!0)),Ae.addEventListener("firstDataRendered",()=>{Ne.value=!1}),!document.querySelector(".ag-body-viewport")),Ae},xt=(Ie,Ae)=>{if(!f.value)return;const Rt=f.value.getRowNode(Ie);Rt?(f.value.ensureIndexVisible(Number(Rt.rowIndex),"middle"),f.value.flashCells({rowNodes:[Rt],flashDuration:3e3,fadeDuration:1e3})):f.value.ensureIndexVisible(v.value.total-1,"bottom")},Lt=async Ie=>{var Rt;let Ae;if(!(!k.value||!Ie.trim())){fe.value=!0;try{Ae=await k.value.createNewScene({workspaceId:h.workspaceId,entityId:h.entityId,name:Ie}),v.value.total<50&&await hn()}catch(gn){console.error("Error creating new scene:",gn)}finally{fe.value=!1,Ae!=null&&Ae.id&&a({id:String(Ae==null?void 0:Ae.id),message:`${Ie} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{xt(String(Ae==null?void 0:Ae.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const gn=os({type:"scene_hub",config:{ws_code:h.workspaceId,baseDomain:Fn.getInstance().getItem("BASE_URL")||"",scene_id:String(Ae==null?void 0:Ae.id)}}).url;window.open(gn,"_blank")},btnIcon:"CustomSceneHub"}],icon:Yhe,type:"interactive"}),(Rt=$n.value)==null||Rt.hide()}}},ze=Ie=>Ie.metric_type.code==="number"?"number":"default",io=async()=>{if(h.entityId)try{const Ie=await ve(h.entityId);w.value=Ie.data.map(Ae=>({...Ae,sortType:ze(Ae)}))}catch(Ie){console.error("Failed to initialize metric list:",Ie),w.value=[]}},ci=async()=>{if(k.value)try{const Ie=await k.value.getUserPermission(h.workspaceId);s(Ie)}catch(Ie){console.error("Failed to fetch user permissions:",Ie)}},Ea=async()=>{if(k.value)try{const Ie=await k.value.getEntityDetail(h.workspaceId,h.entityId);i(Ie.permission),u.value=Ie}catch(Ie){console.error("Failed to fetch entity details:",Ie)}},fs=BC(),{setUser:Ar}=fs,Ra=async()=>{if(k.value)try{const Ie=await k.value.getMe();return Ar(Ie),Ie}catch(Ie){console.error("Failed to fetch user details:",Ie)}},zi=async()=>{var Ie;if(k.value)try{const Ae=await k.value.getWorkspaces(h.workspaceId),Rt=(Ie=Ae.data[0])==null?void 0:Ie.ws_user_role_id;return Rt&&fs.setUserRoleId(Rt),Ae}catch(Ae){console.error("Failed to fetch workspace details:",Ae)}};nt(()=>[h.entityId,h.workspaceId],async([Ie,Ae])=>{!Ie||!Ae||(Ra(),zi(),io(),ci(),Ea())},{immediate:!0,deep:!0}),nt(z,(Ie,Ae)=>{const Rt=Ie.filter(gn=>!(Ae!=null&&Ae.includes(gn)));Rt.length>0&&te(Array.from(T.value),Rt).then(gn=>{O(gn,T.value,Rt)})},{immediate:!0,deep:!0}),nt(R,(Ie,Ae)=>{E.value=!!(Ae&&Ie&&Ae!==Ie)}),t({refreshTable:hn});const ji=Ie=>{vt.value=Ie,hn()},Hs=Ie=>{G.value=Ie,hn()},Ki=Ie=>{I.value=Ie||[]};return(Ie,Ae)=>(j(),Ue(Z(l9),{"is-sidebar-open":C.value,onCloseSidebar:Z(Ee),onSidebarClear:Z(Ee),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:Z(Ee)},{"header-left":ye(()=>[pe("h1",{class:Y(Ie.$style.tableTitle)},"Scenes",2),pe("div",{class:Y(Ie.$style["beta-tag"])},"Beta",2),ae(Z(vC),{variant:["primary"],options:d.value,onSelect:xe,onHandleClick:Ae[1]||(Ae[1]=Rt=>xe("new_scene")),id:"create_scene_dropdown"},{prefix:ye(()=>[ae(Z(pt),{id:"create_new_scene",variant:["primary"],onClick:Ae[0]||(Ae[0]=Rt=>xe("new_scene")),label:"New"})]),_:1},8,["options"]),qe((j(),le("span",qhe,[at(yt(pn.value),1)])),[[Z(l),so.value||""]])]),"header-actions":ye(()=>[ae(Z(kK),{"onUpdate:assignees":Hs,onApplyFilter:ji,loading:Z(Ne)},null,8,["loading"]),qe(ae(Z(pC),{modelValue:b.value,"onUpdate:modelValue":Ae[2]||(Ae[2]=Rt=>b.value=Rt),onSearch:Z(Be),class:Y(Ie.$style.itemSearchBox),onClear:Ae[3]||(Ae[3]=Rt=>Z(Be)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),[[Z(n),{isLoading:Z(Ne),fullwidth:!0}]]),qe((j(),Ue(Z(mP),{status:Z(fe)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":E.value},{default:ye(()=>[ae(Z(pt),{variant:"secondary",disabled:Z(fe),onClick:hn},{prefix:ye(()=>[ae(Z(ft),{src:"ArrowsRotate"})]),default:ye(()=>[Ae[5]||(Ae[5]=at(" Refresh ",-1))]),_:1},8,["disabled"])]),_:1},8,["status","show-badge"])),[[Z(n),{isLoading:Z(Ne),fullwidth:!0}]]),qe(ae(Z(sK),{"model-value":Z(I),onChange:Ae[4]||(Ae[4]=Rt=>Ki(Rt)),id:"table_customization",gridApi:f.value,ref_key:"tableCustomizationRef",ref:M,"checkbox-column":Z(F)},null,8,["model-value","gridApi","checkbox-column"]),[[Z(n),{isLoading:Z(Ne),fullwidth:!0}]])]),grid:ye(({availableHeight:Rt})=>[ae(Z(nde),qt({id:"item_table_main",ref_key:"agGrid",ref:Se},Ge.value,{height:Rt+"px",isSorting:Z(Ct),onOnGridReady:dt,onSelectionChanged:ke}),null,16,["height","isSorting"])]),footer:ye(()=>[pe("div",{class:Y(Ie.$style.tableFooter),id:"table_footer"},[pe("span",null,[Ae[6]||(Ae[6]=at(" Showing ",-1)),pe("b",null,yt(Z(v).loaded)+" of "+yt(Z(v).total),1)])],2)]),"new-row":ye(()=>[ae(Z(dK),{onCreateNewItem:Lt,ref_key:"createNewSceneRef",ref:$n},null,512)]),"bulk-update-actions":ye(()=>[qe(ae(Z(e9),{selectRowData:Le.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":f.value,onUnselect:Z(Pe),"take-name":he.value,"selected-all":J.value,onUpdated:Oe},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"]),[[wi,!C.value&&p.value.length>0]])]),snackbar:ye(()=>[ae(Z(w9))]),popup:ye(()=>[ae(NK,{ref_key:"popupCreateSceneRef",ref:bt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:hn},null,8,["workspace-id","entity-id"]),ae(Khe,{ref_key:"popupOverwriteScenesRef",ref:Ot,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:hn},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1lefh_1",tableFooter:"_tableFooter_1lefh_7",footerStart:"_footerStart_1lefh_17",newRow:"_newRow_1lefh_25","warning-text":"_warning-text_1lefh_44","has-error":"_has-error_1lefh_49",itemSearchBox:"_itemSearchBox_1lefh_53","beta-tag":"_beta-tag_1lefh_57"}}]]),SL="0.0.135",Xhe={key:0},Jhe=wt(ut({__name:"app",setup(e){const t=K(()=>n.id.length===0||n.workspaceId.length===0),n=vs({id:"",workspaceId:"",apiConfig:{}}),o=Ud(),{showMessage:s}=o,i=c=>{var d,h;c.success?s(c.apiCode,"success"):s(((h=(d=c.res)==null?void 0:d.data)==null?void 0:h.message)||c.apiCode,"error")},r=H(null),a=()=>{const c=Fn.getInstance().getItem("API_BASE_URL");return c!=null&&c.includes("v1")?c.slice(0,c.lastIndexOf("/v1")):String(c)};Pf(()=>{var c,d,h;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",SL);try{if(r.value=vo(),!r.value)throw new Error("Current instance is null");n.id=((c=r.value)==null?void 0:c.appContext.config.globalProperties.id)||"",n.workspaceId=((d=r.value)==null?void 0:d.appContext.config.globalProperties.workspaceId)||Fn.getInstance().getItem("ws.code");const f={domainApi:a(),wsCode:Fn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(h=r.value)==null?void 0:h.appContext.config.globalProperties.apiConfig,!f.entityId||!f.wsCode||!f.domainApi)throw new Error("API configuration is missing in dashboardConfig");const p=new bL(n.apiConfig,f);p.on("call-api",i),r.value.appContext.config.globalProperties.apiServices=p}catch(f){console.error("Error getting current instance:",f)}}),Zn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",i)});const l=K(()=>n.id),u=K(()=>n.workspaceId);return Ba("workspaceId",u),Ba("entityId",l),(c,d)=>(j(),le("div",{class:Y(c.$style.dashboardPluginWrapper)},[t.value?(j(),le("span",Xhe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):l.value?(j(),Ue(Z(Zhe),{key:1,entityId:l.value,workspaceId:u.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),i0=async(e={},t={})=>{const n=l_(Jhe),o=Yj();n.use(o);const s=["apiConfig","workspaceId","id"],i={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,i[r]=a,s.includes(r)&&typeof a=="string"?sessionStorage.setItem(r,a):console.error(`[Config Error] Key "${r}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(r=>{r&&typeof r.install=="function"&&n.use(r)}),n.config.errorHandler=(r,a,l)=>{console.error("[Vue Error]",r),l&&console.error("[Info]",l)},console.log(`%cArbo Dashboard Plugin v${SL}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),n.provide("switchInstance",n.config.globalProperties.$switchInstance),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=i0),wn.default=i0,wn.initDashboard=i0,Object.defineProperties(wn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|