@arbocollab/arbo-plugin-item-table 0.0.115 → 0.0.116

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.
@@ -28272,7 +28272,7 @@ const $K = {
28272
28272
  )) || [] : [];
28273
28273
  }, F = z(() => R(o.config)), A = z(() => {
28274
28274
  var V;
28275
- return ((V = F.value.find((G) => G.value === i.value)) == null ? void 0 : V.label) || i.value || "Select one";
28275
+ return ((V = F.value.find((G) => G.value === i.value)) == null ? void 0 : V.label) || i.value || "-";
28276
28276
  }), I = n, O = () => {
28277
28277
  r.value == "rating" ? I("updateMetric", s.value == 0 ? null : s.value) : I("updateMetric", i.value || null), k();
28278
28278
  }, { triggerRef: x, popupRef: T, hide: k, isVisible: L, show: Y } = ao({
@@ -28312,7 +28312,9 @@ const $K = {
28312
28312
  console.log("keypress event", G), Z(G);
28313
28313
  });
28314
28314
  }
28315
- ee();
28315
+ setTimeout(() => {
28316
+ ee();
28317
+ }, 300);
28316
28318
  });
28317
28319
  }), (V, G) => {
28318
28320
  const ve = kl("tooltip");
@@ -79211,7 +79213,7 @@ const kye = {
79211
79213
  "beta-tag": "_beta-tag_1lefh_57"
79212
79214
  }, Xye = {
79213
79215
  $style: Zye
79214
- }, Jye = /* @__PURE__ */ Ct(Uye, [["__cssModules", Xye]]), ZL = "0.0.115", Qye = { key: 0 }, ewe = /* @__PURE__ */ ut({
79216
+ }, Jye = /* @__PURE__ */ Ct(Uye, [["__cssModules", Xye]]), ZL = "0.0.116", Qye = { key: 0 }, ewe = /* @__PURE__ */ ut({
79215
79217
  __name: "app",
79216
79218
  setup(e) {
79217
79219
  const t = z(() => n.id.length === 0 || n.workspaceId.length === 0), n = ki({
@@ -84,7 +84,7 @@ Only state can be modified.`);r[0]="$state",Mu=!1,o.set(s,r,o.state.value),Mu=!0
84
84
  state: () => new MyClass()
85
85
  Found in store "${F.$id}".`),p&&s&&n.hydrate&&n.hydrate(F.$state,p),u=!0,c=!0,F}/*! #__NO_SIDE_EFFECTS__ */function al(e,t,n){let o;const i=typeof t=="function";o=i?n:t;function s(r,a){const l=Nv();if(r=(H.env.NODE_ENV==="test"&&il&&il._testing?null:r)||(l?Io(Xp,null):null),r&&Gd(r),H.env.NODE_ENV!=="production"&&!il)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
86
86
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
87
- This will fail in production.`);r=il,r._s.has(e)||(i?lC(e,t,o,r):fP(e,o,r),H.env.NODE_ENV!=="production"&&(s._pinia=r));const u=r._s.get(e);if(H.env.NODE_ENV!=="production"&&a){const c="__hot:"+e,d=i?lC(c,t,o,r,!0):fP(c,Pi({},o),r,!0);a._hotUpdate(d),delete r.state.value[c],r._s.delete(c)}if(H.env.NODE_ENV!=="production"&&fr){const c=so();if(c&&c.proxy&&!a){const d=c.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=u}}return u}return s.$id=e,s}function ri(e){const t=Ft(e),n={};for(const o in t){const i=t[o];i.effect?n[o]=z({get:()=>e[o],set(s){e[o]=s}}):(rn(i)||yi(i))&&(n[o]=Js(e,o))}return n}const uC=al("permissionStore",()=>{const e=$([]),t=$(),n=$({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:r=>{e.value=r},setEntityPermissions:r=>{t.value=r},setItemPermission:(r,a)=>{n.value[r]=a}}}),Zj="woohoo_getWoohooUserInterface_read",cC="media_getReviewUserInterface_read",Xj="update_getUpdateUserInterface_read",Jj=Mn.getInstance().getItem("BASE_URL"),Qj=Mn.getInstance().getItem("BASE_REVIEW_URL"),e7=(e,t,n)=>{const o=uC(),{userPermissions:i}=ri(o),s=z(()=>{const{ws_code:L,entity_id:Y,scene_id:ee}=e.value;return{baseDomain:Jj||"",ws_code:L||"",entity_id:Y||"",scene_id:ee||"",reviewDomain:Qj||"",take_id:Y||"",woohoo_id:Y||"",parent_id:Y||""}}),r=z(()=>{var Y;const L=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:i.value.includes(cC),canCopyLink:!0,canRename:(L==null?void 0:L.has_edit_permission)??!1,canOpenTakeInReview:i.value.includes(cC),canOpenTakeInUpdate:i.value.includes(Xj),canOpenTakeInWoohoo:i.value.includes(Zj),canDeleteRendition:((Y=L==null?void 0:L.media)==null?void 0:Y.has_delete_rendition_permission)??!1,canDeleteThumbnail:(L==null?void 0:L.has_edit_thumbnail_permission)??!1,canArchiveScene:L==null?void 0:L.has_archive_permission,canUnarchiveScene:L==null?void 0:L.has_archive_permission,canDeleteScene:(L==null?void 0:L.has_delete_permission)??!1}}),a=z(()=>({project:ni({type:"project",config:s.value}).url,take_review:ni({type:"review_take",config:s.value}).url,review:ni({type:"review_scene",config:s.value}).url,review_scene:ni({type:"review_scene",config:s.value}).url,woohoo:ni({type:"woohoo",config:s.value}).url,update:ni({type:"update",config:s.value}).url,scene_hub:ni({type:"scene_hub",config:s.value}).url})),l=(L,Y)=>{const ee=L instanceof MouseEvent&&(L.metaKey||L.ctrlKey),Z=a.value[Y]||"";Z&&(ee?window.open(Z,"_blank"):window.location.href=Z)},u=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.deleteRendition(s.value.ws_code,[s.value.scene_id],!0));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to delete rendition.");return}}catch(Z){console.error("Error deleting rendition",Z)}},c=async(L,Y)=>{var ee;try{await((ee=e.value.axiosService.value)==null?void 0:ee.deleteThumbnail(s.value.ws_code,[s.value.scene_id]))}catch(Z){console.error("Error deleting thumbnail",Z)}},d=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.archiveScene(s.value.ws_code,s.value.entity_id,[s.value.scene_id]));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to archive scene.");return}Y&&Y("archived")}catch(Z){console.error("Error archiving item",Z)}},h=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.deleteScene(s.value.ws_code,s.value.entity_id,s.value.scene_id));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to delete scene.");return}Y&&Y("deleted")}catch(Z){console.error("Error deleting item",Z)}},f=L=>{const Y=a.value.scene_hub||"";Y&&navigator.clipboard.writeText(Y)},p=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.unarchiveScene(s.value.ws_code,s.value.entity_id,[s.value.scene_id]));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to unarchive scene.");return}Y&&Y("unarchived")}catch(Z){console.error("Error unarchiving item",Z)}},m=L=>l(L,"scene_hub"),v=L=>l(L,"review_scene"),{tooltip:w,copyToClipboard:E}=kw(a.value.scene_hub||"",void 0,!0),_=L=>{E()},C=L=>n(L),b=L=>l(L,"review"),R=L=>l(L,"update"),F=L=>l(L,"woohoo"),A=L=>u(),I=L=>c(),O=L=>d(L,t),x=L=>p(L,t),T=L=>h(L,t),k=z(()=>{let L=[];return!s.value.scene_id&&e.value.optionBlock&&L.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length?e.value.optionBlock:[{id:"quick-actions",groupLabel:"Quick actions",type:"row",options:[{id:"scene-tile",label:"",icon:"CustomSceneHub",description:"Scene tile",action:m,hide:!r.value.canOpenSceneHub,type:"icon"},{id:"open-in-arbo-review",label:"",icon:"PenRuler",description:"Open in arbo Review",action:v,hide:!r.value.canOpenReview,type:"icon"},{id:"copy-link",label:"",icon:"Link",description:w.value,action:_,hide:!r.value.canCopyLink,type:"icon"}]},{id:"action",groupLabel:"Action",type:"column",options:[{id:"rename",label:"Rename",icon:"Pen",action:C,hide:!r.value.canRename,type:"icon"}]},{id:"download-options-take",type:"column",groupLabel:"Download Options",options:[{id:"open-take-in",label:"Open Take in",icon:"ArrowUpRightFromSquare",subMenu:{id:"sub-menu",type:"column",groupLabel:"Sub Menu",options:[{id:"review",label:"Review",icon:"PenRuler",action:b,hide:!r.value.canOpenTakeInReview,type:"icon"},{id:"update",label:"Update",icon:"UserCheck",action:R,hide:!r.value.canOpenTakeInUpdate,type:"icon"},{id:"woohoo-details",label:"Woohoo Details",icon:"ChartPie",action:F,hide:!r.value.canOpenTakeInWoohoo,type:"icon"}]}}]},{id:"download-options-delete",type:"column",groupLabel:"Download Options",options:[{id:"delete-rendition",label:"Delete rendition",icon:"Clapperboard",action:A,hide:!r.value.canDeleteRendition,type:"icon"},{id:"delete-thumbnail",label:"Delete thumbnail",icon:"Image",action:I,hide:!r.value.canDeleteThumbnail,type:"icon"}]},{id:"download-options-archive",type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:O,hide:r.value.canArchiveScene==0,disabled:r.value.canArchiveScene!==1,description:r.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:x,hide:r.value.canUnarchiveScene==0,disabled:r.value.canUnarchiveScene!==1,description:r.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:T,hide:!r.value.canDeleteScene,type:"icon"}]}]});return{linkMap:a,handleOpen:l,copyLink:f,deleteRendition:u,deleteThumbnail:c,archiveItem:d,deleteItem:h,unArchiveItem:p,options:k}};function Co(e){const t=$(!1),n=$(!1),o=z(()=>{var d;const u=e.value,c=!!u.readOnly;return{readOnly:c,disabled:!!u.disabled,hovered:n.value,focused:t.value,isEmpty:u.empty??!1,error:!!u.error,actived:!!((d=u.active)!=null&&d.value),clickable:c?!1:u.clickable??!1}}),i=()=>{t.value=!0,jt(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},s=()=>{t.value=!1},r=()=>{n.value=!0},a=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return an(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",i),u.addEventListener("blur",s)),c&&(c.addEventListener("mouseenter",r),c.addEventListener("mouseleave",a))}),Yn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",i),u.removeEventListener("blur",s)),c&&(c.removeEventListener("mouseenter",r),c.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:i}}const Wd=e=>{const t=$(!1),n=z(()=>t.value);return an(()=>{var a,l,u,c;const o=(a=e.params)==null?void 0:a.api,i=(l=e.params)==null?void 0:l.node,s=i==null?void 0:i.rowIndex,r=(c=(u=e.params)==null?void 0:u.colDef)==null?void 0:c.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===s&&d.colDef.field===r&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===s&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},pP=wt(ut({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:"active"},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=Xo,{triggerRef:n,popupRef:o}=lo({trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),i=z(()=>{switch(s.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"#02C39A"}}),s=e;return(r,a)=>(U(),ue("div",{class:j(r.$style["status-badge-wrapper"]),style:on({"--badge-size":`${s.size}px`,"--badge-color":i.value})},[Tt(r.$slots,"default"),Ke(he("div",{class:j(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[ir,s.showBadge],[K(t),{isLoading:s.loading,fullwidth:!0}]]),he("div",{ref_key:"popupRef",ref:o,class:j(r.$style["badge-tooltip"])},yt(s.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_13xqg_1","badge-indicator":"_badge-indicator_13xqg_6",active:"_active_13xqg_19",offline:"_offline_13xqg_22",busy:"_busy_13xqg_25",away:"_away_13xqg_28","badge-tooltip":"_badge-tooltip_13xqg_32"}}]]),gP=al("switchStore",()=>{const e=Io("switchInstance");return{openSceneHub:(o,i)=>{if(o){if(!e)throw console.error("Switch instance not found"),new Error("Switch instance not found");e("scene_hub",{id:o,commentId:i},{showLoading:!1})}},openPeopleInsight:o=>{if(!e)throw console.error("Switch instance not found"),new Error("Switch instance not found");e("people_insight",{tab:"home",id:o||""},{showLoading:!1})}}}),t7=ut({__name:"MiniPeopleCard",props:{user:{},status:{default:"active"},timezone:{default:Ad()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=cn,o=Xo,i=e,s=t,r={active:"Active in the last 10 minutes",offline:"Logged out of TESSR",busy:"User is busy",away:"No activity in the last 10 minutes"},a={active:"#02C39A",offline:"#808080",busy:"#FF0000",away:"#F7941D"},l=$(i.status),u=$(i.timezone),c=$(!0),d=$(null),h=z(()=>r[l.value]),f=z(()=>a[l.value]),p=z(()=>{var T;return(T=i.user)==null?void 0:T.name}),m=z(()=>u.value?s5(u.value,"HH:mm"):""),v=z(()=>u.value?`(${r5(u.value)})`:""),w=async()=>{var T,k,L;if(i.apiUpdateFunction)try{const Y=await i.apiUpdateFunction(i.user.id);if(!Y)throw new Error("No data returned from API");(T=Y.private_info)!=null&&T.is_offline?l.value="offline":(k=Y.private_info)!=null&&k.last_active?l.value="active":l.value="away",(L=Y.private_info)!=null&&L.timezone&&(u.value=Y.private_info.timezone),s("dataUpdated",Y)}catch(Y){console.error("Failed to fetch user data:",Y)}finally{c.value=!1}},E=()=>{!i.apiUpdateFunction||!i.enableAutoRefresh||(d.value!==null&&clearInterval(d.value),d.value=setInterval(w,i.refreshInterval))},_=()=>{d.value!==null&&(clearInterval(d.value),d.value=null)},C=z(()=>{const T=globalThis.location.origin,k=Mn.getInstance().getItem("ws.code");return ni({type:"people_insight",config:{ws_code:k,baseDomain:T,user_id:""}}).url}),{copyToClipboard:b,tooltip:R}=kw(C.value,()=>s("copyLink",i.user.id)),F=gP(),{openPeopleInsight:A}=F,I=T=>{if(T.ctrlKey||T.metaKey){window.open(C.value,"_blank");return}try{A(String(i.user.id))}catch{window.open(C.value,"_blank")}},O=T=>{I(T),s("insightClick",i.user.id)};nt([()=>i.enableAutoRefresh,()=>i.refreshInterval,()=>i.apiUpdateFunction],()=>{_(),i.enableAutoRefresh&&i.apiUpdateFunction&&E()}),an(async()=>{i.apiUpdateFunction&&(await w(),E())}),Yn(_);const x=z(()=>({name:i.user.name,initial:i.user.initial,id:i.user.id,profile_image:i.user.profile_image,color:i.user.color,size:98}));return(T,k)=>(U(),ue("div",{class:j([T.$style["mini-people-card"],{[T.$style.loading]:c.value},"bg-skeleton"])},[he("div",{class:j(T.$style["avatar-section"])},[i.private?(U(),$e(fu,Kt({key:1,readOnly:!0},x.value),null,16)):(U(),$e(pP,{key:0,size:16,status:l.value,loading:c.value,"status-tooltip":h.value},{default:me(()=>[ae(fu,Kt({readOnly:!0},x.value),null,16)]),_:1},8,["status","loading","status-tooltip"]))],2),he("div",{class:j(T.$style["user-info"])},[he("div",{class:j(T.$style["info-row"])},[he("h3",{class:j(T.$style["user-name"])},yt(p.value),3),i.private?qe("",!0):Ke((U(),ue("span",{key:0,class:j(T.$style["status-badge"]),style:on({color:f.value})},[st(yt(l.value),1)],6)),[[K(o),{isLoading:c.value,fullwidth:!0}]])],2),u.value?(U(),ue("div",{key:0,class:j([T.$style["info-row"],T.$style["time-row"]])},[Ke((U(),ue("div",{class:j(T.$style["time-display"])},[ae(ft,{source:"remote",src:"Clock",class:j(T.$style["clock-icon"])},null,8,["class"]),he("span",{class:j(T.$style["time-text"])},[he("strong",null,yt(m.value),1),he("span",{class:j(T.$style.separator)},"|",2),he("span",null,yt(v.value),1)],2)],2)),[[K(o),{isLoading:c.value,fullwidth:!0}]])],2)):qe("",!0),!e.readOnly&&!i.private?(U(),ue("div",{key:1,class:j([T.$style["info-row"],T.$style.actions])},[e.showInsightButton?(U(),$e(ht,{key:0,label:"Insights",variant:"primary",size:"default",style:{flex:"1"},onClick:Gt(O,["prevent","stop"]),disabled:i.disabled},null,8,["disabled"])):qe("",!0),e.showCopyLinkButton?Ke((U(),$e(ht,{key:1,variant:["icon","secondary"],size:"default","aria-label":"Copy link",onClick:Gt(K(b),["prevent","stop"]),disabled:i.disabled},{default:me(()=>[ae(ft,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[K(n),{content:K(R),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):qe("",!0)],2)):qe("",!0)],2)],2))}}),n7=wt(t7,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_xknlb_1",loading:"_loading_xknlb_22","avatar-section":"_avatar-section_xknlb_25","user-info":"_user-info_xknlb_30","info-row":"_info-row_xknlb_36","time-row":"_time-row_xknlb_43","time-display":"_time-display_xknlb_49","time-text":"_time-text_xknlb_54","actions-row":"_actions-row_xknlb_61","user-name":"_user-name_xknlb_65","status-badge":"_status-badge_xknlb_76",active:"_active_xknlb_90",offline:"_offline_xknlb_93",busy:"_busy_xknlb_96",away:"_away_xknlb_99","user-local-time":"_user-local-time_xknlb_102","clock-icon":"_clock-icon_xknlb_110",separator:"_separator_xknlb_122",timezone:"_timezone_xknlb_125","refresh-btn":"_refresh-btn_xknlb_128",spinning:"_spinning_xknlb_131",spin:"_spin_xknlb_131","insight-btn":"_insight-btn_xknlb_134","copy-link-btn":"_copy-link-btn_xknlb_138","last-update":"_last-update_xknlb_141","loading-overlay":"_loading-overlay_xknlb_147","loading-spinner":"_loading-spinner_xknlb_159"}}]]),o7=wt(ut({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=cn,n=e,{isEditing:o}=Wd(n);return(i,s)=>Ke((U(),$e(ht,{class:j(i.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:K(o)},{default:me(()=>[ae(ft,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[K(t),"More actions"]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_r5y5p_1"}}]]),i7=["src","width","height","alt"],og=wt(ut({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Xo,{getCachedValue:n,setCachedValue:o}=hd({dbName:"visual-cache-db",storeName:"visuals"}),i=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},s=e,r=z(()=>({minWidth:i(s.minWidth),maxWidth:i(s.maxWidth),minHeight:i(s.minHeight),maxHeight:i(s.maxHeight),aspectRatio:s.ratio,width:i(s.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},u=z(()=>({name:s.src,size:Number(s.size||100),color:""})),{url:c,loading:d}=_D(u,"visual",l,a);return(h,f)=>Ke((U(),ue("div",{class:j([h.$style.visualWrapper,{[h.$style.loading]:K(d)}]),style:on(r.value)},[he("img",{src:K(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:on(r.value)},null,12,i7)],6)),[[K(t),{isLoading:K(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_1sro0_1",loading:"_loading_1sro0_8",pulse:"_pulse_1sro0_1"}}]]),s7=["tabindex"],ea=wt(ut({name:"ListItem",directives:{tooltip:cn},__name:"ListItem",props:{label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean}},emits:["click","keydown","update:selected","select"],setup(e,{emit:t}){const n=e,o=t,i=$(!1),s=$(!1);function r(R){if(!R||typeof R!="object")return!1;const F=R;return typeof F.name=="string"&&typeof F.id=="string"&&typeof F.initial=="string"}const a=z(()=>n.type==="status"||n.type==="assignee"||n.type==="icon"||!!b.prefix),l=z(()=>!!b.suffix||n.danger&&i.value),u=z(()=>n.disabled||!n.clickable?-1:0),c=z(()=>{var R;return n.type==="status"&&typeof((R=n.data)==null?void 0:R.color)=="string"?{backgroundColor:n.data.color,border:pp(n.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=Zf(),h=z(()=>({[d.active]:n.selected??!1,[d.disabled]:n.disabled??!1,[d.hover]:n.hover??!1,[d.clickable]:(n.clickable??!0)&&!n.disabled,[d.danger]:n.danger??!1,[d["has-prefix"]]:a.value,[d["has-suffix"]]:l.value,[d.readOnly]:n.readOnly})),f=z(()=>({content:"Cancel",...C})),p=z(()=>({content:"Confirm",theme:"warning",...C}));function m(R){return{name:R.name,initial:R.initial,id:R.id,profile_image:R.profile_image??null,color:R.color,size:24}}function v(){i.value=!1}function w(R){R&&o("click",R),(n.clickable??!0)&&(o("update:selected",!n.selected),o("select",!n.selected))}function E(R){if(!n.disabled){if(n.danger&&!i.value){i.value=!0;return}n.danger||w(R)}}function _(R){if(o("keydown",R),!n.disabled)if(R.key==="Enter"||R.key===" "){R.preventDefault();const F=new MouseEvent("click",{bubbles:!0,cancelable:!0});E(F)}else R.key==="Escape"&&i.value&&(R.preventDefault(),v())}const C=Object.freeze({delay:[500,0],contentClass:["extra-padding"]}),b=Ov();return nt(()=>n.show,R=>{R===!1&&(i.value=!1)}),(R,F)=>{const A=Ma("tooltip");return U(),ue("div",{class:j([R.$style["list-item"],h.value]),tabindex:u.value,onClick:Gt(E,["stop","prevent"]),onKeydown:_,onMouseenter:F[0]||(F[0]=I=>s.value=!0),onMouseleave:F[1]||(F[1]=I=>s.value=!1)},[a.value?(U(),ue("div",{key:0,class:j(R.$style["list-item__prefix"])},[Tt(R.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(U(),$e(ft,{key:0,src:e.icon,source:"remote",class:j(R.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(U(),ue("div",{key:1,class:j(R.$style["status-indicator"]),style:on(c.value)},null,6)):e.type==="assignee"&&r(e.data)?(U(),$e(fu,Kt({key:2},m(e.data),{class:R.$style["item-avatar"],readOnly:!0}),null,16,["class"])):qe("",!0)])],2)):qe("",!0),he("div",{class:j(R.$style["list-item__label"])},[Tt(R.$slots,"label",{selected:e.selected},()=>[st(yt(e.label),1)])],2),l.value?(U(),ue("div",{key:1,class:j(R.$style["list-item__suffix"])},[Tt(R.$slots,"suffix",{item:R.$props,hovered:s.value},()=>[e.danger&&i.value?(U(),ue("div",{key:0,class:j(R.$style["confirm-action"])},[Ke((U(),$e(ht,{variant:["secondary","icon"],size:"small",onClick:Gt(v,["stop","prevent"])},{default:me(()=>[ae(ft,{src:"Xmark",source:"remote"})]),_:1})),[[A,f.value]]),Ke((U(),$e(ht,{variant:["danger","primary","icon"],size:"small",onClick:Gt(w,["stop","prevent"])},{default:me(()=>[ae(ft,{src:"Check",source:"remote"})]),_:1})),[[A,p.value]])],2)):qe("",!0)])],2)):qe("",!0)],42,s7)}}}),[["__cssModules",{$style:{"list-item":"_list-item_g74kb_1",disabled:"_disabled_g74kb_15",danger:"_danger_g74kb_18","has-prefix":"_has-prefix_g74kb_21","has-suffix":"_has-suffix_g74kb_21",clickable:"_clickable_g74kb_35",readOnly:"_readOnly_g74kb_38",hover:"_hover_g74kb_42",active:"_active_g74kb_48","list-item__prefix":"_list-item__prefix_g74kb_73","list-item__label":"_list-item__label_g74kb_81","list-item__suffix":"_list-item__suffix_g74kb_95","status-indicator":"_status-indicator_g74kb_102","item-icon":"_item-icon_g74kb_108","arbo-icon-state":"_arbo-icon-state_g74kb_113","item-avatar":"_item-avatar_g74kb_116","confirm-action":"_confirm-action_g74kb_125"}}]]),r7=["tabindex"],bo=wt(ut({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event"],setup(e,{expose:t,emit:n}){const o=e;Ov();const i=Zf(),s=$(null),r=$("default"),a=z(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),l=z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:o.disabled,[i.readOnly]:o.readOnly,[i.error]:o.error,[i.clickable]:o.clickable,[i.active]:o.actived,[i.hovered]:o.hovered,[i.focused]:!o.readOnly&&!o.disabled&&o.focused,[i.bordered]:o.bordered})),c=()=>{var w,E;const f=((w=s.value)==null?void 0:w.querySelectorAll(".wrapper-prefix").length)||0,p=((E=s.value)==null?void 0:E.querySelectorAll(".wrapper-suffix").length)||0,m="var(--icon-size)",v=(f+p)*8;return f&&!p?`repeat(${f}, ${m}) calc(100% - ${f} * ${m} - ${v}px )`:!f&&p?`calc(100% - ${p} * ${m} - ${v}px ) repeat(${p}, ${m})`:f&&p?`repeat(${f}, ${m}) calc(100% - ${f} * ${m} - ${p} * ${m} - ${v}px ) repeat(${p}, ${m})`:"100%"},d=$("100%");kf(()=>{d.value=c()}),an(()=>{d.value=c()});const h=f=>{r.value=f};return t({rootEl:s,updateState:h,componentState:r,focus:()=>{jt(()=>{var f;console.log("focusing"),(f=s.value)==null||f.focus()})}}),(f,p)=>(U(),ue("div",{ref_key:"rootEl",ref:s,class:j([K(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:on({"--grid-template":d.value,"--wrapper-size":a.value,"--loading-overlay-width":l.value})},[Tt(f.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Tt(f.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:h,disabled:o.disabled}),Tt(f.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,r7))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_1u1w6_1",bordered:"_bordered_1u1w6_22",disabled:"_disabled_1u1w6_22",readOnly:"_readOnly_1u1w6_22",active:"_active_1u1w6_22",error:"_error_1u1w6_25",hovered:"_hovered_1u1w6_25",clickable:"_clickable_1u1w6_34",suffix:"_suffix_1u1w6_40",prefix:"_prefix_1u1w6_41"}}]]),a7=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const l7=Object.prototype.toString,u7=e=>l7.call(e)==="[object Object]",Nu=()=>{};function c7(e,t){function n(...o){return new Promise((i,s)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(s)})}return n}function d7(e,t={}){let n,o,i=Nu;const s=l=>{clearTimeout(l),i(),i=Nu};let r;return l=>{const u=Xs(e),c=Xs(t.maxWait);return n&&s(n),u<=0||c!==void 0&&c<=0?(o&&(s(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{i=t.rejectOnCancel?h:d,r=l,c&&!o&&(o=setTimeout(()=>{n&&s(n),o=void 0,d(r())},c)),n=setTimeout(()=>{o&&s(o),o=void 0,d(l())},u)})}}function dC(e){return Array.isArray(e)?e:[e]}function h7(e,t=200,n={}){return c7(d7(t,n),e)}function f7(e,t,n){return nt(e,t,{...n,immediate:!0})}const mP=a7?window:void 0;function Ud(e){var t;const n=Xs(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function hC(...e){const t=(o,i,s,r)=>(o.addEventListener(i,s,r),()=>o.removeEventListener(i,s,r)),n=z(()=>{const o=dC(Xs(e[0])).filter(i=>i!=null);return o.every(i=>typeof i!="string")?o:void 0});return f7(()=>{var o,i;return[(o=(i=n.value)===null||i===void 0?void 0:i.map(s=>Ud(s)))!==null&&o!==void 0?o:[mP].filter(s=>s!=null),dC(Xs(n.value?e[1]:e[0])),dC(K(n.value?e[2]:e[1])),Xs(n.value?e[3]:e[2])]},([o,i,s,r],a,l)=>{if(!(o!=null&&o.length)||!(i!=null&&i.length)||!(s!=null&&s.length))return;const u=u7(r)?{...r}:r,c=o.flatMap(d=>i.flatMap(h=>s.map(f=>t(d,h,f,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function vP(e,t,n={}){const{window:o=mP,ignore:i=[],capture:s=!0,detectIframe:r=!1,controls:a=!1}=n;if(!o)return a?{stop:Nu,cancel:Nu,trigger:Nu}:Nu;let l=!0;const u=v=>Xs(i).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(E=>E===v.target||v.composedPath().includes(E));{const E=Ud(w);return E&&(v.target===E||v.composedPath().includes(E))}});function c(v){const w=Xs(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const E=Xs(v),_=E.$.subTree&&E.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(C=>C.el===w.target||w.composedPath().includes(C.el))}const h=v=>{const w=Ud(e);if(v.target!=null&&!(!(w instanceof Element)&&c(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!u(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[hC(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:s}),hC(o,"pointerdown",v=>{const w=Ud(e);l=!u(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),r&&hC(o,"blur",v=>{setTimeout(()=>{var w;const E=Ud(e);((w=o.document.activeElement)===null||w===void 0?void 0:w.tagName)==="IFRAME"&&!(E!=null&&E.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),m=()=>p.forEach(v=>v());return a?{stop:m,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:m}const p7=["type","value","placeholder","disabled","readonly","inputmode"],fC=wt(ut({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{}},emits:["update:modelValue","input","clear","enterValue","enter","blur","cancel"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=n,r=$(null),a=$(i.modelValue||""),l=$(!1);nt(()=>i.modelValue,I=>{a.value=I||""});const u=z(()=>{var I;return((I=a.value)==null?void 0:I.length)>0}),c={text:I=>I.slice(0,i.maxLength||255),number:I=>{let O=I.replace(/[^\d.-]/g,"");const x=O.split(".");x.length>2&&(O=x[0]+"."+x.slice(1).join("")),O=O.replace(/-/g,(k,L)=>L===0?k:"");const T=O.replace(/[.-]/g,"");if(T.length>17){const k=O.includes("."),Y=O.startsWith("-")?"-":"";if(k){const[ee,Z]=O.replace("-","").split(".");if(ee.length+Z.length>17){const V=17-ee.length;O=Y+ee+"."+Z.substring(0,Math.max(0,V))}}else O=Y+T.substring(0,17)}return O},email:I=>I.replace(/\s/g,"").slice(0,i.maxLength||255),url:I=>I.replace(/\s/g,"").slice(0,i.maxLength||255),tel:I=>I.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},d=I=>{const O=c[i.type];return O?O(I):I},h=h7(I=>{i.autoEmit&&(s("update:modelValue",I),s("input",I))},i.debounceDelay),f=I=>{if(i.disabled||i.readOnly){I.preventDefault();return}const O=I.target,x=O.selectionStart||0,T=a.value,k=d(O.value);T!==k&&(a.value=k,i.autoEmit&&h(k),O.value!==k&&(O.value=k,jt(()=>{let L=x;if(k.length<O.value.length)L=x;else{const Y=k.length-T.length;L=x+Y}L=Math.max(0,Math.min(L,k.length)),O.setSelectionRange(L,L)})))},p=I=>{if(i.disabled||i.readOnly){I.preventDefault();return}l.value=!0,a.value="",s("update:modelValue",""),s("clear"),I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),jt(()=>{var O;(O=r.value)==null||O.focus(),setTimeout(()=>{l.value=!1},100)})},m=I=>{if(l.value)return;const O=I.target;s("update:modelValue",O.value),s("blur",O.value)},v=I=>{const x=I.target.value;I.preventDefault(),s("update:modelValue",x),s("enter",x),s("enterValue",x)},w=I=>{var O;if(I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),i.autoEmit){(O=r.value)==null||O.blur(),s("cancel");return}a.value=i.modelValue||"",r.value&&(r.value.value=a.value),s("cancel")},E=I=>{I.key==="Escape"?w(I):I.key==="Enter"?v(I):(I.key==="ArrowUp"||I.key==="ArrowDown")&&I.preventDefault()},_=`input-text-${Math.random().toString(36).substr(2,9)}`,C=$(!1),b=z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});nt(()=>a.value,I=>{i.validatorFnc?C.value=!!I&&!i.validatorFnc(I):C.value=!1});const R=$(null),F=z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:C.value,inputRef:r,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:R})),{argsMain:A}=Co(F);return t({focus:()=>{jt(()=>{var I;(I=r.value)==null||I.focus()})}}),(I,O)=>(U(),ue("div",{class:j([I.$style["input-wrapper"],"input-editor"])},[ae(bo,Kt(K(A),{ref_key:"wrapperRef",ref:R,class:I.$style["input-box"],style:{"--icon-size":"24px"}}),{suffix:me(()=>[u.value&&!i.disabled&&!i.readOnly?Tt(I.$slots,"clear",{key:0},()=>[Ke((U(),$e(ht,{variant:["icon"],"aria-label":"Clear search",onMousedown:Gt(p,["prevent","stop"]),size:18,rounded:!0},{default:me(()=>[ae(ft,{class:j([I.$style["cs-icon"]]),src:"XMarkSolid",size:"10",color:"white"},null,8,["class"])]),_:1})),[[K(o),{content:"Clear",contentClass:"extra-padding"}]])]):Tt(I.$slots,"suffix",{key:1})]),default:me(()=>[he("input",{ref_key:"inputRef",ref:r,type:i.type||"text",value:a.value,placeholder:e.placeholder,class:j([I.$style["column-config__input"]]),id:_,disabled:e.disabled,readonly:e.readOnly,inputmode:b.value,onInput:f,onBlur:m,onKeydown:E},null,42,p7)]),_:3},16,["class"]),C.value?Tt(I.$slots,"error",{key:0}):qe("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wl9g3_1","has-suffix":"_has-suffix_wl9g3_11","has-value":"_has-value_wl9g3_11","is-disabled":"_is-disabled_wl9g3_17","is-readonly":"_is-readonly_wl9g3_24","column-config__input":"_column-config__input_wl9g3_31"}}]]),pC=wt(ut({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search..."},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=$(null),r=z(()=>{var c;return o.modelValue&&((c=o.modelValue)==null?void 0:c.length)>0}),a=Es(c=>{i("update:modelValue",c),i("search",c)},hr),l=()=>{i("update:modelValue",""),i("clear"),jt(()=>{var c;(c=s.value)==null||c.focus()})},u=$(o.modelValue);return t({focus:()=>{var c;(c=s.value)==null||c.focus()}}),(c,d)=>(U(),$e(fC,{ref_key:"searchInput",ref:s,modelValue:u.value,"onUpdate:modelValue":d[0]||(d[0]=h=>u.value=h),type:"text",placeholder:e.placeholder,onInput:K(a),onClear:l,onCancel:d[1]||(d[1]=h=>i("cancel")),"auto-emit":!0},{suffix:me(()=>[r.value?qe("",!0):(U(),$e(ft,{key:0,src:"MagnifyingGlass",class:j(c.$style.icon),color:"#a6a6a6"},null,8,["class"]))]),_:1},8,["modelValue","placeholder","onInput"]))}}),[["__cssModules",{$style:{"search-box":"_search-box_18t5g_1",icon:"_icon_18t5g_18"}}]]),g7=["aria-activedescendant"],m7=["innerHTML"],v7=10,ll=wt(ut({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"282px"},width:{default:"200px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel"],setup(e,{expose:t,emit:n}){const o=cn,i={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},s=e,r=n,a=$(""),l=$(-1),u=$(null),c=$(null),d=$(new Map),h=z(()=>Fw(a.value)),f=()=>{const G=h.value;if(!G||G.length<s.minQueryLength)return s.options;if(d.value.has(G))return d.value.get(G);const ve=s.options.map(pe=>({item:pe,score:d5(` ${pe.label} `,G)})).filter(({score:pe})=>pe>0).sort((pe,re)=>re.score-pe.score).map(({item:pe})=>pe);return d.value.set(G,ve),ve},p=$([]);nt(()=>s.options,()=>{p.value=f()},{immediate:!0,deep:!0});const m=z(()=>s.hasMore&&!s.loading&&!s.loadingMore),v=Es(G=>{a.value=G,l.value=-1,r("search",G)},hr),w=async G=>{V.value=0,await v(G||""),V.value=1},E=G=>a.value?h5(G,a.value):G,_=G=>{console.log("Key down event:",G.key);const pe={[i.ARROW_DOWN]:()=>C(G),[i.ARROW_UP]:()=>b(G),[i.ENTER]:()=>A(G),[i.ESCAPE]:()=>I(G),[i.TAB]:()=>O(G)}[G.key];console.log("Handler found:",!!pe),pe&&pe()},C=G=>{G.preventDefault(),R(1)},b=G=>{G.preventDefault(),R(-1)},R=G=>{const ve=p.value.length;if(ve===0)return;let pe;G>0?pe=(l.value+1)%ve:l.value>0?pe=l.value-1:pe=ve-1,l.value=pe,F()},F=()=>{jt(()=>{var ve;const G=(ve=c.value)==null?void 0:ve.querySelectorAll('[role="menuitem"]')[l.value];G==null||G.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},A=G=>{if(G.preventDefault(),l.value>=0&&l.value<p.value.length){const pe=p.value[l.value];x(pe)}},I=G=>{G.preventDefault(),k()},O=G=>{l.value>=0&&(G.preventDefault(),A(G))},x=G=>{!G||G.disabled||(r("select",G),l.value=-1,k())},T=G=>{G>=0&&G<p.value.length&&(l.value=G)},k=()=>{r("close")},L=()=>{if(!m.value||!c.value)return;const{scrollTop:G,clientHeight:ve,scrollHeight:pe}=c.value;pe-(G+ve)<=v7&&r("loadMore")},Y=()=>{var G,ve,pe;(G=c.value)==null||G.addEventListener("scroll",L),(pe=(ve=B.value)==null?void 0:ve.$el)==null||pe.addEventListener("keydown",_)},ee=()=>{var G,ve,pe;(G=c.value)==null||G.removeEventListener("scroll",L),(pe=(ve=B.value)==null?void 0:ve.$el)==null||pe.removeEventListener("keydown",_)};an(()=>{Y()}),Yn(()=>{ee()}),nt(()=>s.loading,G=>{!G&&p.value.length>0&&(l.value=-1)});const Z=G=>G?Array.isArray(s.selectedId)?s.selectedId.includes(String(G.id)):s.selectedId==G.id:!1,B=$(null);nt(l,()=>{F()}),t({focus:()=>{jt(()=>{var G;(G=B.value)==null||G.focus()})},reset:()=>{var G;(G=B.value)==null||G.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:k,clearSearch:()=>{a.value=""}});const V=$(0);return nt(()=>s.loading,G=>{const ve=s.options.length>0&&p.value.length>0,pe=!ve&&a.value.length>0,re=!ve&&a.value.length===0;G?V.value=0:ve?V.value=1:pe?V.value=2:re&&(V.value=3)},{immediate:!0}),(G,ve)=>(U(),ue("datalist",{ref_key:"searchListRef",ref:u,class:j([G.$style["search-list"],V.value===3||V.value===2?G.$style.empty:"",p.value.length>8?G.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:on({width:e.width})},[ae(pC,{ref_key:"searchBoxRef",ref:B,modelValue:a.value,"onUpdate:modelValue":ve[0]||(ve[0]=pe=>a.value=pe),class:j(G.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:ve[1]||(ve[1]=pe=>w("")),onCancel:ve[2]||(ve[2]=pe=>r("cancel"))},null,8,["modelValue","class","disabled"]),he("div",{ref_key:"popupRef",ref:c,class:j(G.$style["list-container"]),style:on({maxHeight:e.maxHeight})},[Tt(G.$slots,"extra-item",{query:a.value}),(U(!0),ue(Pt,null,Tn(p.value,(pe,re)=>Ke((U(),ue("div",{key:`${pe.id}-${re}`,role:"menuitem"},[Tt(G.$slots,"item",{item:pe,index:re,selectedIndex:l.value,isSelected:Z,handleSelect:x,handleItemHover:T,getHighlightedLabel:E,query:a.value,idx:re},()=>[pe.hide?qe("",!0):(U(),$e(ea,Kt({key:0,ref_for:!0},pe,{hover:re===l.value,selected:Z(pe),type:pe.type,id:`item-${re}`,"aria-selected":re===l.value,onClick:Gt(oe=>x(pe),["stop","prevent"]),onMouseover:oe=>T(re)}),{prefix:me(()=>[Tt(G.$slots,"prefix-item",{item:pe})]),label:me(()=>[a.value?Ke((U(),ue("span",{key:0,class:j(G.$style.match),innerHTML:E(pe.label)},null,10,m7)),[[K(o),{content:pe.label}]]):Ke((U(),ue("span",{key:1,class:j(G.$style["item-label"])},[st(yt(pe.label),1)],2)),[[K(o),{content:pe.label}]])]),suffix:me(({hovered:oe})=>[Tt(G.$slots,"action",{item:pe,isHovered:re===l.value,hovered:oe,selected:l.value==re})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[ir,V.value===1]])),128)),V.value===0?Tt(G.$slots,"loading-more",{key:0},()=>[(U(),ue(Pt,null,Tn(8,pe=>he("div",{class:j(G.$style["loading-more"]),key:pe},[he("div",{class:j(G.$style["loading-skeleton"])},null,2),he("div",{class:j(G.$style["loading-skeleton"])},null,2)],2)),64))]):qe("",!0),V.value===2?(U(),ue("div",{key:1,class:j(G.$style["no-results"])},[Tt(G.$slots,"empty",{query:a.value},()=>[he("div",{class:j(G.$style["no-results-content"])},[...ve[3]||(ve[3]=[he("div",null,[st(" No results. "),he("br"),st(" Try another search. ")],-1)])],2)])],2)):qe("",!0),V.value===3?(U(),ue("div",{key:2,class:j(G.$style["no-results"])},[Tt(G.$slots,"empty-list",{},()=>[he("div",{class:j(G.$style["no-results-content"])},[...ve[4]||(ve[4]=[he("div",null,"No items available.",-1)])],2)])],2)):qe("",!0),Tt(G.$slots,"footer")],6)],14,g7))}}),[["__cssModules",{$style:{"search-list":"_search-list_187go_1",empty:"_empty_187go_9",scrollable:"_scrollable_187go_15","list-container":"_list-container_187go_19","item-label":"_item-label_187go_38","loading-state":"_loading-state_187go_46","loading-more":"_loading-more_187go_47","loading-skeleton":"_loading-skeleton_187go_58","is-loading":"_is-loading_187go_65","skeleton-loading":"_skeleton-loading_187go_1","no-results":"_no-results_187go_120","no-results-content":"_no-results-content_187go_127",title:"_title_187go_130",tips:"_tips_187go_136",match:"_match_187go_150"}}]]),y7=["innerHTML"],w7=20,yP=wt(ut({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","start-update"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=Ry,r=B=>{const V=B.data;return{name:String((V==null?void 0:V.name)??"Unknown"),initial:String((V==null?void 0:V.initial)??"U"),id:String(B.id),profile_image:(V==null?void 0:V.profile_image)??null,color:(V==null?void 0:V.color)??{bgColor:"#CCCCCC",textColor:"var(--background-color)"},size:24,isUseShortLabel:!0}},{id:a}=yv(i),l=n,u=B=>{var G,ve;const V=(ve=(G=i.params)==null?void 0:G.api)==null?void 0:ve.getRowNode(String(a.value));V==null||V.setDataValue("assignees",o3(B.assignees)),l("updated",B)},c=$(!1),d=$(!1),h=$(null),f=$(1),p=$(!0),m=$(0),v=$(""),{isSubmitting:w,unAssignAll:E,replaceAssignees:_,handleSelect:C,assigneeList:b,mergedOptions:R,selectedUserIds:F}=dF({...i,updateRowData:u,value:i.value}),A=Io("bulkUpdate",!1),{apiServices:I}=ao(!A,i),O=Io("workspaceId"),x=async(B=1,V="",G=!1)=>{var ve,pe,re,oe,J;if(!I.value||!i.id&&!i.ids)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(G?d.value=!0:c.value=!0,h.value=null,!((ve=I.value)!=null&&ve.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const fe=await((pe=I.value)==null?void 0:pe.multipleAssignableUser({workspaceId:String(O),itemIds:(i.ids??(i.id?[i.id]:[])).map(String),page:B,perPage:w7,q:V.trim()})),Ne=((re=kd(fe.data))==null?void 0:re.map(Aw))??[];b.value=G?Cd(b.value,Ne,"id"):Ne,m.value=fe.meta.total,p.value=(((oe=fe==null?void 0:fe.meta)==null?void 0:oe.current_page)||0)<(((J=fe==null?void 0:fe.meta)==null?void 0:J.last_page)||0),f.value=B}catch(fe){console.error("Error fetching assignable users:",fe),h.value="Failed to load assignable users"}finally{c.value=!1,d.value=!1}},T=()=>{!d.value&&p.value&&x(f.value+1,v.value,!0)},k=Es(async B=>{v.value=B,await x(1,B,!1)},hr),L=()=>x(1,v.value,!1),Y=z(Ad);an(()=>{var B;(B=Z.value)==null||B.focus()}),t({getValue:()=>{var B;return(B=R.value.find(V=>V.selected))==null?void 0:B.value},refresh:L,clearInternal:()=>{F.value=[]},focus:()=>{var B;(B=Z.value)==null||B.focus()}});const ee=()=>{const B=Mn.getInstance().getItem("BASE_URL"),V=ni({type:"access_setting",config:{baseDomain:B,ws_code:i.workspaceId,entity_id:O}}).url;window.open(V,"_blank")},Z=$(null);return an(()=>{jt(()=>{var B;(B=Z.value)==null||B.focus()})}),nt([()=>i.id,()=>i.workspaceId,()=>i.ids],()=>{x()},{deep:!0,immediate:!0}),(B,V)=>(U(),$e(ll,Kt({"selected-id":K(F)},{...i},{options:K(R),loading:c.value,ref_key:"popupRef",ref:Z,"loading-more":d.value,"has-more":p.value,onSelect:V[0]||(V[0]=G=>{K(C)(G),l("start-update")}),onSearch:K(k),onLoadMore:T}),Wc({"extra-item":me(()=>[ae(ht,{variant:"menu-item",onHandleClick:K(E)},{prefix:me(()=>[he("div",{class:j(B.$style["unassign-icon"])},[ae(ft,{src:"UserXMark",source:"remote"})],2)]),default:me(()=>[V[1]||(V[1]=st(" Unassign all ",-1))]),_:1},8,["onHandleClick"])]),item:me(({item:G,selectedIndex:ve,isSelected:pe,handleSelect:re,handleItemHover:oe,getHighlightedLabel:J,query:fe,idx:Ne})=>[ae(ea,Kt(G,{hover:Ne===ve,selected:pe(G),type:G.type,onClick:Gt(ot=>re(G),["stop","prevent"]),onMouseover:ot=>oe(Ne),class:B.$style["item-assignee"]}),{prefix:me(()=>[Ke(ae(fu,df(Wf(r(G))),null,16),[[K(s),{user:G.data,status:"active",timezone:Y.value,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0}]])]),label:me(({selected:ot})=>[fe?Ke((U(),ue("span",{key:0,class:j([B.$style["item-label"],B.$style.match]),style:{flex:"1"},innerHTML:J(G.label)},null,10,y7)),[[K(o),{content:G.label}]]):Ke((U(),ue("span",{key:1,class:j(B.$style["item-label"]),style:{flex:"1"}},[st(yt(G.label),1)],2)),[[K(o),{content:G.label}]]),he("div",{class:j(B.$style["item-action"])},[Ke((U(),$e(ht,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:K(w),onClick:Gt(_e=>re(G),["stop","prevent"])},{prefix:me(()=>[ae(ft,{src:ot?"UserMinus":"UserPlus",source:"remote"},null,8,["src"])]),_:2},1032,["disabled","onClick"])),[[K(o),ot?"Unassign":"Assign"]]),Ke((U(),$e(ht,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:K(w),onClick:Gt(_e=>{var mt;return K(_)((mt=G.data)==null?void 0:mt.id)},["stop","prevent"])},{prefix:me(()=>[ae(ft,{src:"IdCardClip",source:"remote"})]),_:1},8,["disabled","onClick"])),[[K(o),"Unassign others and reassign"]])],2)]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),"empty-list":me(()=>[he("div",{class:j(B.$style["empty-state"])},[V[4]||(V[4]=st(" No assignee available. ",-1)),V[5]||(V[5]=he("br",null,null,-1)),ae(ht,{onClick:ee,variant:["tertiary"],size:"small"},{default:me(()=>[...V[3]||(V[3]=[st(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[h.value?{name:"error",fn:me(()=>[he("div",{class:j(B.$style["error-message"])},[st(yt(h.value)+" ",1),ae(ht,{onClick:L,size:"small"},{default:me(()=>[...V[2]||(V[2]=[st(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"]))}}),[["__cssModules",{$style:{action:"_action_1dg6a_1","item-assignee":"_item-assignee_1dg6a_6","item-action":"_item-action_1dg6a_6","item-label":"_item-label_1dg6a_16","unassign-icon":"_unassign-icon_1dg6a_25","error-message":"_error-message_1dg6a_36","empty-state":"_empty-state_1dg6a_46"}}]]),C7=ut({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{}},emits:["update"],setup(e,{emit:t}){const n=e;Va("bulkUpdate",!0);const o=t,i=$(null),s=f=>{var p;h.value=!1,o("update",f),(p=i.value)==null||p.clearInternal()},{triggerRef:r,popupRef:a,hide:l,isVisible:u}=lo(),c=$(null),d=f=>{f.key==="Escape"&&a.value&&l()};an(()=>{var p;const f=c.value instanceof HTMLElement?c.value:(p=c.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",d)}),Yn(()=>{var p;const f=c.value instanceof HTMLElement?c.value:(p=c.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",d)}),nt(u,f=>{var p,m;f?(p=i.value)==null||p.focus():(m=i.value)==null||m.clearInternal()});const h=$(!1);return(f,p)=>(U(),ue("div",{ref_key:"mainRef",ref:c},[he("div",{ref_key:"triggerRef",ref:r},[ae(ht,{class:"action-button",variant:n.variant,loading:h.value},{default:me(()=>[ae(ft,{src:"UserPlus",class:"icon"}),p[1]||(p[1]=st(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),he("div",{ref_key:"popupRef",ref:a,style:{display:"none"}},[K(u)?(U(),$e(yP,Kt({key:0,ref_key:"assigneeGroupEditorRef",ref:i},n,{ids:e.ids,onUpdated:s,onStartUpdate:p[0]||(p[0]=m=>h.value=!0)}),null,16,["ids"])):qe("",!0)],512)],512))}}),b7=["aria-label"],S7=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],E7={style:{flex:"1"}},R7=wt(ut({__name:"MainCalendar",props:WE({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:WE(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{emit:t}){const n=cn,o=e,i=z(()=>o.startDate&&o.endDate),s=$V(e,"tracingCase"),r=t,a=$(o.year),l=$(o.month);nt(()=>[o.year,o.month],([B,V])=>{a.value=B,l.value=V});const u=z(()=>it.fromObject({year:a.value,month:l.value,day:1},{zone:o.timezone}).setLocale(o.locale||"en-US").toFormat("LLLL yyyy")),c=z(()=>it.now().setZone(o.timezone)),d=z(()=>o.startDate?it.fromJSDate(o.startDate,{zone:o.timezone}):null),h=z(()=>o.endDate?it.fromJSDate(o.endDate,{zone:o.timezone}):null),f=$(d.value),p=$(h.value),m=$(d.value),v=$(h.value);nt([d,h],()=>{o.requireConfirm||(f.value=d.value,p.value=h.value,m.value=d.value,v.value=h.value)},{immediate:!0});const w=z(()=>o.requireConfirm?f.value:d.value),E=z(()=>o.requireConfirm?p.value:h.value);nt(()=>o.activeField,B=>{const V=B==="start"?w.value:E.value;V&&(a.value=V.year,l.value=V.month)}),nt(()=>{var B,V;return[(B=w.value)==null?void 0:B.toISODate(),(V=E.value)==null?void 0:V.toISODate(),o.activeField]},()=>{const B=o.activeField==="start"?w.value:E.value;B&&(B.year!==a.value||B.month!==l.value)&&(a.value=B.year,l.value=B.month)});function _(B){return B.setZone("utc")}const C=$("");function b(B){C.value=B.toISODate()||"",jt(()=>{const V=document.querySelector(`.arbo-calendar-day[data-date="${C.value}"]`);V==null||V.focus()})}nt(()=>{var B,V;return[a.value,l.value,o.activeField,(B=w.value)==null?void 0:B.toISODate(),(V=E.value)==null?void 0:V.toISODate()]},()=>{const B=o.activeField==="start"?w.value:E.value;let V;B&&B.year===a.value&&B.month===l.value?V=B:w.value&&w.value.year===a.value&&w.value.month===l.value?V=w.value:V=c.value,b(V)});function R(B){return B.toFormat("d")}const F=z(()=>{const B=it.fromObject({year:a.value,month:l.value,day:1},{zone:o.timezone}),V=B.weekday,G=o.weekStart===1?(V+6)%7:V%7;let ve=B.minus({days:G});const pe=[],re=xu.weekdays(o.weekdayLabelStyle||"short",{locale:o.locale||"en-US"}),oe=Zf();for(let fe=0;fe<42;fe++){const Ne=[];ve.month!==l.value&&Ne.push(oe["is-outside"]),ve.hasSame(c.value,"day")&&Ne.push(oe["is-today"]),w.value&&ve.hasSame(w.value,"day")&&Ne.push(oe["is-selected-start"]),E.value&&ve.hasSame(E.value,"day")&&Ne.push(oe["is-selected-end"]),w.value&&E.value&&ve>w.value&&ve<E.value&&Ne.push(oe["is-in-range"]);const ot=R(ve),_e=re[ve.weekday-1]||"";pe.push({dt:ve,iso:ve.toISODate()||"",label:ve.toFormat("d"),displayLabel:ot,weekdayLabel:_e,aria:ve.setLocale(o.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:Ne}),ve=ve.plus({days:1})}const J=[];for(let fe=0;fe<6;fe++)J.push(pe.slice(fe*7,fe*7+7));return J}),A=z(()=>{const B=xu.weekdays(o.weekdayLabelStyle||"short",{locale:o.locale||"en-US"});return o.weekStart===1?B:[B[6],...B.slice(0,6)]});function I(B,V,G){const ve=B==="start"?V.startOf("day"):V.endOf("day"),pe=_(ve),re={year:ve.year,month:ve.month,day:ve.day,utc:pe.toISO()||""};B==="start"?(r("select-start",re,G??!0),r("select-start-utc",re.utc)):(r("select-end",re),r("select-end-utc",re.utc))}function O(B){let V=a.value,G=l.value+B;for(;G<1;)G+=12,V-=1;for(;G>12;)G-=12,V+=1;a.value=V,l.value=G,r("update:year",V),r("update:month",G)}function x(B){const G=(C.value?it.fromISO(C.value,{zone:o.timezone}):c.value).plus({days:B});(G.month!==l.value||G.year!==a.value)&&(l.value=G.month,a.value=G.year,r("update:year",G.year),r("update:month",G.month)),b(G)}function T(B=!1){const G=(C.value?it.fromISO(C.value,{zone:o.timezone}):c.value).weekday%7,ve=B?6-G:-G;x(ve)}function k(B){switch(B.key){case"ArrowLeft":B.preventDefault(),x(-1);break;case"ArrowRight":B.preventDefault(),x(1);break;case"ArrowUp":B.preventDefault(),x(-7);break;case"ArrowDown":B.preventDefault(),x(7);break;case"Home":B.preventDefault(),T(!1);break;case"End":B.preventDefault(),T(!0);break;case"PageUp":B.preventDefault(),O(B.shiftKey?-12:-1);break;case"PageDown":B.preventDefault(),O(B.shiftKey?12:1);break;case"Enter":case" ":{B.preventDefault();const V=C.value?it.fromISO(C.value,{zone:o.timezone}):c.value,G=F.value.flat().find(ve=>ve.iso===V.toISODate());G&&Y(G);break}}}const L=B=>{const V=it.now().setZone(o.timezone);a.value=V.year,l.value=V.month,r("update:year",V.year),r("update:month",V.month),b(V),r("gotoToday")};function Y(B){var bt,vt;const V=!!d.value,G=!!h.value,ve=o.activeField,pe=((bt=d.value)==null?void 0:bt.toISODate())||"null",re=((vt=h.value)==null?void 0:vt.toISODate())||"null",oe=B.dt.toISODate()||"",J=(N,q)=>{s.value={case:N,behavior:q}},fe=()=>`Selected start ${oe} > existing end ${re} -> reset both to ${oe}`,Ne=()=>`Selected end ${oe} < existing start ${pe} -> reset both to ${oe}`,ot=()=>{I("start",B.dt,!0),I("end",B.dt),r("update:activeField","end")},_e=(N=!1)=>{I("start",B.dt,N),N&&r("update:activeField","end")},mt=(N=!1)=>{I("end",B.dt),N&&r("close")};if(V&&G){ve==="start"?h.value&&B.dt>h.value?(ot(),J("INVERT_RANGE_FROM_START",fe())):(_e(!1),J("UPDATE_START_IN_RANGE",`Updated start from ${pe} to ${oe}; end remains ${re}`)):d.value&&B.dt<d.value?(ot(),J("INVERT_RANGE_FROM_END",Ne())):(mt(!1),J("UPDATE_END_IN_RANGE",`Updated end from ${re} to ${oe}; start remains ${pe}`));return}if(!V&&G&&ve==="start"&&h.value&&B.dt>h.value){ot(),J("CREATE_RANGE_FROM_LATE_START",fe());return}if(V&&!G&&ve==="end"&&d.value&&B.dt<d.value){ot(),J("CREATE_RANGE_FROM_EARLY_END",Ne());return}if(!V&&!G){if(ve==="start"){_e(!0),J("INIT_START",`Picked start ${oe}; awaiting end selection`);return}mt(o.immediatelyUpdate),J("INIT_END",`Picked end ${oe}; awaiting start selection`);return}if(!V&&G){if(ve==="start"){_e(!0),J("FILL_MISSING_START",`Inserted start ${oe}; existing end ${re}`);return}mt(!1),J("STRICT_UPDATE_END_ONLY",`Updated end to ${oe}; start still null`);return}if(V&&!G){if(ve==="start"){_e(!0),J("RESELECT_START_BEFORE_END",`Replaced start with ${oe}; end still null, switching to end`);return}mt(o.immediatelyUpdate),J("FILL_MISSING_END",`Picked end ${oe}; start ${pe}`);return}}function ee(){m.value=f.value,v.value=p.value,r("confirm")}function Z(){f.value=m.value,p.value=v.value,r("cancel")}return(B,V)=>(U(),ue("div",{class:j([B.$style["arbo-calendar"],{[B.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":u.value,tabindex:"0",onKeydown:k},[he("div",{class:j([B.$style["arbo-calendar-header"],B.$style["arbo-calendar-week"]]),role:"row"},[(U(!0),ue(Pt,null,Tn(A.value,G=>(U(),ue("div",{key:G,class:j(B.$style["arbo-calendar-weekday"]),role:"columnheader"},yt(G),3))),128))],2),he("div",{class:j(B.$style["arbo-calendar-weeks"])},[(U(!0),ue(Pt,null,Tn(F.value,(G,ve)=>(U(),ue("div",{key:ve,class:j(B.$style["arbo-calendar-week"]),role:"row"},[(U(!0),ue(Pt,null,Tn(G,pe=>(U(),ue("div",{key:pe.iso,class:j([B.$style["arbo-calendar-day"],pe.classes,{[B.$style["is-focused"]]:pe.iso===C.value}]),disabled:o.disabled,readOnly:o.readOnly,role:"gridcell","aria-label":pe.aria,"data-date":pe.iso,"data-weekday":pe.weekdayLabel,tabindex:pe.iso===C.value?0:-1,onClick:re=>Y(pe)},yt(pe.displayLabel),11,S7))),128))],2))),128))],2),o.readOnly?qe("",!0):(U(),ue("div",{key:0,class:j(B.$style["arbo-calendar-actions"])},[he("div",E7,[Ke((U(),$e(ht,{variant:"secondary",size:"medium",onClick:V[0]||(V[0]=G=>L())},{prefix:me(()=>[ae(ft,{src:"CalendarDay"})]),_:1})),[[K(n),"Today"]])]),ae(ht,{disabled:o.disabled,readOnly:o.readOnly,variant:"secondary",size:"medium",onClick:Z},{default:me(()=>[st(yt(o.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),ae(ht,{disabled:o.disabled||o.disableConfirm,readOnly:o.readOnly,variant:"primary",size:"medium",onClick:ee},{default:me(()=>[st(yt(o.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))],42,b7))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_85hoe_1","arbo-calendar-day":"_arbo-calendar-day_85hoe_2","arbo-calendar-week":"_arbo-calendar-week_85hoe_3","arbo-calendar":"_arbo-calendar_85hoe_2","arbo-calendar-nav":"_arbo-calendar-nav_85hoe_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_85hoe_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_85hoe_53","arbo-calendar-weekday":"_arbo-calendar-weekday_85hoe_58","arbo-calendar-weeks":"_arbo-calendar-weeks_85hoe_63","is-today":"_is-today_85hoe_92","is-selected-start":"_is-selected-start_85hoe_97","is-selected-end":"_is-selected-end_85hoe_105","is-outside":"_is-outside_85hoe_125","is-in-range":"_is-in-range_85hoe_128","arbo-calendar-actions":"_arbo-calendar-actions_85hoe_134","arbo-calendar-btn":"_arbo-calendar-btn_85hoe_142",cancel:"_cancel_85hoe_151",confirm:"_confirm_85hoe_156"}}]]),_7=["onClick"],D7=["variant","onClick"],x7=wt(ut({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,i=z(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const k=o.locale||"en-US",L=o.monthLabelStyle||"short",Y=new Intl.DateTimeFormat(k,{month:L,timeZone:"UTC"});return Array.from({length:12},(Z,B)=>Y.format(new Date(Date.UTC(2020,B,1))))}),s=n,r=$(o.year),a=$(o.month),l=$(o.year);nt(()=>o.year,k=>{k!==r.value&&(r.value=k,l.value=k)}),nt(()=>o.month,k=>{k!==a.value&&(a.value=k)});const u=$("days");function c(k){u.value!==k&&(u.value=k,s("mode-change",k))}const d=z(()=>o.minYear),h=z(()=>o.maxYear),f=z(()=>{const k=o.yearSpan;return l.value-l.value%k}),p=z(()=>f.value+o.yearSpan-1);function m(){const k=o.yearSpan,L=f.value-k;L>=d.value&&(l.value=L)}function v(){const k=o.yearSpan,L=f.value+k;L<=h.value&&(l.value=L)}const w=z(()=>f.value-o.yearSpan<d.value),E=z(()=>p.value+o.yearSpan>h.value),_=z(()=>{const k=o.yearSpan;return Math.ceil(k/3)});function C(k){const Y=f.value+(k-1)*3;return Array.from({length:3},(ee,Z)=>Y+Z).filter(ee=>ee<=p.value)}function b(){u.value==="months"?c("days"):c("months")}function R(){u.value==="years"?c("days"):c("years")}function F(k){r.value=k,l.value=k,s("update:year",k),s("year-selected",k),c("months")}function A(k){a.value=k,s("update:month",k),s("month-selected",k),c("days")}function I(){if(u.value==="days"){let k=r.value,L=a.value-1;if(L<1&&(L=12,k--),k<d.value)return;r.value=k,a.value=L,s("update:year",k),s("update:month",L)}else if(u.value==="months"){if(r.value-1<d.value)return;r.value--,s("update:year",r.value)}else u.value==="years"&&m()}function O(){if(u.value==="days"){let k=r.value,L=a.value+1;if(L>12&&(L=1,k++),k>h.value)return;r.value=k,a.value=L,s("update:year",k),s("update:month",L)}else if(u.value==="months"){if(r.value+1>h.value)return;r.value++,s("update:year",r.value)}else u.value==="years"&&v()}const x=z(()=>u.value==="days"?r.value===d.value&&a.value===1:u.value==="months"?r.value-1<d.value:w.value),T=z(()=>u.value==="days"?r.value===h.value&&a.value===12:u.value==="months"?r.value+1>h.value:E.value);return t({setNavigation:(k,L)=>{r.value=k,a.value=L}}),(k,L)=>(U(),ue("div",{class:j([k.$style["cal-nav-wrapper"]])},[Tt(k.$slots,"selection"),u.value==="days"?(U(),ue("div",{key:0,class:j(k.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Previous",disabled:x.value,label:"",onClick:I},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),he("div",{class:j(k.$style["cal-nav-center"])},[ae(ht,{variant:"secondary",onClick:b},{default:me(()=>[st(yt(i.value[a.value-1]),1)]),_:1}),ae(ht,{variant:"secondary",onClick:R},{default:me(()=>[st(yt(r.value),1)]),_:1})],2),ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:T.value,label:"",onClick:O},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2)):qe("",!0),u.value==="years"?(U(),ue("div",{key:1,class:j(k.$style["year-grid"])},[he("div",{class:j(k.$style["year-grid-header"])},[ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:m},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),he("div",{class:j(k.$style["range-label"])},yt(f.value)+" - "+yt(p.value),3),ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:E.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),he("div",{class:j(k.$style["year-grid-body"]),role:"grid"},[(U(!0),ue(Pt,null,Tn(_.value,Y=>(U(),ue("div",{key:"yr-row-"+Y,class:j(k.$style["year-grid-row"])},[(U(!0),ue(Pt,null,Tn(C(Y),ee=>(U(),ue("div",{key:ee,class:j([k.$style["year-cell"],{[k.$style.selected]:ee===r.value}]),onClick:Z=>F(ee)},yt(ee),11,_7))),128))],2))),128))],2)],2)):u.value==="months"?(U(),ue("div",{key:2,class:j(k.$style["month-grid"]),"aria-label":"Select month"},[he("div",{class:j(k.$style.months)},[(U(!0),ue(Pt,null,Tn(i.value,(Y,ee)=>(U(),ue("div",{key:Y,variant:ee+1===a.value?"primary":"text",class:j([k.$style["month-cell"],{[k.$style.selected]:ee+1===a.value}]),onClick:Z=>A(ee+1)},yt(Y),11,D7))),128))],2)],2)):(U(),ue("div",{key:3,class:j(k.$style["days-slot"])},[Tt(k.$slots,"default",{year:r.value,month:a.value,mode:u.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_16tl9_1","cal-nav-bar":"_cal-nav-bar_16tl9_12","cal-nav-btn":"_cal-nav-btn_16tl9_20",prev:"_prev_16tl9_33","year-grid-header":"_year-grid-header_16tl9_37","cal-nav-center":"_cal-nav-center_16tl9_46","cal-nav-label":"_cal-nav-label_16tl9_52","month-grid":"_month-grid_16tl9_66","year-grid":"_year-grid_16tl9_37",months:"_months_16tl9_75","month-cell":"_month-cell_16tl9_82","year-cell":"_year-cell_16tl9_83","pg-btn":"_pg-btn_16tl9_105","year-grid-body":"_year-grid-body_16tl9_118","year-grid-row":"_year-grid-row_16tl9_125",selected:"_selected_16tl9_131","days-slot":"_days-slot_16tl9_137","range-label":"_range-label_16tl9_141"}}]]);function F7(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:i}=e,s=$(""),r=z(()=>{const m=it.fromFormat(s.value,t,{zone:n});return m.isValid?m:null}),a=z(()=>{if(!o||!r.value)return!0;const m={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year>m.year?!0:v.year<m.year?!1:v.month>m.month?!0:v.month<m.month?!1:l(v,m)>=0}),l=(m,v)=>{const w=new Date(m.year,m.month-1,m.day),E=new Date(v.year,v.month-1,v.day);return w<E?-1:w>E?1:0},u=z(()=>{if(!i||!r.value)return!0;const m={year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year<m.year?!0:v.year>m.year?!1:v.month<m.month?!0:v.month>m.month?!1:l(v,m)<=0}),c=z(()=>s.value.length==0||s.value.length>0&&r.value!==null&&a.value&&u.value),d=z(()=>s.value.length===t.length&&c.value);return{inputValue:s,isValid:c,isComplete:d,clear:()=>{s.value=""},setDate:m=>{let v;m instanceof Date?v=it.fromJSDate(m,{zone:n}):v=m.setZone(n),v.isValid?s.value=v.toFormat(t):s.value=""},getDate:()=>c.value?r.value:null}}const T7={key:0,style:{marginLeft:"8px"}},P7=["disabled","readonly","placeholder"],wP=wt(ut({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=n,r=$(null),a=$(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:h,getDate:f}=F7({format:i.format,allowPastDates:i.allowPastDates,allowFutureDates:i.allowFutureDates,timezone:i.timezone,minDate:i.minDate,maxDate:i.maxDate}),p=z(()=>i.active),m=z(()=>({disabled:i.disabled,error:!l.value&&c.value.length>0,readOnly:i.readOnly,isEmpty:c.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:E}=Co(m),_=R=>{var A;const F=(A=R.clipboardData)==null?void 0:A.getData("text/plain");F&&(c.value=F.trim())},C=()=>{d(),s("clear")};t({clear:C,setDate:h,getDate:f,focus:()=>{var R;return(R=r.value)==null?void 0:R.focus()}}),nt(()=>i.modelValue,R=>{R?h(R):d()},{immediate:!0}),nt([()=>u.value,()=>c.value],()=>{if(c.value.length===0){s("complete",null);return}else if(l.value&&!i.readOnly&&!i.disabled&&u.value){const R=f();(R||c.value.length===0)&&s("complete",R)}}),nt(()=>l.value,R=>{R||s("invalid","")});const b=z(()=>!!i.isMultipleDate);return(R,F)=>(U(),$e(bo,Kt(K(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:me(()=>[he("div",{class:j([R.$style["date-input-wrapper"]])},[b.value?(U(),ue("span",T7," Multiple ")):Ke((U(),ue("input",{key:1,disabled:i.disabled,readonly:i.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":F[0]||(F[0]=A=>rn(c)?c.value=A:null),onPaste:Gt(_,["prevent"]),placeholder:i.placeholder,class:j([R.$style["date-input"]])},null,42,P7)),[[oy,K(c)]]),Tt(R.$slots,"clear",{handleClear:C},()=>[(K(c).length>0||b.value)&&!i.readOnly&&!i.disabled&&(K(w)||K(E))?Ke((U(),$e(ht,{key:0,variant:["icon","primary"],onClick:Gt(C,["stop"]),size:16,rounded:!0},{default:me(()=>[ae(ft,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[K(o),"Clear"]]):(U(),$e(ft,{key:1,src:"Calendar",source:"remote",class:j(R.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_ycl1p_1","icon-calendar":"_icon-calendar_ycl1p_9",focus:"_focus_ycl1p_12",hover:"_hover_ycl1p_12",active:"_active_ycl1p_12","date-input":"_date-input_ycl1p_1",invalid:"_invalid_ycl1p_38"}}]]),I7=ut({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:Iw()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o=$({case:"",behavior:""}),i=e,s=$(null),r=n,a=async(oe,J)=>{r("start-update"),await oe(),r("finish-update"),jt(()=>{var fe,Ne;J(),(Ne=(fe=i.params)==null?void 0:fe.api)==null||Ne.stopEditing()})},l=(oe,J)=>{oe(),jt(()=>{var fe,Ne;J(),(Ne=(fe=i.params)==null?void 0:fe.api)==null||Ne.stopEditing()})},u=()=>{var J;const oe=it.now().setZone(i.timezone);B.value=oe.year,V.value=oe.month,(J=Z.value)==null||J.setNavigation(oe.year,oe.month)},c=vi({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:m,confirmSelection:v,selectStartDate:w,beginInteraction:E,clearStart:_,clearDue:C}=v5(i,r),b=z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});nt(()=>i.multipleStartDates,oe=>{h.value=!!oe},{immediate:!0}),nt(()=>i.multipleDueDates,oe=>{f.value=!!oe},{immediate:!0});const R=oe=>{if(!oe){c.start=!1,_();return}const J=d.endDate?it.fromJSDate(d.endDate,{zone:i.timezone}):null;if(J&&F(oe,J)>0){const Ne={year:oe.year,month:oe.month,day:oe.day};c.start=!1,w(Ne,!1),p(Ne),jt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const fe={year:oe.year,month:oe.month,day:oe.day};c.start=!1,w(fe,!0)},F=(oe,J)=>{const fe=oe.startOf("day"),Ne=J.startOf("day");return fe<Ne?-1:fe>Ne?1:0},A=oe=>{if(!oe){c.end=!1,C();return}const J=d.startDate?it.fromJSDate(d.startDate,{zone:i.timezone}):null;if(J&&F(oe,J)<0){const Ne={year:oe.year,month:oe.month,day:oe.day};c.end=!1,w(Ne),p(Ne),jt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const fe={year:oe.year,month:oe.month,day:oe.day};c.end=!1,p(fe)},I=()=>{h.value=!1,_()},O=()=>{f.value=!1,C()},x=()=>{Y()},T=z(()=>d.isSelectingStart||d.isSelectingEnd);function k(){i.disabled||i.readOnly||(E(),d.isSelectingStart=!0,d.isSelectingEnd=!1)}function L(){i.disabled||i.readOnly||(E(),d.isSelectingEnd=!0,d.isSelectingStart=!1)}function Y(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function ee(oe){oe.key==="Escape"&&(oe.stopPropagation(),Y())}const Z=$(null),B=$(new Date().getFullYear()),V=$(new Date().getMonth()+1);nt(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(B.value=d.startDate.getFullYear(),V.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(B.value=d.endDate.getFullYear(),V.value=d.endDate.getMonth()+1)},{immediate:!0});const G=$(null);function ve(){if(Array.isArray(i.value)){const[J,fe]=i.value;d.startDate=J||null,d.endDate=fe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const oe=d.startDate||d.endDate||new Date;B.value=oe.getFullYear(),V.value=oe.getMonth()+1}nt(()=>{var oe,J,fe,Ne,ot,_e,mt,bt;return[((fe=(J=(oe=i.value)==null?void 0:oe[0])==null?void 0:J.getTime)==null?void 0:fe.call(J))||((Ne=i.value)==null?void 0:Ne[0]),((mt=(_e=(ot=i.value)==null?void 0:ot[1])==null?void 0:_e.getTime)==null?void 0:mt.call(_e))||((bt=i.value)==null?void 0:bt[1]),i.timezone,i.format,i.placeholder,i.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:k,openEnd:L,closePicker:Y,clearAll:x,isOpen:T,drpRef:G,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{var oe;d.startDate||d.endDate?d.startDate?k():L():(k(),(oe=s.value)==null||oe.focus())}});const re=$(null);return nt(()=>T.value,oe=>{if(i.disabled||i.readOnly)return;const J=re.value;J&&(oe?J.show():J.hide())},{immediate:!0}),(oe,J)=>(U(),ue("div",{class:j(oe.$style["calendar-wrapper"])},[ae(x7,{year:B.value,"onUpdate:year":J[6]||(J[6]=fe=>B.value=fe),month:V.value,"onUpdate:month":J[7]||(J[7]=fe=>V.value=fe),locale:i.locale,disabled:i.disabled,readOnly:i.readOnly,onKeydown:ee,ref_key:"navigationRef",ref:Z},{selection:me(()=>[he("div",{class:j(oe.$style["calendar-input-section"])},[ae(wP,{ref_key:"starDateRef",ref:s,"model-value":K(d).startDate,placeholder:i.startPlaceholder,timezone:i.timezone,active:K(d).isSelectingStart,onClick:k,onClear:I,onComplete:R,onInvalid:J[0]||(J[0]=fe=>c.start=!0),disabled:i.disabled,readOnly:i.readOnly,isMultipleDate:K(h)},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"]),ae(wP,{"model-value":K(d).endDate,placeholder:i.duePlaceholder,timezone:i.timezone,active:K(d).isSelectingEnd,onClick:L,onClear:O,disabled:i.disabled,onComplete:A,onInvalid:J[1]||(J[1]=fe=>c.end=!0),readOnly:i.readOnly,isMultipleDate:K(f)},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:me(({year:fe,month:Ne})=>[ae(R7,{disabled:i.disabled,disableConfirm:c.end||c.start,readOnly:i.readOnly,ref_key:"drpRef",ref:G,"tracing-case":o.value,"onUpdate:tracingCase":J[2]||(J[2]=ot=>o.value=ot),year:fe,month:Ne,"start-date":K(d).startDate,"end-date":K(d).endDate,"active-field":b.value,timezone:i.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:K(w),onSelectEnd:K(p),onGotoToday:u,onConfirm:J[3]||(J[3]=()=>{a(K(v),Y)}),onCancel:J[4]||(J[4]=ot=>l(K(m),Y)),onClose:J[5]||(J[5]=ot=>a(K(v),Y))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],2))}}),gC=wt(I7,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_f7hcw_1","calendar-input-section":"_calendar-input-section_f7hcw_10","display-wrapper":"_display-wrapper_f7hcw_18","calendar-actions":"_calendar-actions_f7hcw_22","clear-all-btn":"_clear-all-btn_f7hcw_28"}}]]),A7={ref:"mainRef"},k7=ut({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated"],setup(e,{emit:t}){const n=t,o=e,i=Io("bulkUpdate",!1),{apiServices:s}=ao(!i,o),r=async b=>{var F,A,I;C.value=!0;let R={workspaceId:o.workspaceId,itemIds:o.ids,startDate:void 0,dueDate:void 0};"start"in b&&(R.startDate=b.start?cF(b.start):null),"end"in b&&(R.dueDate=b.end?cF(b.end):null),await((A=(F=s.value)==null?void 0:F.changeDate)==null?void 0:A.call(F,R)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:R}),(I=p.value)==null||I.resetCalendarLogic()},a=()=>{if(!o.rowSelected||o.rowSelected.length===0){l();return}o.rowSelected.length===1?u():c()},l=()=>{f.value=!1,h.value=!1,_.value=[null,null]},u=()=>{const R=o.rowSelected[0].dateRange;_.value=[(R==null?void 0:R[0])??null,(R==null?void 0:R[1])??null],f.value=!1,h.value=!1},c=()=>{var R,F;if(o.rowSelected.some(A=>A.dateRange&&(A.dateRange[0]!==null||A.dateRange[1]!==null))){const A=d(0),I=d(1);if(h.value=A,f.value=I,A)_.value[0]=null;else{const O=((R=o.rowSelected[0].dateRange)==null?void 0:R[0])??null;_.value[0]=O}if(I)_.value[1]=null;else{const O=((F=o.rowSelected[0].dateRange)==null?void 0:F[1])??null;_.value[1]=O}}else h.value=!1,f.value=!1,_.value=[null,null]},d=b=>{const R=o.rowSelected.map(A=>{var I;return(I=A.dateRange)==null?void 0:I[b]});return R.length===0?!1:new Set(R.map(A=>{var I;return(I=A==null?void 0:A.getTime)==null?void 0:I.call(A)})).size>1},h=$(!1),f=$(!1),p=$(null),{triggerRef:m,popupRef:v,hide:w,isVisible:E}=lo(),_=$([null,null]);nt([()=>o.ids,()=>o.rowSelected,E],b=>{var R;a(),(R=p.value)==null||R.focus()},{immediate:!0,deep:!0});const C=$(!1);return(b,R)=>(U(),ue("div",A7,[he("div",{ref_key:"triggerRef",ref:m},[ae(ht,{variant:o.variant,loading:C.value},{default:me(()=>[ae(ft,{src:"Calendar"}),R[2]||(R[2]=st(" Date ",-1))]),_:1},8,["variant","loading"])],512),he("div",{ref_key:"popupRef",ref:v,style:{display:"none"}},[K(E)?(U(),$e(gC,{key:0,immediatelyUpdate:!1,value:_.value,onConfirmed:r,ref_key:"calendarRef",ref:p,onClosed:K(w),onStartUpdate:R[0]||(R[0]=F=>C.value=!0),onFinishUpdate:R[1]||(R[1]=F=>C.value=!1),multipleDueDates:f.value,multipleStartDates:h.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):qe("",!0)],512)],512))}}),O7=e=>{if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"},CP=al("metricStore",()=>{const e=$();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var i;if(((i=o==null?void 0:o.auth_permission)==null?void 0:i.permission)==2)return O7(o)}}}),M7=["onKeydown"],L7=["width","height","viewBox"],N7=["d"],V7="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",bP=ut({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change"],setup(e,{emit:t}){const n=e,o=t,i=$(n.modelValue??0),s=$(null),r=z(()=>{var b;return((b=n.params)==null?void 0:b.size)??24}),a=z(()=>{var b;return((b=n.params)==null?void 0:b.iconViewBox)??"0 0 24 24"}),l=z(()=>{var b;return((b=n.params)==null?void 0:b.iconPath)??V7}),u=z(()=>{var b;return((b=n.params)==null?void 0:b.wrapperTag)??"span"}),c=z(()=>{var b;return n.disabled||((b=n.params)==null?void 0:b.disabled)||!1}),d=z(()=>{var b;return n.readOnly||((b=n.params)==null?void 0:b.readOnly)||!1}),h=z(()=>!c.value&&!d.value),f=z(()=>c.value?"not-allowed":d.value?"default":"pointer");nt(()=>n.modelValue,b=>{typeof b=="number"&&b!==i.value&&(i.value=b)});const p=b=>{var R;return((R=n.params)==null?void 0:R.maxRating)-b+1<=i.value},m=b=>{console.log("RatingComponent: handleClick called with value",b),h.value&&w(b)},v=b=>{h.value&&w(b)},w=b=>{var F,A;if(!h.value)return;let R=((F=n.params)==null?void 0:F.maxRating)-b+1;R===i.value&&(R=0),i.value=R,o("update:modelValue",R),o("update",R),o("change",R),(A=n.params)!=null&&A.onUpdate&&n.params.onUpdate(R)},E=b=>{var R;b!==i.value&&(i.value=b,o("update:modelValue",b),o("update",b),o("change",b),(R=n.params)!=null&&R.onUpdate&&n.params.onUpdate(b))},_=()=>{h.value&&(i.value=i.value+1%(n.params.maxRating+1),E(i.value))},C=()=>{h.value&&(i.value=(i.value-1+(n.params.maxRating+1))%(n.params.maxRating+1),E(i.value))};return(b,R)=>(U(),ue("div",{class:j(["rating-component",{"rating-component--disabled":c.value,"rating-component--readOnly":d.value}]),style:on({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:s,tabindex:"0",onKeydown:[iu(Gt(C,["prevent"]),["left"]),iu(Gt(_,["prevent"]),["right"]),iu(Gt(C,["prevent"]),["down"]),iu(Gt(_,["prevent"]),["up"])]},[(U(!0),ue(Pt,null,Tn(e.params.maxRating,F=>(U(),$e(BE(u.value),{key:F,class:j(["rating-item",{filled:p(F),"rating-item--disabled":c.value,"rating-item--readOnly":d.value}]),style:on({cursor:f.value,order:e.params.maxRating-F,height:r.value+"px",width:r.value+"px"}),"aria-checked":p(F),"aria-disabled":c.value,"aria-readOnly":d.value,tabindex:-1,onClick:Gt(A=>m(F),["prevent","stop"]),onKeyup:[iu(Gt(A=>v(F),["prevent"]),["enter"]),iu(Gt(A=>v(F),["prevent"]),["space"])]},{default:me(()=>[Tt(b.$slots,"icon",{index:F,filled:p(F),size:r.value,iconViewBox:a.value,disabled:c.value,readOnly:d.value},()=>[(U(),ue("svg",{class:"rating-icon",width:r.value,height:r.value,viewBox:a.value,"aria-hidden":"true",focusable:"false"},[he("path",{d:l.value},null,8,N7)],8,L7))]),Tt(b.$slots,"overlay",{index:F,filled:p(F),disabled:c.value,readOnly:d.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","onClick","onKeyup"]))),128))],46,M7))}}),B7={style:{maxWidth:"180px",lineHeight:"15px"}},H7=["innerHTML"],SP=ut({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=n,r=()=>{console.log("Closing MetricEditorDropdown"),s("close")},a=m=>{var v;if(m.format_type==="dropdown"&&m.format_value)try{const w=JSON.parse(m.format_value);if(Array.isArray(w)){const E=w.map(_=>({label:_.name,value:_.name,id:_.name}));return E.unshift({label:"-",value:void 0,id:"-"}),E}}catch(w){console.error("Failed to parse dropdown options",w)}if(m.format_type=="number"&&m.restricted_type=="exact"){const w=((v=m.restricted_value)==null?void 0:v.split(",").map(E=>({label:m.mapping[`!${E}`]||E,value:E,id:E})))||[];return w.unshift({label:"-",value:void 0,id:"-"}),w}return[]},l=z(()=>a(i.config)),u=$(i.modelValue),c=m=>{u.value=m,s("update:modelValue",m),s("change",m||null)},d=$(l.value),h=$(!1),f=m=>{h.value=!0,m?d.value=l.value.filter(v=>v.label.toLowerCase().includes(m.toLowerCase())):d.value=l.value,setTimeout(()=>{h.value=!1},300)},p=$(null);return an(()=>{var m;(m=p.value)==null||m.focus()}),t({focus:()=>{var m;(m=p.value)==null||m.focus()}}),(m,v)=>(U(),$e(ll,{style:{width:326},loading:h.value,options:d.value,"selected-id":e.modelValue||void 0,onSearch:f,onSelect:v[0]||(v[0]=w=>c(w.id)),ref_key:"searchListRef",ref:p,onClose:r,onCancel:r},{item:me(({item:w,getHighlightedLabel:E,selectedIndex:_,index:C})=>[ae(ea,{hover:_==C,selected:w.value===e.modelValue,label:w.label,onSelect:b=>c(w.value||null)},{label:me(()=>[he("div",B7,[Ke(he("span",{innerHTML:E(w.label)},null,8,H7),[[K(o),{content:w.label}]])])]),_:2},1032,["hover","selected","label","onSelect"])]),"empty-list":me(()=>[...v[1]||(v[1]=[st("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),EP=ut({__name:"MetricEditorInput",props:{config:{},modelValue:{}},emits:["update:modelValue","handleChange"],setup(e,{emit:t}){const n=e,o=$(n.modelValue),i=$(n.modelValue),s=z(()=>{var p;let f="";return Number((p=n.config)==null?void 0:p.format_value)&&(f+="."+Array.from({length:Number(n.config.format_value)}).map(()=>"0").join("")),`0${f}`});nt(()=>n.modelValue,f=>{o.value=f,i.value=f});const r=f=>f5(n.config,f),a=t,l=$(null),u=f=>{console.log("MetricEditorInput: handleEnter called",f),f!==i.value&&(o.value=f,a("update:modelValue",f),a("handleChange",f||null),i.value=f)},c=f=>{console.log("MetricEditorInput: handleBlur called",f),f!==i.value&&(o.value=f,a("update:modelValue",f),a("handleChange",f||null),i.value=f)},d=()=>{var f;console.log("MetricEditorInput: handleClear called"),o.value=null,i.value=null,a("update:modelValue",null),(f=l.value)==null||f.focus()},h=()=>{console.log("MetricEditorInput: handleCancel called - reverting to:",i.value),o.value=i.value,a("update:modelValue",i.value),a("handleChange",i.value)};return an(()=>{var f;(f=l.value)==null||f.focus()}),(f,p)=>(U(),$e(fC,{modelValue:o.value,"onUpdate:modelValue":p[0]||(p[0]=m=>o.value=m),placeholder:s.value,validatorFnc:r,style:{"--bg-input":"#FAFAFA"},onEnterValue:u,onBlur:c,onClear:d,onCancel:h,type:"number",ref_key:"inputRef",ref:l},null,8,["modelValue","placeholder"]))}}),$7=["max"],G7={key:2},W7={class:"wrapper-suffix"},U7={key:3},z7=wt(ut({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","loseFocus","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=e,i=$(null),s=$(0),r=z(()=>lF(o.config)),a=z(()=>!!L.value),l=()=>{I("loseFocus")},u=()=>{k(),I("loseFocus")},c=()=>{k(),b()},d=()=>(o.config.format_symbol||"").split(/[\s-_]+/).map(G=>G.charAt(0).toUpperCase()+G.slice(1)).join("").replace(/Outline|Solid/g,""),h=$(null),f=$(!0),p=z(()=>{var V;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((V=i.value)==null?void 0:V.length)===0,wrapperRef:x,active:a,focus:o.focus,bordered:!0}}),m=$(null),v=z(()=>f.value),w=z(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:s.value===0,wrapperRef:m,active:v,focus:f.value,bordered:!0})),{argsMain:E}=Co(w),{argsMain:_}=Co(p),C=$(null),b=()=>{var V;(V=C.value)==null||V.focus()},R=V=>{var G;if(V.format_type==="dropdown"&&V.format_value)try{const ve=JSON.parse(V.format_value);if(Array.isArray(ve))return ve.map(pe=>({label:pe.name,value:pe.name,id:pe.name}))}catch(ve){console.error("Failed to parse dropdown options",ve)}return V.format_type=="number"&&V.restricted_type=="exact"?((G=V.restricted_value)==null?void 0:G.split(",").map(pe=>({label:V.mapping[`!${pe}`]||pe,value:pe,id:pe})))||[]:[]},F=z(()=>R(o.config)),A=z(()=>{var V;return((V=F.value.find(G=>G.value===i.value))==null?void 0:V.label)||i.value||"Select one"}),I=n,O=()=>{r.value=="rating"?I("updateMetric",s.value==0?null:s.value):I("updateMetric",i.value||null),k()},{triggerRef:x,popupRef:T,hide:k,isVisible:L,show:Y}=lo({appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),ee=()=>{switch(r.value){case"dropdown":Y(),jt(()=>{var V;(V=h.value)==null||V.focus()});break;case"rating":f.value=!0,jt(()=>{var V;(V=B.value)==null||V.focus()});break}};t({resetState:()=>{i.value=null,s.value=0},focus:ee});const Z=V=>{V.preventDefault(),V.key==="ArrowRight"||V.key==="ArrowUp"?s.value<(o.config.range||5)&&(s.value+=1):V.key==="ArrowLeft"||V.key==="ArrowDown"?s.value>0&&(s.value-=1):V.key==="Enter"||(V.key==="Tab"?f.value=!1:V.key=="Escape"&&(console.log("escape key pressed"),V.preventDefault(),V.stopImmediatePropagation(),V.stopPropagation()))},B=$(null);return an(()=>{jt(()=>{if(m.value){const V=m.value.rootEl;console.log("triggerRef2",V),V==null||V.addEventListener("keyup",G=>{console.log("keypress event",G),Z(G)})}ee()})}),(V,G)=>{const ve=Ma("tooltip");return U(),ue("div",{class:j(V.$style["metric-editor"])},[r.value=="number"?(U(),$e(EP,{key:0,config:o.config,modelValue:i.value,"onUpdate:modelValue":G[0]||(G[0]=pe=>i.value=pe),style:{width:"100%"},onCancel:l,onEnter:b},null,8,["config","modelValue"])):r.value=="rating"?(U(),$e(bo,Kt({key:1,"tab-index":1},K(E),{ref_key:"triggerRef2",ref:m,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{default:me(()=>[Ke(he("input",{ref_key:"ratingInputRef",ref:B,type:"number","onUpdate:modelValue":G[1]||(G[1]=pe=>s.value=pe),max:o.config.range,min:0,style:{position:"absolute","z-index":"-1"}},null,8,$7),[[oy,s.value]]),ae(bP,{params:{maxRating:o.config.range},modelValue:s.value,"onUpdate:modelValue":G[2]||(G[2]=pe=>s.value=pe)},{icon:me(()=>[ae(ft,{source:"rating",src:d()||"Star",size:14},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):r.value=="dropdown"?(U(),ue("div",G7,[ae(bo,Kt(K(_),{ref_key:"triggerRef",ref:x,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:me(({})=>[he("div",W7,[ae(ft,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:me(()=>[Ke((U(),ue("span",null,[st(yt(A.value||""),1)])),[[ve,{content:A.value}]])]),_:1},16),he("div",{ref_key:"popupRef",ref:T},[K(L)?(U(),$e(SP,{key:0,ref_key:"metricEditorDropdownRef",ref:h,config:o.config,modelValue:i.value,"onUpdate:modelValue":G[3]||(G[3]=pe=>i.value=pe),onChange:c,onCancel:u},null,8,["config","modelValue"])):qe("",!0)],512)])):(U(),ue("span",U7,"Formular")),Ke((U(),$e(ht,{ref_key:"confirmButtonRef",ref:C,onHandleClick:O},{default:me(()=>[ae(ft,{src:"Check"})]),_:1})),[[ve,"Update"]])],2)}}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_g3nkq_1","dropdown-trigger":"_dropdown-trigger_g3nkq_10"}}]]),j7=wt(ut({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=u=>{i("handleUpdate",{id:o.config.id.toString(),value:u})},r=()=>{console.log("MetricBulkItem: handleLoseFocus called"),a.value=!1,i("loseFocus")},a=$(!1);nt(a,u=>{u&&i("open")});const l=$(null);return t({hide:()=>{var u;a.value=!1,(u=l.value)==null||u.resetState()},show:()=>{var u;a.value=!0,(u=l.value)==null||u.focus()}}),(u,c)=>{const d=Ma("tooltip");return U(),ue("div",{class:j([u.$style["metric-item"],a.value?u.$style.open:""])},[he("div",{class:j(u.$style["metric-label"]),onClick:c[0]||(c[0]=Gt(h=>a.value=!a.value,["stop"]))},[Tt(u.$slots,"default",{open:a.value},()=>[Ke((U(),ue("span",{class:j(u.$style["metric-name"])},[st(yt(e.label),1)],2)),[[d,{content:e.label}]]),e.morpheme?(U(),ue("small",{key:0,class:j(u.$style["metric-morpheme"])}," ("+yt(e.morpheme)+") ",3)):qe("",!0)])],2),ae(T2,{mode:"out-in",name:"slide"},{default:me(()=>[a.value?(U(),$e(z7,{"read-only":!1,focus:a.value,onLoseFocus:r,ref_key:"metricEditorRef",ref:l,onUpdateMetric:s,key:`editor-${e.label}`,type:e.type,config:e.config,"attach-to":o.attachTo},null,8,["focus","type","config","attach-to"])):qe("",!0)]),_:1})],2)}}}),[["__cssModules",{$style:{"metric-item":"_metric-item_1lcgq_1","metric-label":"_metric-label_1lcgq_9",open:"_open_1lcgq_15","metric-editor":"_metric-editor_1lcgq_19","dropdown-trigger":"_dropdown-trigger_1lcgq_38","metric-name":"_metric-name_1lcgq_46"}}]]),K7=(e,t,n,o)=>{const{apiServices:i}=ao(n,o),s=$(!1);return{isUpdating:s,handleUpdate:async a=>{var u;console.log("Initiating bulk metric update for metric ID:",e.value.itemIds,a.id,"with value:",a.value);const l=a.value;s.value=!0;try{const c={itemIds:e.value.itemIds,metricId:a.id,workspaceId:String(e.value.workspaceId)};a.value==null?c.clear=1:c.value=l;const d=await((u=i.value)==null?void 0:u.bulkUpdateMetric(c));(d==null?void 0:d.message)=="Done"&&t(a),console.log("Bulk metric update response:",d)}catch(c){console.error("Error during bulk metric update:",c)}s.value=!1}}},q7={class:"metric-label"},Y7=["innerHTML"],Z7={key:0,class:"metric-morpheme"},X7=wt(ut({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{}},emits:["update"],setup(e,{emit:t}){const n=CP(),{metricList:o}=ri(n),i=z(()=>o.value?o.value.filter(x=>!x.formula).filter(x=>{var T;return((T=x.auth_permission)==null?void 0:T.permission)==2}).map(x=>({id:String(x.id),label:String(x.name),value:String(x.id),description:x.morpheme_value?`(${String(x.morpheme_value)})`:"",type:n.checkEditType(x),metricConfig:x})):[]),s=$(i.value),r=e,a=t,l=$([]),u=$(null),c=x=>{var k;console.log("Open item:",x);const T=i.value.findIndex(L=>L.id===x.id);u.value=T,d(T),(k=l.value[T])==null||k.show()},d=x=>{u.value=x,l.value.forEach((T,k)=>{k!==x&&T&&T.hide()})},h=$(""),f=$(null),{popupRef:p,triggerRef:m,hide:v,isVisible:w}=lo({appendTo:f.value||void 0}),E=()=>{h.value="",l.value.forEach(x=>{x==null||x.hide()}),u.value=null,v()},_=z(()=>r.selectedIds||[]),C=z(()=>({itemIds:_.value,workspaceId:String(r.workspaceId)})),{handleUpdate:b,isUpdating:R}=K7(C,x=>{a("update",x),E()},!1,r),F=()=>{u.value=null,jt(()=>{var x,T;(x=A.value)==null||x.focus(),(T=A.value)==null||T.reset()})},A=$(null);nt(()=>w.value,x=>{var T;x?(T=A.value)==null||T.focus():E()});const I=$(!1),O=x=>{I.value=!0,h.value=x,x?s.value=i.value.filter(T=>T.label.toLowerCase().includes(x.toLowerCase())):s.value=i.value,setTimeout(()=>{jt(()=>{I.value=!1})},300)};return(x,T)=>(U(),ue("div",{ref_key:"wrapperRef",ref:f},[ae(ht,{class:"action-button",variant:r.variant,ref_key:"triggerRef",ref:m,loading:K(R)},{default:me(()=>[ae(ft,{src:"SquareRootVariable",class:"icon"}),T[0]||(T[0]=st(" Metric ",-1))]),_:1},8,["variant","loading"]),he("div",{ref_key:"popupRef",ref:p,style:{display:"none","border-radius":"4px"}},[ae(ll,{loading:I.value,ref_key:"searchListRef",ref:A,style:{width:"320px"},options:s.value,"selected-id":void 0,onSearch:O,onSelect:c},{item:me(({item:k,index:L,getHighlightedLabel:Y,selectedIndex:ee})=>[ae(j7,{ref:Z=>l.value[L]=Z,label:k.label,type:k.type,morpheme:k.description||"",onOpen:Z=>d(L),attachTo:K(p),config:k.metricConfig,onHandleUpdate:K(b),onLoseFocus:F,class:j(["metric-update-item",{selected:u.value===L||ee===L}])},{default:me(({open:Z})=>[he("div",q7,[he("div",{class:"metric-title",innerHTML:Y(k.label)},null,8,Y7),Z?(U(),ue("div",Z7,yt(k.description),1)):qe("",!0)])]),_:2},1032,["label","type","morpheme","onOpen","attachTo","config","onHandleUpdate","class"])]),"extra-item":me(()=>[...T[1]||(T[1]=[he("div",{style:{width:"320px"}},null,-1)])]),"empty-list":me(()=>[...T[2]||(T[2]=[st("No options available.",-1)])]),_:1},8,["loading","options"])],512)],512))}}),[["__scopeId","data-v-97422330"]]),RP=wt(ut({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,i=n,{hide:s,triggerRef:r,popupRef:a,isVisible:l}=lo({placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=z(()=>l.value);nt(l,h=>{i(h?"open":"close")});const c=()=>{s()};t({closeDropdown:c,isOpen:u});const d=h=>{h.key==="Escape"&&a.value&&s()};return an(()=>{var f;const h=r.value instanceof HTMLElement?r.value:(f=r.value)==null?void 0:f.$el;h&&h.addEventListener("keydown",d)}),Yn(()=>{var f;const h=r.value instanceof HTMLElement?r.value:(f=r.value)==null?void 0:f.$el;h&&h.removeEventListener("keydown",d)}),(h,f)=>(U(),ue("div",{ref_key:"triggerRef",ref:r,class:j(h.$style["dropdown-wrapper"])},[Tt(h.$slots,"trigger",{open:K(l)},()=>[he("button",{class:j(h.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),he("div",{ref_key:"popupRef",ref:a,class:j(h.$style["dropdown-content"]),style:on({display:K(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Tt(h.$slots,"content",{closeDropdown:c,visible:K(l)},()=>[he("div",{class:j(h.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_1fn64_1","dropdown-content":"_dropdown-content_1fn64_5","dropdown-list":"_dropdown-list_1fn64_9"}}]]),_P=ut({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","error","cancel","start-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},i=e,s=n,r=$([]),a=$(!1),l=$(!1),u=$(null),c=$(o.INITIAL_PAGE),d=$(!0),h=$(0),f=$(""),p=z(()=>{var O;return(O=i.value)==null?void 0:O.id}),m=z(()=>!!(i.id||i.ids&&i.ids.length>0)),v=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),w=z(()=>{const O=new Set;return i.id&&O.add(String(i.id)),i.ids&&i.ids.forEach(x=>{x&&O.add(String(x))}),Array.from(O)}),E=Io("bulkUpdate",!1),{apiServices:_}=ao(!E,i),C=async(O=o.INITIAL_PAGE,x="",T=!1)=>{var k,L,Y,ee;if(!m.value){console.error("Missing required props",i);return}T?l.value=!0:a.value=!0,u.value=null;try{const Z={workspaceId:String(i.workspaceId),itemIds:w.value,page:O,perPage:o.PER_PAGE,name_like:x.trim()};if(((k=_.value)==null?void 0:k.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const B=await((L=_.value)==null?void 0:L.getAssignableStatus(Z));if(!(B!=null&&B.data)){T||(r.value=[]),d.value=!1;return}const V=B.data.map(v);r.value=T?[...r.value,...V]:V,h.value=((Y=B.meta)==null?void 0:Y.total)??B.data.length,d.value=!((ee=B.meta)!=null&&ee.on_last_page),c.value=O}catch(Z){console.error("Error fetching statuses:",Z),u.value="Failed to load statuses",T||(r.value=[]),d.value=!1,s("error",u.value)}finally{a.value=!1,l.value=!1}},b=Es(async O=>{f.value=O,c.value=o.INITIAL_PAGE,await C(o.INITIAL_PAGE,O,!1)},hr),R=async()=>{!d.value||l.value||await C(c.value+1,f.value,!0)},F=async O=>{var x,T,k;if(!m.value){console.error("Missing required props for updating status",i);return}try{s("start-update");const L=await _.value.updateItemStatus({workspaceId:String(i.workspaceId),itemIds:w.value,statusId:String(O.value)});if(!(L!=null&&L.message))throw s("error","API did not return success"),new Error("API did not return success");i.params&&((T=i.params)==null||T.node.setData({...(x=i.params)==null?void 0:x.node.data,status:{id:O.id,name:O.label,color:O.color}}),(k=i.params)==null||k.api.stopEditing()),s("updated",{workspaceId:String(i.workspaceId),itemIds:w.value,data:{id:O.id,name:O.label,color:O.color}})}catch(L){console.error("Error updating status:",L),u.value="Failed to update status",s("error",u.value)}},A=z(()=>r.value.map(O=>({...O})));nt([()=>i.id,()=>i.workspaceId,()=>i.ids],()=>{C()},{deep:!0,immediate:!0}),t({refresh:()=>C(o.INITIAL_PAGE,f.value,!1),loadMore:R});const I=$(null);return an(()=>{jt(()=>{var O;(O=I.value)==null||O.focus()})}),(O,x)=>{var T;return U(),$e(ll,Kt({ref_key:"popupRef",ref:I},i,{"selected-id":(T=i.value)==null?void 0:T.id,options:A.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:K(b),onSelect:F,onLoadMore:R,onCancel:x[0]||(x[0]=k=>s("cancel"))}),null,16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),J7=ut({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{}},emits:["updated"],setup(e,{emit:t}){const n=e,o=z(()=>{const p=so();return p==null?void 0:p.appContext.config.globalProperties.apiServices}),{popupRef:i,triggerRef:s,isVisible:r,hide:a}=lo(),l=t,u=$(!1),c=p=>{u.value=!1,l("updated",p),a()},d=z(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId})),h=$(null),f=p=>{p.key==="Escape"&&i.value&&a()};return an(()=>{var m;const p=h.value instanceof HTMLElement?h.value:(m=h.value)==null?void 0:m.$el;p&&p.addEventListener("keydown",f)}),Yn(()=>{var m;const p=h.value instanceof HTMLElement?h.value:(m=h.value)==null?void 0:m.$el;p&&p.removeEventListener("keydown",f)}),Va("bulkUpdate",!0),(p,m)=>(U(),ue("div",{ref_key:"mainRef",ref:h},[ae(ht,{ref_key:"triggerRef",ref:s,variant:e.variant,loading:u.value},{default:me(()=>[ae(ft,{src:"Square",class:"icon"}),m[2]||(m[2]=st(" Status ",-1))]),_:1},8,["variant","loading"]),he("div",{ref_key:"popupRef",ref:i},[K(r)?(U(),$e(_P,Kt({key:0},d.value,{onUpdated:c,onCancel:K(a),onStartUpdate:m[0]||(m[0]=v=>u.value=!0),onError:m[1]||(m[1]=v=>u.value=!1)}),null,16,["onCancel"])):qe("",!0)],512)],512))}}),mC=al("bulkUpdate",()=>{const e=vi({loaded:0,total:0}),t=c=>{e.total=c},n=c=>{e.loaded=c},o=vi({isBulkUpdating:!1});function i(c){o.isBulkUpdating=c}const s=$({}),r=c=>{s.value=c},a=(c,d)=>{s.value[c]=d},l=$(0);return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:s,setSelectionIds:r,setCheckedForId:a,setSelectionStatus:c=>{l.value=c},selectionStatus:l,rowCount:e,setTotalRowCount:t,setLoadedRowCount:n}}),Q7=wt(ut({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated"],setup(e,{emit:t}){const n=cn,o=e,i=t,s=mC(),{selectionStatus:r}=ri(s),a=z(()=>o.selectRowData.map(L=>L.id));Va("bulkUpdate",!0);const l=({itemIds:L,data:Y})=>{const ee=o.gridApi;L.forEach(Z=>{if(!ee){console.error("Grid API is undefined");return}const B=ee.getRowNode(Z);if(B){const V={...B.data,status:Y};B.setData(V)}})},u=z(()=>o.selectRowData),c=({itemIds:L,data:Y})=>{const ee=o.gridApi;if(!ee){console.error("Grid API is undefined");return}L.forEach(Z=>{const B=ee.getRowNode(Z);if(B){const V=B.data.dateRange||[null,null];"startDate"in Y&&Y.startDate!==void 0&&(V[0]=Y.startDate?new Date(Y.startDate):null),"dueDate"in Y&&Y.dueDate!==void 0&&(V[1]=Y.dueDate?new Date(Y.dueDate):null);const G={...B.data,dateRange:V};B.setData(G)}}),i("updated")},d=z(()=>o.selectRowData.map(L=>L.id)),h=L=>{const Y=o.gridApi,{id:ee,value:Z}=L;if(!Y){console.error("Grid API is undefined");return}d.value.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,[`metric_${ee}`]:Z};V.setData(G)}}),console.log("Metric updated:",L),i("updated")},f=["primary"],p=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],m=()=>{i("unselect")},v=uC(),{userPermissions:w}=ri(v),E=z(()=>w.value.includes(cC)),_=()=>{const L=o.selectRowData.map(ee=>ee.id).join(","),Y=ni({type:"review_multiple_scenes",config:{reviewDomain:Mn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:L}}).url;window.open(Y,"_blank")},C=L=>{const{assignees:Y,type:ee}=L,Z=o.gridApi;if(!Z){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(V=>{const G=Z.getRowNode(V.id);if(!G)return null;const ve=G.data.assignees||[];let pe=[];switch(ee){case"add":{const re=new Set(ve.map(J=>J.id)),oe=Y.filter(J=>!re.has(J.id));pe=[...ve,...oe];break}case"overwrite":{pe=Y;break}case"remove":{const re=new Set(Y.map(oe=>oe.id));pe=ve.filter(oe=>!re.has(oe.id));break}case"removeAll":{pe=[];break}}return{...G.data,assignees:pe}}).filter(V=>V!==null).forEach(V=>{const G=Z.getRowNode(V.id);G&&G.setData(V)})},{apiServices:b}=ao(!1,o),R=async()=>{var Z;const L=o.selectRowData.map(B=>B.id),Y=o.gridApi;if(!Y){console.error("Grid API is not available for bulk delete.");return}const ee=await((Z=b.value)==null?void 0:Z.bulkDeleteItems(String(o.workspaceId),L));(ee==null?void 0:ee.message)=="Done"&&(L.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,isDeleted:!0,disabled:!0};V.setData(G)}}),Y.deselectAll())},F=async()=>{var Z;const L=o.selectRowData.map(B=>B.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const ee=await((Z=b.value)==null?void 0:Z.bulkUnarchiveItems(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to unarchive items.");return}I(L,"isArchived",!1)},A=async()=>{var Z;const L=o.selectRowData.map(B=>B.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const ee=await((Z=b.value)==null?void 0:Z.bulkArchiveItems(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to archive items.");return}I(L,"isArchived",!0)},I=(L,Y,ee)=>{const Z=o.gridApi;if(!Z){console.error("Grid API is not available for bulk update.");return}const B=L.map(V=>{const G=Z.getRowNode(V);if(G){const ve={...G.data,[Y]:ee};G.setData(ve)}return G}).filter(V=>V!=null);Z.redrawRows({rowNodes:B})},O=async()=>{var Z;const L=o.selectRowData.map(B=>B.id),Y=o.gridApi;if(!Y){console.error("Grid API is not available for bulk thumbnail deletion.");return}const ee=await((Z=b.value)==null?void 0:Z.deleteThumbnail(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to delete thumbnails.");return}L.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,thumbnail:null};V.setData(G)}})},x=async()=>{var Z;const L=o.selectRowData.map(B=>B.id),Y=o.gridApi;if(!Y){console.error("Grid API is not available for bulk rendition deletion.");return}const ee=await((Z=b.value)==null?void 0:Z.deleteRendition(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to delete renditions.");return}L.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,rendition:null};V.setData(G)}})},T=$(!1),k=async L=>{switch(T.value=!0,L.id){case"unarchive":await F();break;case"delete":await R();break;case"archive":await A();break;case"delete-thumbnail":await O();break;case"delete-rendition":await x();break;default:console.error("Unknown action:",L.id),T.value=!1;break}jt(()=>{T.value=!1})};return(L,Y)=>Ke((U(),ue("div",{class:j(L.$style["bulk-update-action"])},[he("div",{class:j(L.$style["left-actions"])},[he("div",{class:j(L.$style["selection-track"])},[ae(ht,{variant:["icon","tertiary"],onClick:m},{default:me(()=>[ae(ft,{src:"XMarkSolid",source:"remote"})]),_:1}),K(r)==1?(U(),ue("span",{key:0,class:j(L.$style["selected-count"])},yt(e.selectRowData.length)+" selected ",3)):qe("",!0),K(r)==2?(U(),ue("span",{key:1,class:j(L.$style["selected-count"])}," All in "+yt(e.takeName),3)):qe("",!0),he("span",{class:j(L.$style.divider)},null,2)],2),ae(J7,{ids:a.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:f,onUpdated:l},null,8,["ids","workspace-id","entity-id"]),ae(C7,{onUpdate:C,ids:a.value,"workspace-id":e.workspaceId,variant:f,"entity-id":e.entityId},null,8,["ids","workspace-id","entity-id"]),ae(k7,{ids:a.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:f,"row-selected":u.value,onUpdated:c},null,8,["ids","workspace-id","entity-id","row-selected"]),ae(X7,{onUpdate:h,selectedIds:a.value,"workspace-id":e.workspaceId,variant:f,"entity-id":e.entityId},null,8,["selectedIds","workspace-id","entity-id"]),he("span",{class:j(L.$style.divider)},null,2),E.value?Ke((U(),$e(ht,{key:0,class:j(L.$style["action-button"]),variant:[...f,"icon"],onClick:_},{default:me(()=>[ae(ft,{src:"PenRuler",class:j(L.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant"])),[[K(n),{content:"Open in Review"}]]):qe("",!0),he("span",{class:j(L.$style.divider)},null,2),ae(RP,{placement:"top-end"},{trigger:me(({open:ee})=>[Ke((U(),$e(ht,{actived:ee,class:j(L.$style["action-button"]),variant:[...f,"icon"],loading:T.value},{default:me(()=>[ae(ft,{src:"EllipsisVertical",class:j(L.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["actived","class","variant","loading"])),[[K(n),{content:"More actions"}]])]),content:me(({visible:ee,closeDropdown:Z})=>[(U(),ue(Pt,null,Tn(p,B=>ae(ea,Kt({key:B.id,selected:!1},{ref_for:!0},B,{show:ee,onSelect:()=>{k(B),Z()}}),null,16,["show","onSelect"])),64))]),_:1})],2)],2)),[[ir,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_o4psi_1","left-actions":"_left-actions_o4psi_19","right-actions":"_right-actions_o4psi_20","selection-track":"_selection-track_o4psi_25","close-icon":"_close-icon_o4psi_30","selected-count":"_selected-count_o4psi_34",divider:"_divider_o4psi_37","more-button":"_more-button_o4psi_42",dropdown:"_dropdown_o4psi_46","dropdown-content":"_dropdown-content_o4psi_49",delete:"_delete_o4psi_72","icon-btn":"_icon-btn_o4psi_79","selected-list":"_selected-list_o4psi_83"}}]]),ta=wt(ut({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Xo,n=cn,o=e,i=z(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:s}=Co(i),r=z(()=>{var l,u,c;return!!((l=o.params)!=null&&l.api||(u=o.params)!=null&&u.node||(c=o.params)!=null&&c.context)}),a=z(()=>o.value===void 0);return(l,u)=>Ke((U(),$e(bo,df(Wf(K(s))),{default:me(()=>[he("span",{class:j(l.$style["item-table-label-renderer"])},yt(o.value||"-"),3)]),_:1},16)),[[K(t),{isLoading:a.value||!r.value}],[K(n),o.tooltip?o.tooltip:{content:void 0}]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),e9=["placeholder","maxlength"],t9={key:0,class:"wrapper-suffix"},n9=wt(ut({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Xo,i=cn,s=e,r=n,a=$(s.value),l=$(null),u=$(null),c=z(()=>{var b;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:((b=s.value)==null?void 0:b.length)===0,inputRef:l,wrapperRef:u,clickable:!0}}),{argsMain:d,isFocus:h}=Co(c),f=b=>{const R=document.createElement("div");return R.textContent=b,R.innerHTML},p=b=>{h.value=!1,C.value=a.value,r("update:value",a.value)},m=b=>{if(!h.value||!l.value)return;const R=f(l.value.value);r("update:value",R),r("enter",R),h.value=!1},v=b=>{var R;if(b.key==="ArrowLeft"||b.key==="ArrowRight"){b.stopPropagation();return}b.ctrlKey&&b.key=="a"||b.key=="A"?(b.stopPropagation(),(R=l.value)==null||R.select()):b.key==="Enter"?(b.preventDefault(),b.stopPropagation(),m()):b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),p())},w=()=>{a.value=s.value,h.value=!0,jt(()=>{var b;(b=l.value)==null||b.focus()})},E={focus:()=>{var b;h.value=!0,(b=l.value)==null||b.focus()}};an(()=>{const b=u.value.$el;b&&(b.__sceneNameEditor=E)}),Yn(()=>{const b=u.value;b&&delete b.__sceneNameEditor}),t({focus:()=>{w()}});const _=z(()=>s.value===void 0),C=$(s.value||"");return vP(u,b=>{h.value&&m()}),(b,R)=>Ke((U(),$e(K(bo),Kt(K(d),{ref_key:"wrapperRef",ref:u}),Wc({default:me(()=>[K(h)?qe("",!0):Tt(b.$slots,"default",{key:0},()=>[Ke((U(),ue("span",{class:j(b.$style["label-renderer"])},[st(yt(C.value),1)],2)),[[K(i),{content:C.value||void 0}]])]),Ke(he("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":R[0]||(R[0]=F=>C.value=F),class:j(b.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:v},null,42,e9),[[ir,K(h)],[oy,C.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:me(({hovered:F,focused:A})=>[F||A?(U(),ue("div",t9,[F&&!A?Ke((U(),$e(K(ht),{key:0,variant:["icon","secondary"],size:24,onClick:Gt(w,["prevent","stop"])},{default:me(()=>[ae(K(ft),{src:"Pen",source:"remote"})]),_:1})),[[K(i),"Edit"]]):A?Ke((U(),$e(K(ht),{key:1,variant:["icon","tertiary","danger"],size:24,onMousedown:Gt(p,["prevent"])},{default:me(()=>[ae(K(ft),{src:"XMarkSolid",source:"remote"})]),_:1})),[[K(i),"Cancel"]]):qe("",!0)])):qe("",!0)]),key:"0"}:void 0]),1040)),[[K(o),{isLoading:_.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),DP=wt(ut({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{emit:t}){const n=Mn.getInstance().getItem("ws.code"),o=Mn.getInstance().getItem("BASE_URL"),i=cn,s=Xo,r=e,a=t,l=$(r.value),u=$(r.value),c=$(null),d=$(null),h=Io("bulkUpdate",!1),{apiServices:f}=ao(!h,r),p=z(()=>{var x;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((x=l==null?void 0:l.value)==null?void 0:x.length)===0,inputRef:c,wrapperRef:d,clickable:!0}}),{isFocus:m}=Co(p),v=z(()=>{const x=n||r.workspaceId;return ni({type:"scene_hub",config:{baseDomain:o,ws_code:x,scene_id:String(r.id)}}).url}),w=z(()=>{var x,T,k;return((x=r.data)==null?void 0:x.isDeleted)==!0||((k=(T=r.data)==null?void 0:T.isProcessing)==null?void 0:k.length)>0}),E=z(()=>{var x;return(x=r.data)==null?void 0:x.isProcessing}),_=z(()=>{var x;return((x=r.data)==null?void 0:x.isArchived)==1}),C=z(()=>r.value===void 0),b=async x=>{var T,k,L,Y;l.value=x,m.value=!1;try{const ee=await((k=(T=f.value)==null?void 0:T.updateSceneName)==null?void 0:k.call(T,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:l.value})),Z=uF.get(tF)||"UTC";if(ee){const B=sF(ee,Z),V={...r.data,...B};(Y=(L=r.params)==null?void 0:L.node)==null||Y.setData(V),u.value=l.value,a("enter")}else l.value=u.value}catch(ee){console.error("Failed to update scene name:",ee),l.value=u.value}},R={focus:()=>{m.value=!0,setTimeout(()=>{var x;return(x=d.value)==null?void 0:x.focus()},0)}},F=()=>d.value?"$el"in d.value?d.value.$el:d.value:null;nt(()=>r.value,x=>{l.value=x,u.value=x}),an(()=>{const x=F();x&&(x.__sceneNameEditor=R)}),Yn(()=>{const x=d.value,T=x&&"$el"in x?x.$el:x;T&&delete T.__sceneNameEditor});const A=gP(),{openSceneHub:I}=A,O=x=>{try{if(x.ctrlKey||x.metaKey){window.open(v.value,"_blank");return}I(String(r.id))}catch{window.open(v.value,"_blank")}};return(x,T)=>Ke((U(),$e(n9,{"save-on-blur":!0,ref_key:"wrapperRef",ref:d,disabled:r.disabled,"read-only":r.readOnly||C.value,placeholder:r.placeholder,value:l.value,"onUpdate:value":T[0]||(T[0]=k=>l.value=k),id:`scene-name-${r.id}`,onEnter:b,"max-length":25},{default:me(()=>[Ke(he("div",{class:j(x.$style["scene-name-display"])},[Ke((U(),ue("a",{onClick:Gt(O,["prevent"]),target:"_blank",class:j(x.$style["scene-name-text"])},[st(yt(l.value),1)],2)),[[K(i),{content:l.value}]]),_.value?(U(),ue("div",{key:0,class:j([x.$style["icon-processing"],x.$style.archived])},[ae(ft,{src:"BoxArchive",color:"#959595"})],2)):qe("",!0),w.value?Ke((U(),ue("div",{key:1,class:j([x.$style["icon-processing"],x.$style.processing])},[ae(ft,{src:"AnimatedHourglass",color:"#DE851A"})],2)),[[K(i),E.value]]):qe("",!0)],2),[[ir,!K(m)]])]),_:1},8,["disabled","read-only","placeholder","value","id"])),[[K(s),{isLoading:C.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nlzfn_1","scene-name-display":"_scene-name-display_nlzfn_11","icon-processing":"_icon-processing_nlzfn_18",archived:"_archived_nlzfn_26",processing:"_processing_nlzfn_29","scene-name-text":"_scene-name-text_nlzfn_33"}}]]),o9=wt(ut({__name:"OptionList",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},options:{}},emits:["select"],setup(e,{emit:t}){const n=t;function o(i){n("select",i)}return(i,s)=>(U(),ue("div",{class:j(i.$style["dropdown-list"])},[(U(!0),ue(Pt,null,Tn(e.options,r=>(U(),$e(ea,Kt({key:r.value},{ref_for:!0},{...r},{"icon-name":r.icon,onClick:Gt(a=>o(r.value),["stop","prevent"])}),{label:me(()=>[st(yt(r.label),1)]),_:2},1040,["icon-name","onClick"]))),128)),e.options.length==0?(U(),ue("div",{key:0,class:j(i.$style["empty-list"])}," No options available. ",2)):qe("",!0)],2))}}),[["__cssModules",{$style:{"dropdown-list":"_dropdown-list_1d2i1_1","empty-list":"_empty-list_1d2i1_8"}}]]),vC=wt(ut({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const o=e,i=z(()=>typeof o.size=="number"?`${o.size}px`:{small:"24px",medium:"32px",large:"48px"}[o.size]??"32px"),s=z(()=>{let p=[];return typeof o.variant=="string"?p.push(o.variant):Array.isArray(o.variant)&&(p=[...o.variant]),[...p,"icon"]}),r=n,{hide:a,isVisible:l,show:u,triggerRef:c,popupRef:d,instance:h}=lo();function f(p){r("select",p),a()}return kf(()=>{h.value&&h.value.setProps({placement:o.placement})}),t({show:u,hide:a,popupRef:d}),(p,m)=>(U(),ue("div",{class:j(p.$style["button-dropdown-wrapper"]),style:on({"--button-size":i.value})},[he("div",{class:j(p.$style["button-group"])},[Tt(p.$slots,"prefix"),he("div",{ref_key:"triggerRef",ref:c,class:j(K(l)?p.$style.open:"")},[Tt(p.$slots,"triggerDropdown",{open:K(l)},()=>[o.readOnly?qe("",!0):(U(),$e(ht,{key:0,actived:K(l),class:j(p.$style["button-dropdown-trigger"]),variant:s.value,size:e.size,disabled:o.disabled},{default:me(()=>[Tt(p.$slots,"iconDropdown",{},()=>[ae(ft,{class:j(p.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["actived","class","variant","size","disabled"]))])],2)],2),he("div",{ref_key:"popupRef",ref:d,class:j(p.$style["button-dropdown-list"])},[ae(o9,{options:e.options,onSelect:f,style:{width:"max-content"}},null,8,["options"])],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_12xlv_1","button-group":"_button-group_12xlv_7","overflow-elipsis":"_overflow-elipsis_12xlv_26","button-dropdown-list":"_button-dropdown-list_12xlv_33",show:"_show_12xlv_36","button-dropdown-item":"_button-dropdown-item_12xlv_39","icon-dropdown":"_icon-dropdown_12xlv_43",open:"_open_12xlv_46"}}]]),i9=wt(ut({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=cn,n=Xo,o=Ry,i=e,{isEditing:s}=Wd(i),r=$(i.value),a=$(null),l=$(null),{apiServices:u}=ao(!0,i),c=$(!0),d=()=>{c.value=i.value===void 0};Af(()=>{d()}),an(()=>{d()}),nt(()=>i.value,b=>{d()});const h=z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:i.error,inputRef:a,wrapperRef:l,clickable:!(i.readOnly||c.value),active:s})),{argsMain:f,isHover:p}=Co(h),m=z(()=>{var b;return((b=r.value)==null?void 0:b.slice(0,i.maxVisible))||[]}),v=z(()=>{var b;return Math.max(0,(((b=r.value)==null?void 0:b.length)||0)-i.maxVisible)}),w=z(()=>{var b;return v.value<=0?"":((b=r.value)==null?void 0:b.slice(i.maxVisible).map(R=>R.name).join(", "))||""}),E=z(()=>m.value.map(b=>({id:b.id,name:b.name,initial:b.initial,avatarId:b.id,profile_image:b.profile_image,color:b.color,size:24,user:b}))),_=z(()=>({color:p.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"})),C=async b=>{var F;const R=i.workspaceId;return await((F=u.value)==null?void 0:F.getUserInformation(R,b))??void 0};return nt(()=>i.value,b=>{r.value=b},{immediate:!0,deep:!0}),(b,R)=>Ke((U(),$e(bo,Kt(K(f),{ref_key:"wrapperRef",ref:l}),{default:me(()=>{var F;return[he("div",{class:j(b.$style.assigneeGroupRenderer)},[((F=r.value)==null?void 0:F.length)===0?(U(),$e(ft,{key:0,src:"UserPlus",source:"remote",style:on(_.value)},null,8,["style"])):qe("",!0),(U(!0),ue(Pt,null,Tn(E.value,A=>Ke((U(),$e(fu,{key:A.id,readOnly:!0,class:j(b.$style["ib-assignee-avatar"]),name:A.name,initial:A.initial,id:`assignee-avatar-${A.avatarId}`,profile_image:A.profile_image,color:A.color,size:A.size},null,8,["class","name","initial","id","profile_image","color","size"])),[[K(o),{user:A.user,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:C}]])),128)),v.value>0?Ke((U(),ue("div",{key:1,class:j(b.$style["extra-avatars"])},[st(" +"+yt(v.value),1)],2)),[[K(t),w.value]]):qe("",!0)],2)]}),_:1},16)),[[K(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_1tgm9_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_1tgm9_7","ib-assignee-avatar":"_ib-assignee-avatar_1tgm9_17","assignee-wrapper":"_assignee-wrapper_1tgm9_21","extra-avatars":"_extra-avatars_1tgm9_28"}}]]),s9=wt(ut({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var b,R;const t=cn,n=Xo,o=Iw(),i=e,s=$(null),r=$(null),a=F=>{if(F){if(typeof F=="string")return F;if(F instanceof Date)return F.toISOString()}},l=z(()=>i.value===void 0),u=z(()=>{var F;return(F=i.data)==null?void 0:F.isStarted}),c=z(()=>{var F;return(F=i.data)==null?void 0:F.isCompleted}),d=z(()=>!!(i.value&&(i.value[0]||i.value[1]))),h=z(()=>d.value?i.disabled&&!i.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),f=z(()=>({disabled:i.disabled,error:!1,readOnly:i.readOnly,inputRef:s,wrapperRef:r,clickable:!0})),{argsMain:p}=Co(f),{startDate:m,endDate:v,startClasses:w,endClasses:E,fullStartDate:_,fullEndDate:C}=y5({start:a((b=i.value)==null?void 0:b[0]),end:a((R=i.value)==null?void 0:R[1]),isStarted:u.value,isEnded:c.value,timezone:i.timezone||o});return(F,A)=>Ke((U(),$e(bo,Kt(K(p),{ref_key:"wrapperRef",ref:r}),{default:me(()=>[l.value?qe("",!0):(U(),ue("div",{key:0,class:j(F.$style.dateRangeRenderer)},[d.value?qe("",!0):(U(),$e(ft,{key:0,src:"Calendar",class:j(F.$style.calendarIcon),color:h.value},null,8,["class","color"])),d.value?(U(),ue(Pt,{key:1},[Ke((U(),ue("span",{class:j([F.$style.dateLabelDisplay,...K(w).map(I=>F.$style[I])])},[st(yt(K(m)),1)],2)),[[K(t),K(_)]]),A[0]||(A[0]=he("span",null,"→",-1)),Ke((U(),ue("span",{class:j([F.$style.dateLabelDisplay,...K(E).map(I=>F.$style[I])])},[st(yt(K(v)),1)],2)),[[K(t),K(C)]])],64)):qe("",!0)],2))]),_:1},16)),[[K(n),{isLoading:l.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),r9=ut({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:Iw()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=$(null);an(()=>{jt(()=>{o.value&&o.value.focus()})});const i=e,s=n,r=v=>`${it.fromJSDate(v,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,a=async v=>{await m({startDate:v[0]?r(v[0]):null,dueDate:v[1]?r(v[1]):null})},l=async()=>{await m({startDate:null})},u=async()=>{await m({dueDate:null})},c=async v=>{await m({startDate:v?r(v):null})},d=async v=>{await m({dueDate:v?r(v):null})},h=async()=>{await m({startDate:null,dueDate:null})},f=Io("bulkUpdate",!1),{apiServices:p}=ao(!f,i),m=async v=>{var w,E,_,C,b;try{const R=(w=o.value)==null?void 0:w.getValues(),F=await((_=(E=p.value)==null?void 0:E.changeDate)==null?void 0:_.call(E,{workspaceId:i.workspaceId,itemIds:[i.id],startDate:v.startDate,dueDate:v.dueDate}));F!=null&&F.message&&((b=i.params)==null||b.node.setData({...(C=i.params)==null?void 0:C.node.data,dateRange:R==null?void 0:R.dateRange}))}catch(R){console.error("Failed to update scene name:",R)}};return t({focus:()=>{jt(()=>{var v;(v=o.value)==null||v.focus()})}}),(v,w)=>(U(),$e(gC,Kt(i,{onUpdate:a,"onUpdate:end":d,"onUpdate:start":c,onClearAll:h,onClearDue:u,onClearStart:l,onClosed:w[0]||(w[0]=E=>s("closed")),ref_key:"calendarRef",ref:o}),null,16))}}),a9=wt(ut({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=$(null),o=$(0);let i=null;an(()=>{n.value&&(i=new ResizeObserver(r=>{for(const a of r)o.value=a.contentRect.height}),i.observe(n.value))}),Gc(()=>{i&&n.value&&i.unobserve(n.value)});const s=z(()=>{const r=o.value;return r>120?r-42-36:0});return(r,a)=>(U(),ue("div",{class:j(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[he("div",{class:j(r.$style["item-header"])},[he("div",{class:j(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[he("h1",{class:j(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=st("Items",-1))])],2)])],2),he("div",{class:j(r.$style["item-header__spacer"])},null,2),he("div",{class:j(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:s.value}),he("div",{class:j(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),xP=wt(ut({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0}},emits:["actionExecuted"],setup(e,{emit:t}){const n=e,o=z(()=>(n==null?void 0:n.workspaceId)||""),i=z(()=>(n==null?void 0:n.entityId)||""),s=m=>{const v=`scene-name-${n.id}`,w=document.getElementById(v);w.__sceneNameEditor&&w.__sceneNameEditor.focus()},{apiServices:r}=ao(!0,n),a=z(()=>{var m;return{ws_code:o.value,entity_id:i.value,scene_id:n.id,axiosService:r,optionBlock:n.optionBlock,permissions:(m=n.data)==null?void 0:m.permissions}}),l=m=>{var w,E,_,C,b,R;let v=(E=(w=n.params)==null?void 0:w.api)==null?void 0:E.getRowNode(String(n.id));if(v){const F={...v.data,isDeleted:m==="deleted",isArchived:m==="archived"?!0:v.data.isArchived,disabled:!0};(C=(_=n.params)==null?void 0:_.api)==null||C.redrawRows({rowNodes:[v]}),v.setData(F),(R=(b=n.params)==null?void 0:b.api)==null||R.redrawRows({rowNodes:[v]})}},{options:u}=e7(a,l,s),c=t,d=m=>{var v,w;m.id!=="copy-link"&&((w=(v=n==null?void 0:n.params)==null?void 0:v.api)==null||w.stopEditing()),c("actionExecuted",m)},h=m=>{var v,w,E,_;return m=="archive"?!((w=(v=n.params)==null?void 0:v.data)!=null&&w.isArchived):m==="unarchive"?(_=(E=n.params)==null?void 0:E.data)==null?void 0:_.isArchived:!0},f=m=>m.map(v=>({...v,options:v.options.filter(w=>!w.hide)})),p=z(()=>f(u.value));return(m,v)=>(U(),ue("div",{class:j([m.$style["more-option-section"],{[m.$style.submenu]:e.isSubmenu}])},[(U(!0),ue(Pt,null,Tn(p.value,w=>(U(),ue("div",{key:w.id,style:on({"--g-number":Math.min(w.options.filter(E=>!E.hide&&h(E.id)).length,4),"--g-size":w.type=="column"?"40px":"auto"}),class:j([m.$style["option-block"],m.$style[w.type]])},[(U(!0),ue(Pt,null,Tn(w.options.filter(E=>!E.hide&&h(E.id)),E=>(U(),ue("div",{key:E.id,class:j(m.$style["option-item"])},[!E.hide&&h(E.id)?(U(),$e(u9,{key:0,layer:n.layer,"scene-id":String(n.id),option:E,type:w.type,onActionExecuted:d},null,8,["layer","scene-id","option","type"])):qe("",!0)],2))),128))],6))),128))],2))}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1xceh_1","option-block":"_option-block_1xceh_8","option-item":"_option-item_1xceh_18",row:"_row_1xceh_22",column:"_column_1xceh_28",block:"_block_1xceh_32"}}]]),l9={key:0},u9=wt(ut({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{}},emits:["actionExecuted"],setup(e,{emit:t}){const n=cn,o=e,i=$(!1),s=$(!1),r=(C,b)=>{if(!b){h();return}const R=b.target;R.closest(".tippy-content")||R.closest(".tippy-box")||R.closest("[data-tippy-root]")||R.closest(".option-item")||h()},a=$(null),{triggerRef:l,popupRef:u,show:c,isVisible:d,hide:h}=lo({interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:r,appendTo:a.value||void 0}),f=t,p=async C=>{var b,R;if(!s.value){s.value=!0;try{await((R=(b=o.option).action)==null?void 0:R.call(b,C)),f("actionExecuted",o.option)}catch(F){console.error("Action execution failed:",F)}finally{s.value=!1,i.value=!1}}},m=async C=>{var b,R;if(C.preventDefault(),C.stopPropagation(),!s.value){if(o.option.isDanger){i.value=!i.value;return}if(!o.option.subMenu){s.value=!0;try{await((R=(b=o.option).action)==null?void 0:R.call(b,C)),f("actionExecuted",o.option)}catch(F){console.error("Action execution failed:",F)}finally{s.value=!1}return}jt(()=>{d.value?h():c()})}},v=C=>{f("actionExecuted",C),h()},w=C=>{C.key==="Escape"?h():(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),m(C))},E=C=>({row:"small",column:"large",block:"small"})[C]||"large",_=C=>{const b=o.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...b],column:["menu-item",...b],block:["secondary",...b]}[C]||[]};return(C,b)=>{var R;return Ke((U(),ue("div",{ref_key:"wrapperRef",ref:a,class:j(C.$style["option-item-wrapper"]),style:{width:"100%"}},[ae(ht,{ref_key:"triggerRef",ref:l,class:j(C.$style["option-item"]),disabled:e.option.disabled||s.value,actived:K(d)||i.value,size:E(e.type),variant:_(e.type),tabindex:"0",onClick:Gt(m,["stop","prevent"]),onKeydown:w},{prefix:me(()=>[e.option.icon?Ke((U(),$e(ft,{key:0,src:e.option.icon,source:"remote"},null,8,["src"])),[[K(n),{content:e.option.label,delay:[500,0],contentClass:["extra-padding"]}]]):qe("",!0)]),suffix:me(()=>[e.option.subMenu?(U(),$e(ft,{key:0,src:"Play",source:"remote"})):qe("",!0),e.option.isDanger&&i.value?(U(),ue("div",{key:1,class:j(C.$style["confirm-action"])},[Ke((U(),$e(ht,{variant:["tertiary","icon","danger"],size:"small",onClick:b[0]||(b[0]=Gt(F=>i.value=!1,["stop","prevent"]))},{default:me(()=>[ae(ft,{src:"XMarkSolid",source:"remote"})]),_:1})),[[K(n),{content:"Cancel ",delay:[500,0],contentClass:["extra-padding"]}]]),Ke((U(),$e(ht,{variant:["danger","primary","icon"],size:"small",onClick:Gt(p,["stop","prevent"])},{default:me(()=>[ae(ft,{src:"Check",source:"remote"})]),_:1})),[[K(n),{delay:[500,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):qe("",!0)]),default:me(()=>[e.option.label?(U(),ue("span",l9,yt(e.option.label),1)):qe("",!0)]),_:1},8,["class","disabled","actived","size","variant"]),e.option.subMenu?(U(),ue("div",{key:0,ref_key:"popupRef",ref:u,class:j(C.$style["submenu-container"])},[ae(xP,{layer:o.layer+1,ref:"submenuRef","option-block":[((R=e.option)==null?void 0:R.subMenu)||[]],"is-submenu":!1,onActionExecuted:v},null,8,["layer","option-block"])],2)):qe("",!0)],2)),[[K(n),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_82ug7_1","icon-wrapper":"_icon-wrapper_82ug7_11","confirm-action":"_confirm-action_82ug7_19"}}]]);var Vu=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(Vu||{});const FP=(e,t)=>{const n=$(Number(e.value.value)),o=z(()=>e.value.metricConfig),i=z(()=>{var p,m,v,w;const u=t.value,c=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=o.value.format_type==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||c&&((m=(p=o.value)==null?void 0:p.metric_type)==null?void 0:m.code)==="formula",isEmpty:c,isError:d,hasPrefix:!c&&!d&&o.value.morpheme_type==="prefix",hasSuffix:!c&&!d&&o.value.morpheme_type==="suffix",isDropdown:o.value.format_type==="dropdown",isFormula:((w=(v=o.value)==null?void 0:v.metric_type)==null?void 0:w.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:u&&!c&&!f}}),s=14,r=z(()=>({maxRating:o.value.range||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:s})),a=z(()=>{var c;const u=o.value;return!!(((c=u.auth_permission)==null?void 0:c.permission)!==2||u.formula)});return{componentState:i,metricConfig:o,ICON_SIZE:s,ratingParams:r,standardNameforIcon:()=>(o.value.format_symbol||"").split(/[\s-_]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("").replace(/Outline|Solid/g,""),internalValue:n,isMetricReadonly:a}},TP=wt(ut({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Xo,o=cn,i=e,s=cE(!1),r=$(null),a=$(null),{isEditing:l}=Wd(i),u=z(()=>{var T,k,L;const x=(k=(T=i.params)==null?void 0:T.colDef)==null?void 0:k.context;return!!(((L=x.auth_permission)==null?void 0:L.permission)!==2||i.disabled||x.formula)}),c=z(()=>{var x,T;return{value:i.value,metricConfig:(T=(x=i.params)==null?void 0:x.colDef)==null?void 0:T.context,error:i.error,hovered:s.value,readOnly:u.value,disabled:i.readOnly,active:l}}),{componentState:d,metricConfig:h,internalValue:f}=FP(c,s),p=z(()=>{if(d.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(d.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(d.value.isEmpty)return;const x=C.value,T=h.value.morpheme_type;return T==="prefix"?`${h.value.morpheme_value||""} ${x}`.trim():T==="suffix"?`${x} ${h.value.morpheme_value||""}`.trim():x}),m=z(()=>{const{format_type:x,format_value:T}=h.value;if(x==="dropdown"&&typeof T=="string"&&T.startsWith("["))try{return JSON.parse(T)}catch{return[]}return[]}),v=z(()=>({disabled:i.disabled,error:d.value.isError,inputRef:r,wrapperRef:a,clickable:!0,readOnly:u.value||i.readOnly,isEmpty:d.value.isEmpty})),{argsMain:w,isHover:E}=Co(v),_=(x,T,k="en-US")=>new Intl.NumberFormat(k,{minimumFractionDigits:T,maximumFractionDigits:T}).format(x),C=z(()=>{if(d.value.isEmpty)return"";if(d.value.pendingCalculation)return"pending";const x=i.value,{format_type:T,format_value:k,mapping:L}=h.value;if(L&&typeof L=="object"&&!Array.isArray(L)){const Y=L[`!${x}`];if(Y)return Y}if(T==="dropdown"){const Y=m.value.find(ee=>String(ee.name)===String(x));if(Y)return Y.name}if(typeof x=="string"){const Y=Number(x);return Number.isNaN(Y)?x:x.replace(/[.-]/g,"").length>16?b(x,k):b(Y,k)}return typeof x=="number"?b(x,k):String(x)}),b=(x,T)=>{const k=Number.parseInt(String(T)||"2",10),L=Number.isFinite(k)&&k>=0?k:2;try{if(typeof x=="string"){const Y=x.split("."),ee=Y[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),Z=Y[1]?Y[1].substring(0,L).padEnd(L,"0"):"0".repeat(L);return L>0?`${ee}.${Z}`:ee}return _(x,L)}catch(Y){return console.error("Error formatting metric value:",Y,{num:x,decimals:L}),String(x)}},{copyToClipboard:R,tooltip:F}=kw(C.value);nt(()=>i.value,x=>{const T=Number(x);Number.isFinite(T)&&T!==f.value?f.value=T:x==null&&f.value!==0&&(f.value=0)},{immediate:!0});const I=()=>{s.value=!0},O=()=>{s.value=!1};return(x,T)=>Ke((U(),$e(bo,Kt(K(w),{onMouseenter:I,style:{"--icon-size":"24px"},onMouseleave:O,ref_key:"wrapperRef",ref:a,actived:K(l)}),{suffix:me(()=>[i.disabled?qe("",!0):(U(),ue("div",{key:0,class:j([x.$style.suffix,"wrapper-suffix"])},[s.value&&!K(d).isEmpty&&!K(d).isError?Ke((U(),$e(ht,{key:0,variant:["icon","secondary"],size:24,onClick:Gt(K(R),["prevent","stop"])},{default:me(()=>[ae(ft,{src:"Copy",source:"remote",size:12})]),_:1},8,["onClick"])),[[K(o),{content:K(F),hideOnClick:!1,contentClass:"extra-padding"}]]):qe("",!0)],2))]),default:me(()=>[he("div",{class:j(x.$style["metric-wrapper"])},[he("div",{class:j([x.$style["metric-content"],i.disabled?x.$style.disabled:""])},[!K(d).isError&&K(d).isEmpty?(U(),ue(Pt,{key:0},[K(d).pendingCalculation?Ke((U(),ue("span",{key:0,class:j(x.$style["metric-empty"])},[...T[0]||(T[0]=[st(" - ",-1)])],2)),[[K(o),"Can’t calculate yet. Complete required fields."]]):K(d).isEmpty?(U(),ue("span",{key:1,class:j(x.$style["metric-empty"])}," - ",2)):qe("",!0)],64)):qe("",!0),K(d).isError?Ke((U(),ue("div",{key:1,class:j(x.$style["metric-error"])},[...T[1]||(T[1]=[st(" Error ",-1)])],2)),[[K(o),"Something went wrong. Review formula, inputs and retry."]]):qe("",!0),!K(d).isEmpty&&!K(d).isError?Ke((U(),ue("span",{key:2,class:j([x.$style["metric-value"],K(E)?x.$style.hovered:"",{[x.$style.disabled]:i.disabled}])},[st(yt(C.value),1)],2)),[[K(o),{content:p.value,bypassOverflowCheck:!!K(h).morpheme_value||K(d).isEmpty}]]):qe("",!0)],2)],2)]),_:1},16,["actived"])),[[K(n),{isLoading:K(d).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),c9={key:0,style:{color:"#6b6b6b"}},d9=wt(ut({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=cn,o={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},i={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},s={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default"},u=z(()=>{var O,x;if(a.headerType)return a.headerType;if(((x=(O=a.params)==null?void 0:O.column)==null?void 0:x.getColId()).includes("metric"))return"default";const I=a.headerType??a.params.column.getColId();return l[I]||"default"}),c=z(()=>{var A,I;return((I=(A=a.params)==null?void 0:A.column.getColDef().context)==null?void 0:I.morpheme_value)||void 0}),d=z(()=>{var A;return(A=a.params)==null?void 0:A.displayName}),h=z(()=>{let A=[];switch(u.value){case"dateRange":A=Object.values(o).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break;case"date":A=Object.values(i).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break;case"number":A=Object.values(s).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break;default:A=Object.values(r).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break}return p.value!=="none"&&A.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:b.value=="none"}),A}),f=z(()=>String(p.value).endsWith("asc")?"SortUp":String(p.value).endsWith("desc")?"SortDown":"Sort"),p=$(a.modelValue??"none"),m=A=>{_("update:modelValue",A),_("sort-changed",A)},v=A=>{p.value=A},w=Es(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let A;p.value==="none"?A="asc":p.value==="asc"?A="desc":A="none",p.value=A}else{const A=[o.START_ASC.value,o.START_DESC.value,o.DUE_ASC.value,o.DUE_DESC.value,"none"],O=(A.indexOf(p.value)+1)%A.length;p.value=A[O]}},hr),E=z(()=>{if(p.value==="none")return"No sorting applied";const A=h.value.find(I=>I.value===p.value);return(A==null?void 0:A.label)||""}),_=t,C=z(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(p.value!=="none")return"var(--primary-color-hover)"});nt(()=>a.modelValue,A=>{A!=p.value&&(p.value=A)}),nt(p,A=>{A!==a.modelValue&&m(A)});const b=$(p.value);nt(()=>p.value,A=>{b.value=A});const R=A=>{var T,k;if(a.readOnly||a.disabled)return;let I=0;A.key==="ArrowDown"?I=1:A.key==="ArrowUp"&&(I=-1);const O=h.value.findIndex(L=>L.value===b.value),x=h.value.length;if(A.key==="Enter"||A.key===" ")A.preventDefault(),p.value=b.value,(T=F.value)==null||T.hide();else if(I!==0){A.preventDefault();let L=(O+I+x)%x;b.value=h.value[L].value}else A.key==="Escape"&&((k=F.value)==null||k.hide())},F=$(null);return an(()=>{var A,I;(I=(A=F.value)==null?void 0:A.$el)==null||I.addEventListener("keydown",R)}),Gc(()=>{var A,I;(I=(A=F.value)==null?void 0:A.$el)==null||I.removeEventListener("keydown",R)}),(A,I)=>(U(),$e(vC,{ref_key:"dropdownRef",ref:F,options:h.value,label:d.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:K(w),onSelect:I[0]||(I[0]=O=>v(O))},{prefix:me(()=>[ae(ht,{variant:["text"],onClick:K(w),size:"small"},{default:me(()=>[Ke((U(),ue("b",null,[st(yt(d.value),1)])),[[K(n),{content:d.value}]]),c.value?(U(),ue("small",c9," ("+yt(c.value)+") ",1)):qe("",!0)]),_:1},8,["onClick"])]),iconDropdown:me(()=>[Ke(ae(ft,{src:f.value,source:"remote",color:C.value},null,8,["src","color"]),[[K(n),E.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{iconSorting:"_iconSorting_18bqx_1","button-group":"_button-group_18bqx_7","ab-table-button":"_ab-table-button_18bqx_18","button-main":"_button-main_18bqx_24","button-dropdown-trigger":"_button-dropdown-trigger_18bqx_29",headerSorting:"_headerSorting_18bqx_39"}}]]),h9=["disabled","readonly","checked","indeterminate"],PP=wt(ut({__name:"Checkbox",props:{modelValue:{type:[Number,Boolean]},disabled:{type:Boolean},readOnly:{type:Boolean},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=cn,o=e,i=t,s=z(()=>o.allowIndeterminate?[0,1,2]:[0,2]),r=z(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(l.value){case 0:return o.tooltipText.unchecked;case 1:return o.tooltipText.indeterminate;case 2:return o.tooltipText.checked;default:return""}}),a=()=>{if(c.value)return;const h=(s.value.indexOf(l.value)+1)%s.value.length;l.value=s.value[h]},l=$(typeof o.modelValue=="boolean"?o.modelValue?2:0:o.modelValue),u=z(()=>({checked:l.value===2,indeterminate:l.value===1,none:l.value===0})),c=z(()=>o.disabled||o.readOnly);return nt(()=>l.value,d=>{i("update:modelValue",d===2)}),(d,h)=>Ke((U(),ue("input",{disabled:o.disabled,key:l.value,readonly:o.readOnly,type:"checkbox",class:j([d.$style["input-checkbox"],d.$style[o.size||"medium"]]),checked:u.value.checked,indeterminate:u.value.indeterminate,onChange:a,"aria-label":"Select All Items"},null,42,h9)),[[K(n),{content:r.value,hideOnClick:!1,contentClass:"extra-padding"}]])}}),[["__cssModules",{$style:{small:"_small_p7d2l_68",large:"_large_p7d2l_72",medium:"_medium_p7d2l_76"}}]]),f9=wt(ut({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=cn,o=mC(),{setSelectionStatus:i}=o,{rowCount:s}=ri(o),r=$(0);nt(r,E=>{i(r.value)},{immediate:!0});const a=z(()=>r.value!==0),l=z(()=>({checked:r.value===2,indeterminate:r.value===1,UNCHECK:r.value===0})),u=z(()=>({0:"Click to select check visible items",1:"Click to select All",2:"Click to clear selection"})[r.value]),c=z(()=>{const E=[{label:"All visible",value:"INDETERMINATE",type:"text",clickable:!0,selected:r.value===1,id:"indeterminate"},{label:"All",value:"CHECKED",type:"text",clickable:!0,selected:r.value===2,id:"checked"}];return a.value&&E.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,selected:r.value===0,id:"uncheck"}),E}),d=E=>({selected:E.getSelectedRows().length,total:s.value.total,loaded:s.value.loaded}),h=({api:E,state:_})=>{r.value=_,_===0?E==null||E.deselectAll():E==null||E.forEachNode(C=>C.setSelected(!0))},f=()=>{var C;const E=(C=t.params)==null?void 0:C.api;E||console.error("[HeaderCheckbox] There is no API available"),h({api:E,state:{0:1,1:2,2:0}[r.value]})},p=E=>{var b;const _=(b=t.params)==null?void 0:b.api;_||console.error("no api"),h({api:_,state:{INDETERMINATE:1,CHECKED:2,UNCHECK:0}[E]})},m=Es(E=>{const{selected:_,total:C}=d(E);_===0?r.value=0:_===C?r.value=2:r.value=1},300);let v=[];an(()=>{var b;const E=(b=t.params)==null?void 0:b.api;if(!E)return;const _=R=>m(R.api),C=()=>m(E);E.addEventListener("selectionChanged",_),E.addEventListener("rowDataUpdated",C),E.addEventListener("modelUpdated",C),v=[()=>E.removeEventListener("selectionChanged",_),()=>E.removeEventListener("rowDataUpdated",C),()=>E.removeEventListener("modelUpdated",C)]}),Yn(()=>{v.forEach(E=>E())});const w=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(E,_)=>(U(),$e(vC,{options:c.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:p},{prefix:me(()=>[Ke((U(),$e(PP,{id:w,disabled:t.disabled,key:r.value,readonly:t.readOnly,type:"checkbox",checked:l.value.checked,indeterminate:l.value.indeterminate,modelValue:r.value,"onUpdate:modelValue":_[0]||(_[0]=C=>r.value=C),onChange:f,"aria-label":"Select CHECKED Items",class:j(E.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","class"])),[[K(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_1efbt_1","button-group":"_button-group_1efbt_46","button-main":"_button-main_1efbt_46",headerCheckbox:"_headerCheckbox_1efbt_50"}}]]),p9={key:1},g9=wt(ut({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Xo,n=cn,o=e,{isEditing:i}=Wd(o),s=$(null),r=$(null),a=z(()=>o.value),l=z(()=>a.value===void 0),u=z(()=>{var f;return((f=a.value)==null?void 0:f.name)||"No status"}),c=z(()=>{var p;const f=(p=a.value)==null?void 0:p.color;return{backgroundColor:Ay(f)?f:"#fff",border:pp(f,"white")?"1px solid #ccc":"1px solid #fff"}}),d=z(()=>{var f;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:t6((f=a.value)==null?void 0:f.label),inputRef:s,wrapperRef:r,clickable:!o.disabled&&!o.readOnly,active:i}}),{argsMain:h}=Co(d);return(f,p)=>Ke((U(),$e(K(bo),Kt(K(h),{ref_key:"wrapperRef",ref:r}),{default:me(()=>[l.value?qe("",!0):(U(),ue("div",{key:0,class:j(f.$style["status-renderer"])},[a.value?(U(),ue(Pt,{key:0},[he("div",{class:j(f.$style["status-renderer__color-code"]),style:on(c.value)},null,6),Ke((U(),ue("div",{class:j(f.$style["status-renderer__status-name"])},[st(yt(u.value),1)],2)),[[K(n),{content:u.value}]])],64)):l.value?qe("",!0):(U(),ue("div",p9,"No status"))],2))]),_:1},16)),[[K(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_ui0ga_1","status-renderer__color-code":"_status-renderer__color-code_ui0ga_10","status-renderer__status-name":"_status-renderer__status-name_ui0ga_20"}}]]),IP=wt(ut({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,{popupRef:i,show:s,hide:r,isVisible:a}=R5({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(c){return document.body}}),l=c=>{o.closeOnEscape&&c.key==="Escape"&&a.value&&r()};an(()=>{document.addEventListener("keydown",l)}),Yn(()=>{document.removeEventListener("keydown",l)}),t({show:s,hide:r,isVisible:a});const u=n;return nt(()=>a.value,c=>{u(c?"shown":"hidden")}),(c,d)=>{const h=Ma("tooltip");return U(),ue("div",{ref_key:"popupRef",ref:i,class:j(c.$style.popupContainer)},[he("div",{class:j(c.$style.popupWrapper)},[he("div",{class:j(c.$style.header)},[he("span",{class:j(c.$style["header-title"])},yt(e.popupName),3),Ke((U(),$e(ht,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:K(r),"aria-label":"Close popup"},{default:me(()=>[ae(ft,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),he("div",{class:j(c.$style.body)},[Tt(c.$slots,"default")],2),he("div",{class:j(c.$style.footer)},[Tt(c.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1cwaa_1",popupWrapper:"_popupWrapper_1cwaa_5",popupFadeIn:"_popupFadeIn_1cwaa_1",header:"_header_1cwaa_19","header-title":"_header-title_1cwaa_28",body:"_body_1cwaa_38",footer:"_footer_1cwaa_43"}}]]),m9={list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch data. Please try again."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},createNewScene:{error:"Creation failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{success:"Archive successful.",error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},getStatuses:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."}},zd=al("toast",()=>{const e=$([]),t=(i,s)=>{const r=m9[i];if(r){const a=r[s];if(a){n({id:i,type:s,message:a});return}}else n({id:i,type:s,message:i})},n=(i,s=5e3)=>{const r={...i,id:i.id??Date.now()+Math.random()};e.value.push(r),setTimeout(()=>{o(r.id)},s)};function o(i){e.value=e.value.filter(s=>s.id!==i)}return{notifications:e,addNotification:n,removeNotification:o,showMessage:t}}),v9=["innerHTML"],y9=wt(ut({__name:"Snackbar",setup(e){const t=cB,n=zd(),{removeNotification:o}=n,{notifications:i}=ri(n),s=u=>u.trim().startsWith("<svg"),r=$("Copy to clipboard"),a=()=>{setTimeout(()=>{r.value="Copy to clipboard"},1e3)},l=u=>{navigator.clipboard.writeText(u).then(()=>{r.value="Copied!",a()},()=>{r.value="Copy failed",a()})};return(u,c)=>{const d=Ma("tooltip");return U(),$e(K2,{name:"list",tag:"div",class:j(u.$style["notification-wrapper"])},{default:me(()=>[(U(!0),ue(Pt,null,Tn(K(i),h=>{var f;return Ke((U(),ue("div",{key:h.id,class:j([u.$style["notification-item"],u.$style[`notification--${h.type||"info"}`],!(h!=null&&h.actions)||((f=h==null?void 0:h.actions)==null?void 0:f.length)==0?u.$style["snackbar-type"]:""])},[he("p",{class:j(u.$style.snackbar__message)},[h.icon&&!s(h.icon)?(U(),$e(ft,{key:0,src:h.icon,source:"remote"},null,8,["src"])):qe("",!0),h.icon&&s(h.icon)?(U(),ue("i",{key:1,class:j(u.$style["icon-draw"]),innerHTML:h.icon},null,10,v9)):qe("",!0),Ke((U(),ue("span",{class:j(u.$style["error-message"])},[st(yt(h.message),1)],2)),[[d,{content:h.message}]])],2),h.actions?(U(),ue("div",{key:0,class:j(u.$style["actions-notification"])},[(U(!0),ue(Pt,null,Tn(h.actions,p=>(U(),$e(ht,Kt({key:p.label},{ref_for:!0},p,{onClick:p.action}),{prefix:me(()=>[p.btnIcon?(U(),$e(ft,{key:0,src:p.btnIcon,source:"remote",color:"white"},null,8,["src"])):qe("",!0)]),_:2},1040,["onClick"]))),128))],2)):qe("",!0),h.type=="error"?Ke((U(),$e(ht,{key:1,variant:"tertiary",onClick:p=>l(h.message)},{prefix:me(()=>[ae(ft,{src:"Copy",source:"remote",color:"white"})]),_:1},8,["onClick"])),[[d,r.value]]):qe("",!0),ae(ht,{variant:"tertiary",onClick:p=>K(o)(h.id),class:j(u.$style["close-btn"]),size:18},{default:me(()=>[ae(ft,{src:"Xmark",color:"var(--icon-color)"})]),_:1},8,["onClick","class"])],2)),[[K(t)]])}),128))]),_:1},8,["class"])}}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1tunr_1","notification-item":"_notification-item_1tunr_16","notification--success":"_notification--success_1tunr_30","notification--error":"_notification--error_1tunr_33","close-btn":"_close-btn_1tunr_37","notification--info":"_notification--info_1tunr_40","notification--warning":"_notification--warning_1tunr_47","notification--interactive":"_notification--interactive_1tunr_54","snackbar-type":"_snackbar-type_1tunr_60",snackbar__message:"_snackbar__message_1tunr_68","error-message":"_error-message_1tunr_80","actions-notification":"_actions-notification_1tunr_89"}}]]);/*!
87
+ This will fail in production.`);r=il,r._s.has(e)||(i?lC(e,t,o,r):fP(e,o,r),H.env.NODE_ENV!=="production"&&(s._pinia=r));const u=r._s.get(e);if(H.env.NODE_ENV!=="production"&&a){const c="__hot:"+e,d=i?lC(c,t,o,r,!0):fP(c,Pi({},o),r,!0);a._hotUpdate(d),delete r.state.value[c],r._s.delete(c)}if(H.env.NODE_ENV!=="production"&&fr){const c=so();if(c&&c.proxy&&!a){const d=c.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=u}}return u}return s.$id=e,s}function ri(e){const t=Ft(e),n={};for(const o in t){const i=t[o];i.effect?n[o]=z({get:()=>e[o],set(s){e[o]=s}}):(rn(i)||yi(i))&&(n[o]=Js(e,o))}return n}const uC=al("permissionStore",()=>{const e=$([]),t=$(),n=$({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:r=>{e.value=r},setEntityPermissions:r=>{t.value=r},setItemPermission:(r,a)=>{n.value[r]=a}}}),Zj="woohoo_getWoohooUserInterface_read",cC="media_getReviewUserInterface_read",Xj="update_getUpdateUserInterface_read",Jj=Mn.getInstance().getItem("BASE_URL"),Qj=Mn.getInstance().getItem("BASE_REVIEW_URL"),e7=(e,t,n)=>{const o=uC(),{userPermissions:i}=ri(o),s=z(()=>{const{ws_code:L,entity_id:Y,scene_id:ee}=e.value;return{baseDomain:Jj||"",ws_code:L||"",entity_id:Y||"",scene_id:ee||"",reviewDomain:Qj||"",take_id:Y||"",woohoo_id:Y||"",parent_id:Y||""}}),r=z(()=>{var Y;const L=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:i.value.includes(cC),canCopyLink:!0,canRename:(L==null?void 0:L.has_edit_permission)??!1,canOpenTakeInReview:i.value.includes(cC),canOpenTakeInUpdate:i.value.includes(Xj),canOpenTakeInWoohoo:i.value.includes(Zj),canDeleteRendition:((Y=L==null?void 0:L.media)==null?void 0:Y.has_delete_rendition_permission)??!1,canDeleteThumbnail:(L==null?void 0:L.has_edit_thumbnail_permission)??!1,canArchiveScene:L==null?void 0:L.has_archive_permission,canUnarchiveScene:L==null?void 0:L.has_archive_permission,canDeleteScene:(L==null?void 0:L.has_delete_permission)??!1}}),a=z(()=>({project:ni({type:"project",config:s.value}).url,take_review:ni({type:"review_take",config:s.value}).url,review:ni({type:"review_scene",config:s.value}).url,review_scene:ni({type:"review_scene",config:s.value}).url,woohoo:ni({type:"woohoo",config:s.value}).url,update:ni({type:"update",config:s.value}).url,scene_hub:ni({type:"scene_hub",config:s.value}).url})),l=(L,Y)=>{const ee=L instanceof MouseEvent&&(L.metaKey||L.ctrlKey),Z=a.value[Y]||"";Z&&(ee?window.open(Z,"_blank"):window.location.href=Z)},u=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.deleteRendition(s.value.ws_code,[s.value.scene_id],!0));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to delete rendition.");return}}catch(Z){console.error("Error deleting rendition",Z)}},c=async(L,Y)=>{var ee;try{await((ee=e.value.axiosService.value)==null?void 0:ee.deleteThumbnail(s.value.ws_code,[s.value.scene_id]))}catch(Z){console.error("Error deleting thumbnail",Z)}},d=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.archiveScene(s.value.ws_code,s.value.entity_id,[s.value.scene_id]));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to archive scene.");return}Y&&Y("archived")}catch(Z){console.error("Error archiving item",Z)}},h=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.deleteScene(s.value.ws_code,s.value.entity_id,s.value.scene_id));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to delete scene.");return}Y&&Y("deleted")}catch(Z){console.error("Error deleting item",Z)}},f=L=>{const Y=a.value.scene_hub||"";Y&&navigator.clipboard.writeText(Y)},p=async(L,Y)=>{var ee;try{const Z=await((ee=e.value.axiosService.value)==null?void 0:ee.unarchiveScene(s.value.ws_code,s.value.entity_id,[s.value.scene_id]));if((Z==null?void 0:Z.message)!="Done"){console.error("Failed to unarchive scene.");return}Y&&Y("unarchived")}catch(Z){console.error("Error unarchiving item",Z)}},m=L=>l(L,"scene_hub"),v=L=>l(L,"review_scene"),{tooltip:w,copyToClipboard:E}=kw(a.value.scene_hub||"",void 0,!0),_=L=>{E()},C=L=>n(L),b=L=>l(L,"review"),R=L=>l(L,"update"),F=L=>l(L,"woohoo"),A=L=>u(),I=L=>c(),O=L=>d(L,t),x=L=>p(L,t),T=L=>h(L,t),k=z(()=>{let L=[];return!s.value.scene_id&&e.value.optionBlock&&L.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length?e.value.optionBlock:[{id:"quick-actions",groupLabel:"Quick actions",type:"row",options:[{id:"scene-tile",label:"",icon:"CustomSceneHub",description:"Scene tile",action:m,hide:!r.value.canOpenSceneHub,type:"icon"},{id:"open-in-arbo-review",label:"",icon:"PenRuler",description:"Open in arbo Review",action:v,hide:!r.value.canOpenReview,type:"icon"},{id:"copy-link",label:"",icon:"Link",description:w.value,action:_,hide:!r.value.canCopyLink,type:"icon"}]},{id:"action",groupLabel:"Action",type:"column",options:[{id:"rename",label:"Rename",icon:"Pen",action:C,hide:!r.value.canRename,type:"icon"}]},{id:"download-options-take",type:"column",groupLabel:"Download Options",options:[{id:"open-take-in",label:"Open Take in",icon:"ArrowUpRightFromSquare",subMenu:{id:"sub-menu",type:"column",groupLabel:"Sub Menu",options:[{id:"review",label:"Review",icon:"PenRuler",action:b,hide:!r.value.canOpenTakeInReview,type:"icon"},{id:"update",label:"Update",icon:"UserCheck",action:R,hide:!r.value.canOpenTakeInUpdate,type:"icon"},{id:"woohoo-details",label:"Woohoo Details",icon:"ChartPie",action:F,hide:!r.value.canOpenTakeInWoohoo,type:"icon"}]}}]},{id:"download-options-delete",type:"column",groupLabel:"Download Options",options:[{id:"delete-rendition",label:"Delete rendition",icon:"Clapperboard",action:A,hide:!r.value.canDeleteRendition,type:"icon"},{id:"delete-thumbnail",label:"Delete thumbnail",icon:"Image",action:I,hide:!r.value.canDeleteThumbnail,type:"icon"}]},{id:"download-options-archive",type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:O,hide:r.value.canArchiveScene==0,disabled:r.value.canArchiveScene!==1,description:r.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:x,hide:r.value.canUnarchiveScene==0,disabled:r.value.canUnarchiveScene!==1,description:r.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:T,hide:!r.value.canDeleteScene,type:"icon"}]}]});return{linkMap:a,handleOpen:l,copyLink:f,deleteRendition:u,deleteThumbnail:c,archiveItem:d,deleteItem:h,unArchiveItem:p,options:k}};function Co(e){const t=$(!1),n=$(!1),o=z(()=>{var d;const u=e.value,c=!!u.readOnly;return{readOnly:c,disabled:!!u.disabled,hovered:n.value,focused:t.value,isEmpty:u.empty??!1,error:!!u.error,actived:!!((d=u.active)!=null&&d.value),clickable:c?!1:u.clickable??!1}}),i=()=>{t.value=!0,jt(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},s=()=>{t.value=!1},r=()=>{n.value=!0},a=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return an(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",i),u.addEventListener("blur",s)),c&&(c.addEventListener("mouseenter",r),c.addEventListener("mouseleave",a))}),Yn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",i),u.removeEventListener("blur",s)),c&&(c.removeEventListener("mouseenter",r),c.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:i}}const Wd=e=>{const t=$(!1),n=z(()=>t.value);return an(()=>{var a,l,u,c;const o=(a=e.params)==null?void 0:a.api,i=(l=e.params)==null?void 0:l.node,s=i==null?void 0:i.rowIndex,r=(c=(u=e.params)==null?void 0:u.colDef)==null?void 0:c.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===s&&d.colDef.field===r&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===s&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},pP=wt(ut({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:"active"},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=Xo,{triggerRef:n,popupRef:o}=lo({trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),i=z(()=>{switch(s.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"#02C39A"}}),s=e;return(r,a)=>(U(),ue("div",{class:j(r.$style["status-badge-wrapper"]),style:on({"--badge-size":`${s.size}px`,"--badge-color":i.value})},[Tt(r.$slots,"default"),Ke(he("div",{class:j(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[ir,s.showBadge],[K(t),{isLoading:s.loading,fullwidth:!0}]]),he("div",{ref_key:"popupRef",ref:o,class:j(r.$style["badge-tooltip"])},yt(s.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_13xqg_1","badge-indicator":"_badge-indicator_13xqg_6",active:"_active_13xqg_19",offline:"_offline_13xqg_22",busy:"_busy_13xqg_25",away:"_away_13xqg_28","badge-tooltip":"_badge-tooltip_13xqg_32"}}]]),gP=al("switchStore",()=>{const e=Io("switchInstance");return{openSceneHub:(o,i)=>{if(o){if(!e)throw console.error("Switch instance not found"),new Error("Switch instance not found");e("scene_hub",{id:o,commentId:i},{showLoading:!1})}},openPeopleInsight:o=>{if(!e)throw console.error("Switch instance not found"),new Error("Switch instance not found");e("people_insight",{tab:"home",id:o||""},{showLoading:!1})}}}),t7=ut({__name:"MiniPeopleCard",props:{user:{},status:{default:"active"},timezone:{default:Ad()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=cn,o=Xo,i=e,s=t,r={active:"Active in the last 10 minutes",offline:"Logged out of TESSR",busy:"User is busy",away:"No activity in the last 10 minutes"},a={active:"#02C39A",offline:"#808080",busy:"#FF0000",away:"#F7941D"},l=$(i.status),u=$(i.timezone),c=$(!0),d=$(null),h=z(()=>r[l.value]),f=z(()=>a[l.value]),p=z(()=>{var T;return(T=i.user)==null?void 0:T.name}),m=z(()=>u.value?s5(u.value,"HH:mm"):""),v=z(()=>u.value?`(${r5(u.value)})`:""),w=async()=>{var T,k,L;if(i.apiUpdateFunction)try{const Y=await i.apiUpdateFunction(i.user.id);if(!Y)throw new Error("No data returned from API");(T=Y.private_info)!=null&&T.is_offline?l.value="offline":(k=Y.private_info)!=null&&k.last_active?l.value="active":l.value="away",(L=Y.private_info)!=null&&L.timezone&&(u.value=Y.private_info.timezone),s("dataUpdated",Y)}catch(Y){console.error("Failed to fetch user data:",Y)}finally{c.value=!1}},E=()=>{!i.apiUpdateFunction||!i.enableAutoRefresh||(d.value!==null&&clearInterval(d.value),d.value=setInterval(w,i.refreshInterval))},_=()=>{d.value!==null&&(clearInterval(d.value),d.value=null)},C=z(()=>{const T=globalThis.location.origin,k=Mn.getInstance().getItem("ws.code");return ni({type:"people_insight",config:{ws_code:k,baseDomain:T,user_id:""}}).url}),{copyToClipboard:b,tooltip:R}=kw(C.value,()=>s("copyLink",i.user.id)),F=gP(),{openPeopleInsight:A}=F,I=T=>{if(T.ctrlKey||T.metaKey){window.open(C.value,"_blank");return}try{A(String(i.user.id))}catch{window.open(C.value,"_blank")}},O=T=>{I(T),s("insightClick",i.user.id)};nt([()=>i.enableAutoRefresh,()=>i.refreshInterval,()=>i.apiUpdateFunction],()=>{_(),i.enableAutoRefresh&&i.apiUpdateFunction&&E()}),an(async()=>{i.apiUpdateFunction&&(await w(),E())}),Yn(_);const x=z(()=>({name:i.user.name,initial:i.user.initial,id:i.user.id,profile_image:i.user.profile_image,color:i.user.color,size:98}));return(T,k)=>(U(),ue("div",{class:j([T.$style["mini-people-card"],{[T.$style.loading]:c.value},"bg-skeleton"])},[he("div",{class:j(T.$style["avatar-section"])},[i.private?(U(),$e(fu,Kt({key:1,readOnly:!0},x.value),null,16)):(U(),$e(pP,{key:0,size:16,status:l.value,loading:c.value,"status-tooltip":h.value},{default:me(()=>[ae(fu,Kt({readOnly:!0},x.value),null,16)]),_:1},8,["status","loading","status-tooltip"]))],2),he("div",{class:j(T.$style["user-info"])},[he("div",{class:j(T.$style["info-row"])},[he("h3",{class:j(T.$style["user-name"])},yt(p.value),3),i.private?qe("",!0):Ke((U(),ue("span",{key:0,class:j(T.$style["status-badge"]),style:on({color:f.value})},[st(yt(l.value),1)],6)),[[K(o),{isLoading:c.value,fullwidth:!0}]])],2),u.value?(U(),ue("div",{key:0,class:j([T.$style["info-row"],T.$style["time-row"]])},[Ke((U(),ue("div",{class:j(T.$style["time-display"])},[ae(ft,{source:"remote",src:"Clock",class:j(T.$style["clock-icon"])},null,8,["class"]),he("span",{class:j(T.$style["time-text"])},[he("strong",null,yt(m.value),1),he("span",{class:j(T.$style.separator)},"|",2),he("span",null,yt(v.value),1)],2)],2)),[[K(o),{isLoading:c.value,fullwidth:!0}]])],2)):qe("",!0),!e.readOnly&&!i.private?(U(),ue("div",{key:1,class:j([T.$style["info-row"],T.$style.actions])},[e.showInsightButton?(U(),$e(ht,{key:0,label:"Insights",variant:"primary",size:"default",style:{flex:"1"},onClick:Gt(O,["prevent","stop"]),disabled:i.disabled},null,8,["disabled"])):qe("",!0),e.showCopyLinkButton?Ke((U(),$e(ht,{key:1,variant:["icon","secondary"],size:"default","aria-label":"Copy link",onClick:Gt(K(b),["prevent","stop"]),disabled:i.disabled},{default:me(()=>[ae(ft,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[K(n),{content:K(R),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):qe("",!0)],2)):qe("",!0)],2)],2))}}),n7=wt(t7,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_xknlb_1",loading:"_loading_xknlb_22","avatar-section":"_avatar-section_xknlb_25","user-info":"_user-info_xknlb_30","info-row":"_info-row_xknlb_36","time-row":"_time-row_xknlb_43","time-display":"_time-display_xknlb_49","time-text":"_time-text_xknlb_54","actions-row":"_actions-row_xknlb_61","user-name":"_user-name_xknlb_65","status-badge":"_status-badge_xknlb_76",active:"_active_xknlb_90",offline:"_offline_xknlb_93",busy:"_busy_xknlb_96",away:"_away_xknlb_99","user-local-time":"_user-local-time_xknlb_102","clock-icon":"_clock-icon_xknlb_110",separator:"_separator_xknlb_122",timezone:"_timezone_xknlb_125","refresh-btn":"_refresh-btn_xknlb_128",spinning:"_spinning_xknlb_131",spin:"_spin_xknlb_131","insight-btn":"_insight-btn_xknlb_134","copy-link-btn":"_copy-link-btn_xknlb_138","last-update":"_last-update_xknlb_141","loading-overlay":"_loading-overlay_xknlb_147","loading-spinner":"_loading-spinner_xknlb_159"}}]]),o7=wt(ut({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=cn,n=e,{isEditing:o}=Wd(n);return(i,s)=>Ke((U(),$e(ht,{class:j(i.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:K(o)},{default:me(()=>[ae(ft,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[K(t),"More actions"]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_r5y5p_1"}}]]),i7=["src","width","height","alt"],og=wt(ut({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Xo,{getCachedValue:n,setCachedValue:o}=hd({dbName:"visual-cache-db",storeName:"visuals"}),i=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},s=e,r=z(()=>({minWidth:i(s.minWidth),maxWidth:i(s.maxWidth),minHeight:i(s.minHeight),maxHeight:i(s.maxHeight),aspectRatio:s.ratio,width:i(s.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},u=z(()=>({name:s.src,size:Number(s.size||100),color:""})),{url:c,loading:d}=_D(u,"visual",l,a);return(h,f)=>Ke((U(),ue("div",{class:j([h.$style.visualWrapper,{[h.$style.loading]:K(d)}]),style:on(r.value)},[he("img",{src:K(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:on(r.value)},null,12,i7)],6)),[[K(t),{isLoading:K(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_1sro0_1",loading:"_loading_1sro0_8",pulse:"_pulse_1sro0_1"}}]]),s7=["tabindex"],ea=wt(ut({name:"ListItem",directives:{tooltip:cn},__name:"ListItem",props:{label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean}},emits:["click","keydown","update:selected","select"],setup(e,{emit:t}){const n=e,o=t,i=$(!1),s=$(!1);function r(R){if(!R||typeof R!="object")return!1;const F=R;return typeof F.name=="string"&&typeof F.id=="string"&&typeof F.initial=="string"}const a=z(()=>n.type==="status"||n.type==="assignee"||n.type==="icon"||!!b.prefix),l=z(()=>!!b.suffix||n.danger&&i.value),u=z(()=>n.disabled||!n.clickable?-1:0),c=z(()=>{var R;return n.type==="status"&&typeof((R=n.data)==null?void 0:R.color)=="string"?{backgroundColor:n.data.color,border:pp(n.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=Zf(),h=z(()=>({[d.active]:n.selected??!1,[d.disabled]:n.disabled??!1,[d.hover]:n.hover??!1,[d.clickable]:(n.clickable??!0)&&!n.disabled,[d.danger]:n.danger??!1,[d["has-prefix"]]:a.value,[d["has-suffix"]]:l.value,[d.readOnly]:n.readOnly})),f=z(()=>({content:"Cancel",...C})),p=z(()=>({content:"Confirm",theme:"warning",...C}));function m(R){return{name:R.name,initial:R.initial,id:R.id,profile_image:R.profile_image??null,color:R.color,size:24}}function v(){i.value=!1}function w(R){R&&o("click",R),(n.clickable??!0)&&(o("update:selected",!n.selected),o("select",!n.selected))}function E(R){if(!n.disabled){if(n.danger&&!i.value){i.value=!0;return}n.danger||w(R)}}function _(R){if(o("keydown",R),!n.disabled)if(R.key==="Enter"||R.key===" "){R.preventDefault();const F=new MouseEvent("click",{bubbles:!0,cancelable:!0});E(F)}else R.key==="Escape"&&i.value&&(R.preventDefault(),v())}const C=Object.freeze({delay:[500,0],contentClass:["extra-padding"]}),b=Ov();return nt(()=>n.show,R=>{R===!1&&(i.value=!1)}),(R,F)=>{const A=Ma("tooltip");return U(),ue("div",{class:j([R.$style["list-item"],h.value]),tabindex:u.value,onClick:Gt(E,["stop","prevent"]),onKeydown:_,onMouseenter:F[0]||(F[0]=I=>s.value=!0),onMouseleave:F[1]||(F[1]=I=>s.value=!1)},[a.value?(U(),ue("div",{key:0,class:j(R.$style["list-item__prefix"])},[Tt(R.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(U(),$e(ft,{key:0,src:e.icon,source:"remote",class:j(R.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(U(),ue("div",{key:1,class:j(R.$style["status-indicator"]),style:on(c.value)},null,6)):e.type==="assignee"&&r(e.data)?(U(),$e(fu,Kt({key:2},m(e.data),{class:R.$style["item-avatar"],readOnly:!0}),null,16,["class"])):qe("",!0)])],2)):qe("",!0),he("div",{class:j(R.$style["list-item__label"])},[Tt(R.$slots,"label",{selected:e.selected},()=>[st(yt(e.label),1)])],2),l.value?(U(),ue("div",{key:1,class:j(R.$style["list-item__suffix"])},[Tt(R.$slots,"suffix",{item:R.$props,hovered:s.value},()=>[e.danger&&i.value?(U(),ue("div",{key:0,class:j(R.$style["confirm-action"])},[Ke((U(),$e(ht,{variant:["secondary","icon"],size:"small",onClick:Gt(v,["stop","prevent"])},{default:me(()=>[ae(ft,{src:"Xmark",source:"remote"})]),_:1})),[[A,f.value]]),Ke((U(),$e(ht,{variant:["danger","primary","icon"],size:"small",onClick:Gt(w,["stop","prevent"])},{default:me(()=>[ae(ft,{src:"Check",source:"remote"})]),_:1})),[[A,p.value]])],2)):qe("",!0)])],2)):qe("",!0)],42,s7)}}}),[["__cssModules",{$style:{"list-item":"_list-item_g74kb_1",disabled:"_disabled_g74kb_15",danger:"_danger_g74kb_18","has-prefix":"_has-prefix_g74kb_21","has-suffix":"_has-suffix_g74kb_21",clickable:"_clickable_g74kb_35",readOnly:"_readOnly_g74kb_38",hover:"_hover_g74kb_42",active:"_active_g74kb_48","list-item__prefix":"_list-item__prefix_g74kb_73","list-item__label":"_list-item__label_g74kb_81","list-item__suffix":"_list-item__suffix_g74kb_95","status-indicator":"_status-indicator_g74kb_102","item-icon":"_item-icon_g74kb_108","arbo-icon-state":"_arbo-icon-state_g74kb_113","item-avatar":"_item-avatar_g74kb_116","confirm-action":"_confirm-action_g74kb_125"}}]]),r7=["tabindex"],bo=wt(ut({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event"],setup(e,{expose:t,emit:n}){const o=e;Ov();const i=Zf(),s=$(null),r=$("default"),a=z(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),l=z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:o.disabled,[i.readOnly]:o.readOnly,[i.error]:o.error,[i.clickable]:o.clickable,[i.active]:o.actived,[i.hovered]:o.hovered,[i.focused]:!o.readOnly&&!o.disabled&&o.focused,[i.bordered]:o.bordered})),c=()=>{var w,E;const f=((w=s.value)==null?void 0:w.querySelectorAll(".wrapper-prefix").length)||0,p=((E=s.value)==null?void 0:E.querySelectorAll(".wrapper-suffix").length)||0,m="var(--icon-size)",v=(f+p)*8;return f&&!p?`repeat(${f}, ${m}) calc(100% - ${f} * ${m} - ${v}px )`:!f&&p?`calc(100% - ${p} * ${m} - ${v}px ) repeat(${p}, ${m})`:f&&p?`repeat(${f}, ${m}) calc(100% - ${f} * ${m} - ${p} * ${m} - ${v}px ) repeat(${p}, ${m})`:"100%"},d=$("100%");kf(()=>{d.value=c()}),an(()=>{d.value=c()});const h=f=>{r.value=f};return t({rootEl:s,updateState:h,componentState:r,focus:()=>{jt(()=>{var f;console.log("focusing"),(f=s.value)==null||f.focus()})}}),(f,p)=>(U(),ue("div",{ref_key:"rootEl",ref:s,class:j([K(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:on({"--grid-template":d.value,"--wrapper-size":a.value,"--loading-overlay-width":l.value})},[Tt(f.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Tt(f.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:h,disabled:o.disabled}),Tt(f.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,r7))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_1u1w6_1",bordered:"_bordered_1u1w6_22",disabled:"_disabled_1u1w6_22",readOnly:"_readOnly_1u1w6_22",active:"_active_1u1w6_22",error:"_error_1u1w6_25",hovered:"_hovered_1u1w6_25",clickable:"_clickable_1u1w6_34",suffix:"_suffix_1u1w6_40",prefix:"_prefix_1u1w6_41"}}]]),a7=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const l7=Object.prototype.toString,u7=e=>l7.call(e)==="[object Object]",Nu=()=>{};function c7(e,t){function n(...o){return new Promise((i,s)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(s)})}return n}function d7(e,t={}){let n,o,i=Nu;const s=l=>{clearTimeout(l),i(),i=Nu};let r;return l=>{const u=Xs(e),c=Xs(t.maxWait);return n&&s(n),u<=0||c!==void 0&&c<=0?(o&&(s(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{i=t.rejectOnCancel?h:d,r=l,c&&!o&&(o=setTimeout(()=>{n&&s(n),o=void 0,d(r())},c)),n=setTimeout(()=>{o&&s(o),o=void 0,d(l())},u)})}}function dC(e){return Array.isArray(e)?e:[e]}function h7(e,t=200,n={}){return c7(d7(t,n),e)}function f7(e,t,n){return nt(e,t,{...n,immediate:!0})}const mP=a7?window:void 0;function Ud(e){var t;const n=Xs(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function hC(...e){const t=(o,i,s,r)=>(o.addEventListener(i,s,r),()=>o.removeEventListener(i,s,r)),n=z(()=>{const o=dC(Xs(e[0])).filter(i=>i!=null);return o.every(i=>typeof i!="string")?o:void 0});return f7(()=>{var o,i;return[(o=(i=n.value)===null||i===void 0?void 0:i.map(s=>Ud(s)))!==null&&o!==void 0?o:[mP].filter(s=>s!=null),dC(Xs(n.value?e[1]:e[0])),dC(K(n.value?e[2]:e[1])),Xs(n.value?e[3]:e[2])]},([o,i,s,r],a,l)=>{if(!(o!=null&&o.length)||!(i!=null&&i.length)||!(s!=null&&s.length))return;const u=u7(r)?{...r}:r,c=o.flatMap(d=>i.flatMap(h=>s.map(f=>t(d,h,f,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function vP(e,t,n={}){const{window:o=mP,ignore:i=[],capture:s=!0,detectIframe:r=!1,controls:a=!1}=n;if(!o)return a?{stop:Nu,cancel:Nu,trigger:Nu}:Nu;let l=!0;const u=v=>Xs(i).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(E=>E===v.target||v.composedPath().includes(E));{const E=Ud(w);return E&&(v.target===E||v.composedPath().includes(E))}});function c(v){const w=Xs(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const E=Xs(v),_=E.$.subTree&&E.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(C=>C.el===w.target||w.composedPath().includes(C.el))}const h=v=>{const w=Ud(e);if(v.target!=null&&!(!(w instanceof Element)&&c(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!u(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[hC(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:s}),hC(o,"pointerdown",v=>{const w=Ud(e);l=!u(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),r&&hC(o,"blur",v=>{setTimeout(()=>{var w;const E=Ud(e);((w=o.document.activeElement)===null||w===void 0?void 0:w.tagName)==="IFRAME"&&!(E!=null&&E.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),m=()=>p.forEach(v=>v());return a?{stop:m,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:m}const p7=["type","value","placeholder","disabled","readonly","inputmode"],fC=wt(ut({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{}},emits:["update:modelValue","input","clear","enterValue","enter","blur","cancel"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=n,r=$(null),a=$(i.modelValue||""),l=$(!1);nt(()=>i.modelValue,I=>{a.value=I||""});const u=z(()=>{var I;return((I=a.value)==null?void 0:I.length)>0}),c={text:I=>I.slice(0,i.maxLength||255),number:I=>{let O=I.replace(/[^\d.-]/g,"");const x=O.split(".");x.length>2&&(O=x[0]+"."+x.slice(1).join("")),O=O.replace(/-/g,(k,L)=>L===0?k:"");const T=O.replace(/[.-]/g,"");if(T.length>17){const k=O.includes("."),Y=O.startsWith("-")?"-":"";if(k){const[ee,Z]=O.replace("-","").split(".");if(ee.length+Z.length>17){const V=17-ee.length;O=Y+ee+"."+Z.substring(0,Math.max(0,V))}}else O=Y+T.substring(0,17)}return O},email:I=>I.replace(/\s/g,"").slice(0,i.maxLength||255),url:I=>I.replace(/\s/g,"").slice(0,i.maxLength||255),tel:I=>I.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},d=I=>{const O=c[i.type];return O?O(I):I},h=h7(I=>{i.autoEmit&&(s("update:modelValue",I),s("input",I))},i.debounceDelay),f=I=>{if(i.disabled||i.readOnly){I.preventDefault();return}const O=I.target,x=O.selectionStart||0,T=a.value,k=d(O.value);T!==k&&(a.value=k,i.autoEmit&&h(k),O.value!==k&&(O.value=k,jt(()=>{let L=x;if(k.length<O.value.length)L=x;else{const Y=k.length-T.length;L=x+Y}L=Math.max(0,Math.min(L,k.length)),O.setSelectionRange(L,L)})))},p=I=>{if(i.disabled||i.readOnly){I.preventDefault();return}l.value=!0,a.value="",s("update:modelValue",""),s("clear"),I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),jt(()=>{var O;(O=r.value)==null||O.focus(),setTimeout(()=>{l.value=!1},100)})},m=I=>{if(l.value)return;const O=I.target;s("update:modelValue",O.value),s("blur",O.value)},v=I=>{const x=I.target.value;I.preventDefault(),s("update:modelValue",x),s("enter",x),s("enterValue",x)},w=I=>{var O;if(I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),i.autoEmit){(O=r.value)==null||O.blur(),s("cancel");return}a.value=i.modelValue||"",r.value&&(r.value.value=a.value),s("cancel")},E=I=>{I.key==="Escape"?w(I):I.key==="Enter"?v(I):(I.key==="ArrowUp"||I.key==="ArrowDown")&&I.preventDefault()},_=`input-text-${Math.random().toString(36).substr(2,9)}`,C=$(!1),b=z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});nt(()=>a.value,I=>{i.validatorFnc?C.value=!!I&&!i.validatorFnc(I):C.value=!1});const R=$(null),F=z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:C.value,inputRef:r,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:R})),{argsMain:A}=Co(F);return t({focus:()=>{jt(()=>{var I;(I=r.value)==null||I.focus()})}}),(I,O)=>(U(),ue("div",{class:j([I.$style["input-wrapper"],"input-editor"])},[ae(bo,Kt(K(A),{ref_key:"wrapperRef",ref:R,class:I.$style["input-box"],style:{"--icon-size":"24px"}}),{suffix:me(()=>[u.value&&!i.disabled&&!i.readOnly?Tt(I.$slots,"clear",{key:0},()=>[Ke((U(),$e(ht,{variant:["icon"],"aria-label":"Clear search",onMousedown:Gt(p,["prevent","stop"]),size:18,rounded:!0},{default:me(()=>[ae(ft,{class:j([I.$style["cs-icon"]]),src:"XMarkSolid",size:"10",color:"white"},null,8,["class"])]),_:1})),[[K(o),{content:"Clear",contentClass:"extra-padding"}]])]):Tt(I.$slots,"suffix",{key:1})]),default:me(()=>[he("input",{ref_key:"inputRef",ref:r,type:i.type||"text",value:a.value,placeholder:e.placeholder,class:j([I.$style["column-config__input"]]),id:_,disabled:e.disabled,readonly:e.readOnly,inputmode:b.value,onInput:f,onBlur:m,onKeydown:E},null,42,p7)]),_:3},16,["class"]),C.value?Tt(I.$slots,"error",{key:0}):qe("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wl9g3_1","has-suffix":"_has-suffix_wl9g3_11","has-value":"_has-value_wl9g3_11","is-disabled":"_is-disabled_wl9g3_17","is-readonly":"_is-readonly_wl9g3_24","column-config__input":"_column-config__input_wl9g3_31"}}]]),pC=wt(ut({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search..."},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=$(null),r=z(()=>{var c;return o.modelValue&&((c=o.modelValue)==null?void 0:c.length)>0}),a=Es(c=>{i("update:modelValue",c),i("search",c)},hr),l=()=>{i("update:modelValue",""),i("clear"),jt(()=>{var c;(c=s.value)==null||c.focus()})},u=$(o.modelValue);return t({focus:()=>{var c;(c=s.value)==null||c.focus()}}),(c,d)=>(U(),$e(fC,{ref_key:"searchInput",ref:s,modelValue:u.value,"onUpdate:modelValue":d[0]||(d[0]=h=>u.value=h),type:"text",placeholder:e.placeholder,onInput:K(a),onClear:l,onCancel:d[1]||(d[1]=h=>i("cancel")),"auto-emit":!0},{suffix:me(()=>[r.value?qe("",!0):(U(),$e(ft,{key:0,src:"MagnifyingGlass",class:j(c.$style.icon),color:"#a6a6a6"},null,8,["class"]))]),_:1},8,["modelValue","placeholder","onInput"]))}}),[["__cssModules",{$style:{"search-box":"_search-box_18t5g_1",icon:"_icon_18t5g_18"}}]]),g7=["aria-activedescendant"],m7=["innerHTML"],v7=10,ll=wt(ut({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"282px"},width:{default:"200px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel"],setup(e,{expose:t,emit:n}){const o=cn,i={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},s=e,r=n,a=$(""),l=$(-1),u=$(null),c=$(null),d=$(new Map),h=z(()=>Fw(a.value)),f=()=>{const G=h.value;if(!G||G.length<s.minQueryLength)return s.options;if(d.value.has(G))return d.value.get(G);const ve=s.options.map(pe=>({item:pe,score:d5(` ${pe.label} `,G)})).filter(({score:pe})=>pe>0).sort((pe,re)=>re.score-pe.score).map(({item:pe})=>pe);return d.value.set(G,ve),ve},p=$([]);nt(()=>s.options,()=>{p.value=f()},{immediate:!0,deep:!0});const m=z(()=>s.hasMore&&!s.loading&&!s.loadingMore),v=Es(G=>{a.value=G,l.value=-1,r("search",G)},hr),w=async G=>{V.value=0,await v(G||""),V.value=1},E=G=>a.value?h5(G,a.value):G,_=G=>{console.log("Key down event:",G.key);const pe={[i.ARROW_DOWN]:()=>C(G),[i.ARROW_UP]:()=>b(G),[i.ENTER]:()=>A(G),[i.ESCAPE]:()=>I(G),[i.TAB]:()=>O(G)}[G.key];console.log("Handler found:",!!pe),pe&&pe()},C=G=>{G.preventDefault(),R(1)},b=G=>{G.preventDefault(),R(-1)},R=G=>{const ve=p.value.length;if(ve===0)return;let pe;G>0?pe=(l.value+1)%ve:l.value>0?pe=l.value-1:pe=ve-1,l.value=pe,F()},F=()=>{jt(()=>{var ve;const G=(ve=c.value)==null?void 0:ve.querySelectorAll('[role="menuitem"]')[l.value];G==null||G.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},A=G=>{if(G.preventDefault(),l.value>=0&&l.value<p.value.length){const pe=p.value[l.value];x(pe)}},I=G=>{G.preventDefault(),k()},O=G=>{l.value>=0&&(G.preventDefault(),A(G))},x=G=>{!G||G.disabled||(r("select",G),l.value=-1,k())},T=G=>{G>=0&&G<p.value.length&&(l.value=G)},k=()=>{r("close")},L=()=>{if(!m.value||!c.value)return;const{scrollTop:G,clientHeight:ve,scrollHeight:pe}=c.value;pe-(G+ve)<=v7&&r("loadMore")},Y=()=>{var G,ve,pe;(G=c.value)==null||G.addEventListener("scroll",L),(pe=(ve=B.value)==null?void 0:ve.$el)==null||pe.addEventListener("keydown",_)},ee=()=>{var G,ve,pe;(G=c.value)==null||G.removeEventListener("scroll",L),(pe=(ve=B.value)==null?void 0:ve.$el)==null||pe.removeEventListener("keydown",_)};an(()=>{Y()}),Yn(()=>{ee()}),nt(()=>s.loading,G=>{!G&&p.value.length>0&&(l.value=-1)});const Z=G=>G?Array.isArray(s.selectedId)?s.selectedId.includes(String(G.id)):s.selectedId==G.id:!1,B=$(null);nt(l,()=>{F()}),t({focus:()=>{jt(()=>{var G;(G=B.value)==null||G.focus()})},reset:()=>{var G;(G=B.value)==null||G.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:k,clearSearch:()=>{a.value=""}});const V=$(0);return nt(()=>s.loading,G=>{const ve=s.options.length>0&&p.value.length>0,pe=!ve&&a.value.length>0,re=!ve&&a.value.length===0;G?V.value=0:ve?V.value=1:pe?V.value=2:re&&(V.value=3)},{immediate:!0}),(G,ve)=>(U(),ue("datalist",{ref_key:"searchListRef",ref:u,class:j([G.$style["search-list"],V.value===3||V.value===2?G.$style.empty:"",p.value.length>8?G.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:on({width:e.width})},[ae(pC,{ref_key:"searchBoxRef",ref:B,modelValue:a.value,"onUpdate:modelValue":ve[0]||(ve[0]=pe=>a.value=pe),class:j(G.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:ve[1]||(ve[1]=pe=>w("")),onCancel:ve[2]||(ve[2]=pe=>r("cancel"))},null,8,["modelValue","class","disabled"]),he("div",{ref_key:"popupRef",ref:c,class:j(G.$style["list-container"]),style:on({maxHeight:e.maxHeight})},[Tt(G.$slots,"extra-item",{query:a.value}),(U(!0),ue(Pt,null,Tn(p.value,(pe,re)=>Ke((U(),ue("div",{key:`${pe.id}-${re}`,role:"menuitem"},[Tt(G.$slots,"item",{item:pe,index:re,selectedIndex:l.value,isSelected:Z,handleSelect:x,handleItemHover:T,getHighlightedLabel:E,query:a.value,idx:re},()=>[pe.hide?qe("",!0):(U(),$e(ea,Kt({key:0,ref_for:!0},pe,{hover:re===l.value,selected:Z(pe),type:pe.type,id:`item-${re}`,"aria-selected":re===l.value,onClick:Gt(oe=>x(pe),["stop","prevent"]),onMouseover:oe=>T(re)}),{prefix:me(()=>[Tt(G.$slots,"prefix-item",{item:pe})]),label:me(()=>[a.value?Ke((U(),ue("span",{key:0,class:j(G.$style.match),innerHTML:E(pe.label)},null,10,m7)),[[K(o),{content:pe.label}]]):Ke((U(),ue("span",{key:1,class:j(G.$style["item-label"])},[st(yt(pe.label),1)],2)),[[K(o),{content:pe.label}]])]),suffix:me(({hovered:oe})=>[Tt(G.$slots,"action",{item:pe,isHovered:re===l.value,hovered:oe,selected:l.value==re})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[ir,V.value===1]])),128)),V.value===0?Tt(G.$slots,"loading-more",{key:0},()=>[(U(),ue(Pt,null,Tn(8,pe=>he("div",{class:j(G.$style["loading-more"]),key:pe},[he("div",{class:j(G.$style["loading-skeleton"])},null,2),he("div",{class:j(G.$style["loading-skeleton"])},null,2)],2)),64))]):qe("",!0),V.value===2?(U(),ue("div",{key:1,class:j(G.$style["no-results"])},[Tt(G.$slots,"empty",{query:a.value},()=>[he("div",{class:j(G.$style["no-results-content"])},[...ve[3]||(ve[3]=[he("div",null,[st(" No results. "),he("br"),st(" Try another search. ")],-1)])],2)])],2)):qe("",!0),V.value===3?(U(),ue("div",{key:2,class:j(G.$style["no-results"])},[Tt(G.$slots,"empty-list",{},()=>[he("div",{class:j(G.$style["no-results-content"])},[...ve[4]||(ve[4]=[he("div",null,"No items available.",-1)])],2)])],2)):qe("",!0),Tt(G.$slots,"footer")],6)],14,g7))}}),[["__cssModules",{$style:{"search-list":"_search-list_187go_1",empty:"_empty_187go_9",scrollable:"_scrollable_187go_15","list-container":"_list-container_187go_19","item-label":"_item-label_187go_38","loading-state":"_loading-state_187go_46","loading-more":"_loading-more_187go_47","loading-skeleton":"_loading-skeleton_187go_58","is-loading":"_is-loading_187go_65","skeleton-loading":"_skeleton-loading_187go_1","no-results":"_no-results_187go_120","no-results-content":"_no-results-content_187go_127",title:"_title_187go_130",tips:"_tips_187go_136",match:"_match_187go_150"}}]]),y7=["innerHTML"],w7=20,yP=wt(ut({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","start-update"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=Ry,r=B=>{const V=B.data;return{name:String((V==null?void 0:V.name)??"Unknown"),initial:String((V==null?void 0:V.initial)??"U"),id:String(B.id),profile_image:(V==null?void 0:V.profile_image)??null,color:(V==null?void 0:V.color)??{bgColor:"#CCCCCC",textColor:"var(--background-color)"},size:24,isUseShortLabel:!0}},{id:a}=yv(i),l=n,u=B=>{var G,ve;const V=(ve=(G=i.params)==null?void 0:G.api)==null?void 0:ve.getRowNode(String(a.value));V==null||V.setDataValue("assignees",o3(B.assignees)),l("updated",B)},c=$(!1),d=$(!1),h=$(null),f=$(1),p=$(!0),m=$(0),v=$(""),{isSubmitting:w,unAssignAll:E,replaceAssignees:_,handleSelect:C,assigneeList:b,mergedOptions:R,selectedUserIds:F}=dF({...i,updateRowData:u,value:i.value}),A=Io("bulkUpdate",!1),{apiServices:I}=ao(!A,i),O=Io("workspaceId"),x=async(B=1,V="",G=!1)=>{var ve,pe,re,oe,J;if(!I.value||!i.id&&!i.ids)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(G?d.value=!0:c.value=!0,h.value=null,!((ve=I.value)!=null&&ve.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const fe=await((pe=I.value)==null?void 0:pe.multipleAssignableUser({workspaceId:String(O),itemIds:(i.ids??(i.id?[i.id]:[])).map(String),page:B,perPage:w7,q:V.trim()})),Ne=((re=kd(fe.data))==null?void 0:re.map(Aw))??[];b.value=G?Cd(b.value,Ne,"id"):Ne,m.value=fe.meta.total,p.value=(((oe=fe==null?void 0:fe.meta)==null?void 0:oe.current_page)||0)<(((J=fe==null?void 0:fe.meta)==null?void 0:J.last_page)||0),f.value=B}catch(fe){console.error("Error fetching assignable users:",fe),h.value="Failed to load assignable users"}finally{c.value=!1,d.value=!1}},T=()=>{!d.value&&p.value&&x(f.value+1,v.value,!0)},k=Es(async B=>{v.value=B,await x(1,B,!1)},hr),L=()=>x(1,v.value,!1),Y=z(Ad);an(()=>{var B;(B=Z.value)==null||B.focus()}),t({getValue:()=>{var B;return(B=R.value.find(V=>V.selected))==null?void 0:B.value},refresh:L,clearInternal:()=>{F.value=[]},focus:()=>{var B;(B=Z.value)==null||B.focus()}});const ee=()=>{const B=Mn.getInstance().getItem("BASE_URL"),V=ni({type:"access_setting",config:{baseDomain:B,ws_code:i.workspaceId,entity_id:O}}).url;window.open(V,"_blank")},Z=$(null);return an(()=>{jt(()=>{var B;(B=Z.value)==null||B.focus()})}),nt([()=>i.id,()=>i.workspaceId,()=>i.ids],()=>{x()},{deep:!0,immediate:!0}),(B,V)=>(U(),$e(ll,Kt({"selected-id":K(F)},{...i},{options:K(R),loading:c.value,ref_key:"popupRef",ref:Z,"loading-more":d.value,"has-more":p.value,onSelect:V[0]||(V[0]=G=>{K(C)(G),l("start-update")}),onSearch:K(k),onLoadMore:T}),Wc({"extra-item":me(()=>[ae(ht,{variant:"menu-item",onHandleClick:K(E)},{prefix:me(()=>[he("div",{class:j(B.$style["unassign-icon"])},[ae(ft,{src:"UserXMark",source:"remote"})],2)]),default:me(()=>[V[1]||(V[1]=st(" Unassign all ",-1))]),_:1},8,["onHandleClick"])]),item:me(({item:G,selectedIndex:ve,isSelected:pe,handleSelect:re,handleItemHover:oe,getHighlightedLabel:J,query:fe,idx:Ne})=>[ae(ea,Kt(G,{hover:Ne===ve,selected:pe(G),type:G.type,onClick:Gt(ot=>re(G),["stop","prevent"]),onMouseover:ot=>oe(Ne),class:B.$style["item-assignee"]}),{prefix:me(()=>[Ke(ae(fu,df(Wf(r(G))),null,16),[[K(s),{user:G.data,status:"active",timezone:Y.value,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0}]])]),label:me(({selected:ot})=>[fe?Ke((U(),ue("span",{key:0,class:j([B.$style["item-label"],B.$style.match]),style:{flex:"1"},innerHTML:J(G.label)},null,10,y7)),[[K(o),{content:G.label}]]):Ke((U(),ue("span",{key:1,class:j(B.$style["item-label"]),style:{flex:"1"}},[st(yt(G.label),1)],2)),[[K(o),{content:G.label}]]),he("div",{class:j(B.$style["item-action"])},[Ke((U(),$e(ht,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:K(w),onClick:Gt(_e=>re(G),["stop","prevent"])},{prefix:me(()=>[ae(ft,{src:ot?"UserMinus":"UserPlus",source:"remote"},null,8,["src"])]),_:2},1032,["disabled","onClick"])),[[K(o),ot?"Unassign":"Assign"]]),Ke((U(),$e(ht,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:K(w),onClick:Gt(_e=>{var mt;return K(_)((mt=G.data)==null?void 0:mt.id)},["stop","prevent"])},{prefix:me(()=>[ae(ft,{src:"IdCardClip",source:"remote"})]),_:1},8,["disabled","onClick"])),[[K(o),"Unassign others and reassign"]])],2)]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),"empty-list":me(()=>[he("div",{class:j(B.$style["empty-state"])},[V[4]||(V[4]=st(" No assignee available. ",-1)),V[5]||(V[5]=he("br",null,null,-1)),ae(ht,{onClick:ee,variant:["tertiary"],size:"small"},{default:me(()=>[...V[3]||(V[3]=[st(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[h.value?{name:"error",fn:me(()=>[he("div",{class:j(B.$style["error-message"])},[st(yt(h.value)+" ",1),ae(ht,{onClick:L,size:"small"},{default:me(()=>[...V[2]||(V[2]=[st(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"]))}}),[["__cssModules",{$style:{action:"_action_1dg6a_1","item-assignee":"_item-assignee_1dg6a_6","item-action":"_item-action_1dg6a_6","item-label":"_item-label_1dg6a_16","unassign-icon":"_unassign-icon_1dg6a_25","error-message":"_error-message_1dg6a_36","empty-state":"_empty-state_1dg6a_46"}}]]),C7=ut({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{}},emits:["update"],setup(e,{emit:t}){const n=e;Va("bulkUpdate",!0);const o=t,i=$(null),s=f=>{var p;h.value=!1,o("update",f),(p=i.value)==null||p.clearInternal()},{triggerRef:r,popupRef:a,hide:l,isVisible:u}=lo(),c=$(null),d=f=>{f.key==="Escape"&&a.value&&l()};an(()=>{var p;const f=c.value instanceof HTMLElement?c.value:(p=c.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",d)}),Yn(()=>{var p;const f=c.value instanceof HTMLElement?c.value:(p=c.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",d)}),nt(u,f=>{var p,m;f?(p=i.value)==null||p.focus():(m=i.value)==null||m.clearInternal()});const h=$(!1);return(f,p)=>(U(),ue("div",{ref_key:"mainRef",ref:c},[he("div",{ref_key:"triggerRef",ref:r},[ae(ht,{class:"action-button",variant:n.variant,loading:h.value},{default:me(()=>[ae(ft,{src:"UserPlus",class:"icon"}),p[1]||(p[1]=st(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),he("div",{ref_key:"popupRef",ref:a,style:{display:"none"}},[K(u)?(U(),$e(yP,Kt({key:0,ref_key:"assigneeGroupEditorRef",ref:i},n,{ids:e.ids,onUpdated:s,onStartUpdate:p[0]||(p[0]=m=>h.value=!0)}),null,16,["ids"])):qe("",!0)],512)],512))}}),b7=["aria-label"],S7=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],E7={style:{flex:"1"}},R7=wt(ut({__name:"MainCalendar",props:WE({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:WE(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{emit:t}){const n=cn,o=e,i=z(()=>o.startDate&&o.endDate),s=$V(e,"tracingCase"),r=t,a=$(o.year),l=$(o.month);nt(()=>[o.year,o.month],([B,V])=>{a.value=B,l.value=V});const u=z(()=>it.fromObject({year:a.value,month:l.value,day:1},{zone:o.timezone}).setLocale(o.locale||"en-US").toFormat("LLLL yyyy")),c=z(()=>it.now().setZone(o.timezone)),d=z(()=>o.startDate?it.fromJSDate(o.startDate,{zone:o.timezone}):null),h=z(()=>o.endDate?it.fromJSDate(o.endDate,{zone:o.timezone}):null),f=$(d.value),p=$(h.value),m=$(d.value),v=$(h.value);nt([d,h],()=>{o.requireConfirm||(f.value=d.value,p.value=h.value,m.value=d.value,v.value=h.value)},{immediate:!0});const w=z(()=>o.requireConfirm?f.value:d.value),E=z(()=>o.requireConfirm?p.value:h.value);nt(()=>o.activeField,B=>{const V=B==="start"?w.value:E.value;V&&(a.value=V.year,l.value=V.month)}),nt(()=>{var B,V;return[(B=w.value)==null?void 0:B.toISODate(),(V=E.value)==null?void 0:V.toISODate(),o.activeField]},()=>{const B=o.activeField==="start"?w.value:E.value;B&&(B.year!==a.value||B.month!==l.value)&&(a.value=B.year,l.value=B.month)});function _(B){return B.setZone("utc")}const C=$("");function b(B){C.value=B.toISODate()||"",jt(()=>{const V=document.querySelector(`.arbo-calendar-day[data-date="${C.value}"]`);V==null||V.focus()})}nt(()=>{var B,V;return[a.value,l.value,o.activeField,(B=w.value)==null?void 0:B.toISODate(),(V=E.value)==null?void 0:V.toISODate()]},()=>{const B=o.activeField==="start"?w.value:E.value;let V;B&&B.year===a.value&&B.month===l.value?V=B:w.value&&w.value.year===a.value&&w.value.month===l.value?V=w.value:V=c.value,b(V)});function R(B){return B.toFormat("d")}const F=z(()=>{const B=it.fromObject({year:a.value,month:l.value,day:1},{zone:o.timezone}),V=B.weekday,G=o.weekStart===1?(V+6)%7:V%7;let ve=B.minus({days:G});const pe=[],re=xu.weekdays(o.weekdayLabelStyle||"short",{locale:o.locale||"en-US"}),oe=Zf();for(let fe=0;fe<42;fe++){const Ne=[];ve.month!==l.value&&Ne.push(oe["is-outside"]),ve.hasSame(c.value,"day")&&Ne.push(oe["is-today"]),w.value&&ve.hasSame(w.value,"day")&&Ne.push(oe["is-selected-start"]),E.value&&ve.hasSame(E.value,"day")&&Ne.push(oe["is-selected-end"]),w.value&&E.value&&ve>w.value&&ve<E.value&&Ne.push(oe["is-in-range"]);const ot=R(ve),_e=re[ve.weekday-1]||"";pe.push({dt:ve,iso:ve.toISODate()||"",label:ve.toFormat("d"),displayLabel:ot,weekdayLabel:_e,aria:ve.setLocale(o.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:Ne}),ve=ve.plus({days:1})}const J=[];for(let fe=0;fe<6;fe++)J.push(pe.slice(fe*7,fe*7+7));return J}),A=z(()=>{const B=xu.weekdays(o.weekdayLabelStyle||"short",{locale:o.locale||"en-US"});return o.weekStart===1?B:[B[6],...B.slice(0,6)]});function I(B,V,G){const ve=B==="start"?V.startOf("day"):V.endOf("day"),pe=_(ve),re={year:ve.year,month:ve.month,day:ve.day,utc:pe.toISO()||""};B==="start"?(r("select-start",re,G??!0),r("select-start-utc",re.utc)):(r("select-end",re),r("select-end-utc",re.utc))}function O(B){let V=a.value,G=l.value+B;for(;G<1;)G+=12,V-=1;for(;G>12;)G-=12,V+=1;a.value=V,l.value=G,r("update:year",V),r("update:month",G)}function x(B){const G=(C.value?it.fromISO(C.value,{zone:o.timezone}):c.value).plus({days:B});(G.month!==l.value||G.year!==a.value)&&(l.value=G.month,a.value=G.year,r("update:year",G.year),r("update:month",G.month)),b(G)}function T(B=!1){const G=(C.value?it.fromISO(C.value,{zone:o.timezone}):c.value).weekday%7,ve=B?6-G:-G;x(ve)}function k(B){switch(B.key){case"ArrowLeft":B.preventDefault(),x(-1);break;case"ArrowRight":B.preventDefault(),x(1);break;case"ArrowUp":B.preventDefault(),x(-7);break;case"ArrowDown":B.preventDefault(),x(7);break;case"Home":B.preventDefault(),T(!1);break;case"End":B.preventDefault(),T(!0);break;case"PageUp":B.preventDefault(),O(B.shiftKey?-12:-1);break;case"PageDown":B.preventDefault(),O(B.shiftKey?12:1);break;case"Enter":case" ":{B.preventDefault();const V=C.value?it.fromISO(C.value,{zone:o.timezone}):c.value,G=F.value.flat().find(ve=>ve.iso===V.toISODate());G&&Y(G);break}}}const L=B=>{const V=it.now().setZone(o.timezone);a.value=V.year,l.value=V.month,r("update:year",V.year),r("update:month",V.month),b(V),r("gotoToday")};function Y(B){var bt,vt;const V=!!d.value,G=!!h.value,ve=o.activeField,pe=((bt=d.value)==null?void 0:bt.toISODate())||"null",re=((vt=h.value)==null?void 0:vt.toISODate())||"null",oe=B.dt.toISODate()||"",J=(N,q)=>{s.value={case:N,behavior:q}},fe=()=>`Selected start ${oe} > existing end ${re} -> reset both to ${oe}`,Ne=()=>`Selected end ${oe} < existing start ${pe} -> reset both to ${oe}`,ot=()=>{I("start",B.dt,!0),I("end",B.dt),r("update:activeField","end")},_e=(N=!1)=>{I("start",B.dt,N),N&&r("update:activeField","end")},mt=(N=!1)=>{I("end",B.dt),N&&r("close")};if(V&&G){ve==="start"?h.value&&B.dt>h.value?(ot(),J("INVERT_RANGE_FROM_START",fe())):(_e(!1),J("UPDATE_START_IN_RANGE",`Updated start from ${pe} to ${oe}; end remains ${re}`)):d.value&&B.dt<d.value?(ot(),J("INVERT_RANGE_FROM_END",Ne())):(mt(!1),J("UPDATE_END_IN_RANGE",`Updated end from ${re} to ${oe}; start remains ${pe}`));return}if(!V&&G&&ve==="start"&&h.value&&B.dt>h.value){ot(),J("CREATE_RANGE_FROM_LATE_START",fe());return}if(V&&!G&&ve==="end"&&d.value&&B.dt<d.value){ot(),J("CREATE_RANGE_FROM_EARLY_END",Ne());return}if(!V&&!G){if(ve==="start"){_e(!0),J("INIT_START",`Picked start ${oe}; awaiting end selection`);return}mt(o.immediatelyUpdate),J("INIT_END",`Picked end ${oe}; awaiting start selection`);return}if(!V&&G){if(ve==="start"){_e(!0),J("FILL_MISSING_START",`Inserted start ${oe}; existing end ${re}`);return}mt(!1),J("STRICT_UPDATE_END_ONLY",`Updated end to ${oe}; start still null`);return}if(V&&!G){if(ve==="start"){_e(!0),J("RESELECT_START_BEFORE_END",`Replaced start with ${oe}; end still null, switching to end`);return}mt(o.immediatelyUpdate),J("FILL_MISSING_END",`Picked end ${oe}; start ${pe}`);return}}function ee(){m.value=f.value,v.value=p.value,r("confirm")}function Z(){f.value=m.value,p.value=v.value,r("cancel")}return(B,V)=>(U(),ue("div",{class:j([B.$style["arbo-calendar"],{[B.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":u.value,tabindex:"0",onKeydown:k},[he("div",{class:j([B.$style["arbo-calendar-header"],B.$style["arbo-calendar-week"]]),role:"row"},[(U(!0),ue(Pt,null,Tn(A.value,G=>(U(),ue("div",{key:G,class:j(B.$style["arbo-calendar-weekday"]),role:"columnheader"},yt(G),3))),128))],2),he("div",{class:j(B.$style["arbo-calendar-weeks"])},[(U(!0),ue(Pt,null,Tn(F.value,(G,ve)=>(U(),ue("div",{key:ve,class:j(B.$style["arbo-calendar-week"]),role:"row"},[(U(!0),ue(Pt,null,Tn(G,pe=>(U(),ue("div",{key:pe.iso,class:j([B.$style["arbo-calendar-day"],pe.classes,{[B.$style["is-focused"]]:pe.iso===C.value}]),disabled:o.disabled,readOnly:o.readOnly,role:"gridcell","aria-label":pe.aria,"data-date":pe.iso,"data-weekday":pe.weekdayLabel,tabindex:pe.iso===C.value?0:-1,onClick:re=>Y(pe)},yt(pe.displayLabel),11,S7))),128))],2))),128))],2),o.readOnly?qe("",!0):(U(),ue("div",{key:0,class:j(B.$style["arbo-calendar-actions"])},[he("div",E7,[Ke((U(),$e(ht,{variant:"secondary",size:"medium",onClick:V[0]||(V[0]=G=>L())},{prefix:me(()=>[ae(ft,{src:"CalendarDay"})]),_:1})),[[K(n),"Today"]])]),ae(ht,{disabled:o.disabled,readOnly:o.readOnly,variant:"secondary",size:"medium",onClick:Z},{default:me(()=>[st(yt(o.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),ae(ht,{disabled:o.disabled||o.disableConfirm,readOnly:o.readOnly,variant:"primary",size:"medium",onClick:ee},{default:me(()=>[st(yt(o.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))],42,b7))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_85hoe_1","arbo-calendar-day":"_arbo-calendar-day_85hoe_2","arbo-calendar-week":"_arbo-calendar-week_85hoe_3","arbo-calendar":"_arbo-calendar_85hoe_2","arbo-calendar-nav":"_arbo-calendar-nav_85hoe_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_85hoe_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_85hoe_53","arbo-calendar-weekday":"_arbo-calendar-weekday_85hoe_58","arbo-calendar-weeks":"_arbo-calendar-weeks_85hoe_63","is-today":"_is-today_85hoe_92","is-selected-start":"_is-selected-start_85hoe_97","is-selected-end":"_is-selected-end_85hoe_105","is-outside":"_is-outside_85hoe_125","is-in-range":"_is-in-range_85hoe_128","arbo-calendar-actions":"_arbo-calendar-actions_85hoe_134","arbo-calendar-btn":"_arbo-calendar-btn_85hoe_142",cancel:"_cancel_85hoe_151",confirm:"_confirm_85hoe_156"}}]]),_7=["onClick"],D7=["variant","onClick"],x7=wt(ut({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,i=z(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const k=o.locale||"en-US",L=o.monthLabelStyle||"short",Y=new Intl.DateTimeFormat(k,{month:L,timeZone:"UTC"});return Array.from({length:12},(Z,B)=>Y.format(new Date(Date.UTC(2020,B,1))))}),s=n,r=$(o.year),a=$(o.month),l=$(o.year);nt(()=>o.year,k=>{k!==r.value&&(r.value=k,l.value=k)}),nt(()=>o.month,k=>{k!==a.value&&(a.value=k)});const u=$("days");function c(k){u.value!==k&&(u.value=k,s("mode-change",k))}const d=z(()=>o.minYear),h=z(()=>o.maxYear),f=z(()=>{const k=o.yearSpan;return l.value-l.value%k}),p=z(()=>f.value+o.yearSpan-1);function m(){const k=o.yearSpan,L=f.value-k;L>=d.value&&(l.value=L)}function v(){const k=o.yearSpan,L=f.value+k;L<=h.value&&(l.value=L)}const w=z(()=>f.value-o.yearSpan<d.value),E=z(()=>p.value+o.yearSpan>h.value),_=z(()=>{const k=o.yearSpan;return Math.ceil(k/3)});function C(k){const Y=f.value+(k-1)*3;return Array.from({length:3},(ee,Z)=>Y+Z).filter(ee=>ee<=p.value)}function b(){u.value==="months"?c("days"):c("months")}function R(){u.value==="years"?c("days"):c("years")}function F(k){r.value=k,l.value=k,s("update:year",k),s("year-selected",k),c("months")}function A(k){a.value=k,s("update:month",k),s("month-selected",k),c("days")}function I(){if(u.value==="days"){let k=r.value,L=a.value-1;if(L<1&&(L=12,k--),k<d.value)return;r.value=k,a.value=L,s("update:year",k),s("update:month",L)}else if(u.value==="months"){if(r.value-1<d.value)return;r.value--,s("update:year",r.value)}else u.value==="years"&&m()}function O(){if(u.value==="days"){let k=r.value,L=a.value+1;if(L>12&&(L=1,k++),k>h.value)return;r.value=k,a.value=L,s("update:year",k),s("update:month",L)}else if(u.value==="months"){if(r.value+1>h.value)return;r.value++,s("update:year",r.value)}else u.value==="years"&&v()}const x=z(()=>u.value==="days"?r.value===d.value&&a.value===1:u.value==="months"?r.value-1<d.value:w.value),T=z(()=>u.value==="days"?r.value===h.value&&a.value===12:u.value==="months"?r.value+1>h.value:E.value);return t({setNavigation:(k,L)=>{r.value=k,a.value=L}}),(k,L)=>(U(),ue("div",{class:j([k.$style["cal-nav-wrapper"]])},[Tt(k.$slots,"selection"),u.value==="days"?(U(),ue("div",{key:0,class:j(k.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Previous",disabled:x.value,label:"",onClick:I},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),he("div",{class:j(k.$style["cal-nav-center"])},[ae(ht,{variant:"secondary",onClick:b},{default:me(()=>[st(yt(i.value[a.value-1]),1)]),_:1}),ae(ht,{variant:"secondary",onClick:R},{default:me(()=>[st(yt(r.value),1)]),_:1})],2),ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:T.value,label:"",onClick:O},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2)):qe("",!0),u.value==="years"?(U(),ue("div",{key:1,class:j(k.$style["year-grid"])},[he("div",{class:j(k.$style["year-grid-header"])},[ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:m},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),he("div",{class:j(k.$style["range-label"])},yt(f.value)+" - "+yt(p.value),3),ae(ht,{variant:"tertiary",class:j([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:E.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:me(({hovered:Y})=>[ae(ft,{src:"AnglesRight",source:"remote",color:Y?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),he("div",{class:j(k.$style["year-grid-body"]),role:"grid"},[(U(!0),ue(Pt,null,Tn(_.value,Y=>(U(),ue("div",{key:"yr-row-"+Y,class:j(k.$style["year-grid-row"])},[(U(!0),ue(Pt,null,Tn(C(Y),ee=>(U(),ue("div",{key:ee,class:j([k.$style["year-cell"],{[k.$style.selected]:ee===r.value}]),onClick:Z=>F(ee)},yt(ee),11,_7))),128))],2))),128))],2)],2)):u.value==="months"?(U(),ue("div",{key:2,class:j(k.$style["month-grid"]),"aria-label":"Select month"},[he("div",{class:j(k.$style.months)},[(U(!0),ue(Pt,null,Tn(i.value,(Y,ee)=>(U(),ue("div",{key:Y,variant:ee+1===a.value?"primary":"text",class:j([k.$style["month-cell"],{[k.$style.selected]:ee+1===a.value}]),onClick:Z=>A(ee+1)},yt(Y),11,D7))),128))],2)],2)):(U(),ue("div",{key:3,class:j(k.$style["days-slot"])},[Tt(k.$slots,"default",{year:r.value,month:a.value,mode:u.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_16tl9_1","cal-nav-bar":"_cal-nav-bar_16tl9_12","cal-nav-btn":"_cal-nav-btn_16tl9_20",prev:"_prev_16tl9_33","year-grid-header":"_year-grid-header_16tl9_37","cal-nav-center":"_cal-nav-center_16tl9_46","cal-nav-label":"_cal-nav-label_16tl9_52","month-grid":"_month-grid_16tl9_66","year-grid":"_year-grid_16tl9_37",months:"_months_16tl9_75","month-cell":"_month-cell_16tl9_82","year-cell":"_year-cell_16tl9_83","pg-btn":"_pg-btn_16tl9_105","year-grid-body":"_year-grid-body_16tl9_118","year-grid-row":"_year-grid-row_16tl9_125",selected:"_selected_16tl9_131","days-slot":"_days-slot_16tl9_137","range-label":"_range-label_16tl9_141"}}]]);function F7(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:i}=e,s=$(""),r=z(()=>{const m=it.fromFormat(s.value,t,{zone:n});return m.isValid?m:null}),a=z(()=>{if(!o||!r.value)return!0;const m={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year>m.year?!0:v.year<m.year?!1:v.month>m.month?!0:v.month<m.month?!1:l(v,m)>=0}),l=(m,v)=>{const w=new Date(m.year,m.month-1,m.day),E=new Date(v.year,v.month-1,v.day);return w<E?-1:w>E?1:0},u=z(()=>{if(!i||!r.value)return!0;const m={year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year<m.year?!0:v.year>m.year?!1:v.month<m.month?!0:v.month>m.month?!1:l(v,m)<=0}),c=z(()=>s.value.length==0||s.value.length>0&&r.value!==null&&a.value&&u.value),d=z(()=>s.value.length===t.length&&c.value);return{inputValue:s,isValid:c,isComplete:d,clear:()=>{s.value=""},setDate:m=>{let v;m instanceof Date?v=it.fromJSDate(m,{zone:n}):v=m.setZone(n),v.isValid?s.value=v.toFormat(t):s.value=""},getDate:()=>c.value?r.value:null}}const T7={key:0,style:{marginLeft:"8px"}},P7=["disabled","readonly","placeholder"],wP=wt(ut({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=n,r=$(null),a=$(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:h,getDate:f}=F7({format:i.format,allowPastDates:i.allowPastDates,allowFutureDates:i.allowFutureDates,timezone:i.timezone,minDate:i.minDate,maxDate:i.maxDate}),p=z(()=>i.active),m=z(()=>({disabled:i.disabled,error:!l.value&&c.value.length>0,readOnly:i.readOnly,isEmpty:c.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:E}=Co(m),_=R=>{var A;const F=(A=R.clipboardData)==null?void 0:A.getData("text/plain");F&&(c.value=F.trim())},C=()=>{d(),s("clear")};t({clear:C,setDate:h,getDate:f,focus:()=>{var R;return(R=r.value)==null?void 0:R.focus()}}),nt(()=>i.modelValue,R=>{R?h(R):d()},{immediate:!0}),nt([()=>u.value,()=>c.value],()=>{if(c.value.length===0){s("complete",null);return}else if(l.value&&!i.readOnly&&!i.disabled&&u.value){const R=f();(R||c.value.length===0)&&s("complete",R)}}),nt(()=>l.value,R=>{R||s("invalid","")});const b=z(()=>!!i.isMultipleDate);return(R,F)=>(U(),$e(bo,Kt(K(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:me(()=>[he("div",{class:j([R.$style["date-input-wrapper"]])},[b.value?(U(),ue("span",T7," Multiple ")):Ke((U(),ue("input",{key:1,disabled:i.disabled,readonly:i.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":F[0]||(F[0]=A=>rn(c)?c.value=A:null),onPaste:Gt(_,["prevent"]),placeholder:i.placeholder,class:j([R.$style["date-input"]])},null,42,P7)),[[oy,K(c)]]),Tt(R.$slots,"clear",{handleClear:C},()=>[(K(c).length>0||b.value)&&!i.readOnly&&!i.disabled&&(K(w)||K(E))?Ke((U(),$e(ht,{key:0,variant:["icon","primary"],onClick:Gt(C,["stop"]),size:16,rounded:!0},{default:me(()=>[ae(ft,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[K(o),"Clear"]]):(U(),$e(ft,{key:1,src:"Calendar",source:"remote",class:j(R.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_ycl1p_1","icon-calendar":"_icon-calendar_ycl1p_9",focus:"_focus_ycl1p_12",hover:"_hover_ycl1p_12",active:"_active_ycl1p_12","date-input":"_date-input_ycl1p_1",invalid:"_invalid_ycl1p_38"}}]]),I7=ut({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:Iw()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o=$({case:"",behavior:""}),i=e,s=$(null),r=n,a=async(oe,J)=>{r("start-update"),await oe(),r("finish-update"),jt(()=>{var fe,Ne;J(),(Ne=(fe=i.params)==null?void 0:fe.api)==null||Ne.stopEditing()})},l=(oe,J)=>{oe(),jt(()=>{var fe,Ne;J(),(Ne=(fe=i.params)==null?void 0:fe.api)==null||Ne.stopEditing()})},u=()=>{var J;const oe=it.now().setZone(i.timezone);B.value=oe.year,V.value=oe.month,(J=Z.value)==null||J.setNavigation(oe.year,oe.month)},c=vi({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:m,confirmSelection:v,selectStartDate:w,beginInteraction:E,clearStart:_,clearDue:C}=v5(i,r),b=z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});nt(()=>i.multipleStartDates,oe=>{h.value=!!oe},{immediate:!0}),nt(()=>i.multipleDueDates,oe=>{f.value=!!oe},{immediate:!0});const R=oe=>{if(!oe){c.start=!1,_();return}const J=d.endDate?it.fromJSDate(d.endDate,{zone:i.timezone}):null;if(J&&F(oe,J)>0){const Ne={year:oe.year,month:oe.month,day:oe.day};c.start=!1,w(Ne,!1),p(Ne),jt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const fe={year:oe.year,month:oe.month,day:oe.day};c.start=!1,w(fe,!0)},F=(oe,J)=>{const fe=oe.startOf("day"),Ne=J.startOf("day");return fe<Ne?-1:fe>Ne?1:0},A=oe=>{if(!oe){c.end=!1,C();return}const J=d.startDate?it.fromJSDate(d.startDate,{zone:i.timezone}):null;if(J&&F(oe,J)<0){const Ne={year:oe.year,month:oe.month,day:oe.day};c.end=!1,w(Ne),p(Ne),jt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const fe={year:oe.year,month:oe.month,day:oe.day};c.end=!1,p(fe)},I=()=>{h.value=!1,_()},O=()=>{f.value=!1,C()},x=()=>{Y()},T=z(()=>d.isSelectingStart||d.isSelectingEnd);function k(){i.disabled||i.readOnly||(E(),d.isSelectingStart=!0,d.isSelectingEnd=!1)}function L(){i.disabled||i.readOnly||(E(),d.isSelectingEnd=!0,d.isSelectingStart=!1)}function Y(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function ee(oe){oe.key==="Escape"&&(oe.stopPropagation(),Y())}const Z=$(null),B=$(new Date().getFullYear()),V=$(new Date().getMonth()+1);nt(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(B.value=d.startDate.getFullYear(),V.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(B.value=d.endDate.getFullYear(),V.value=d.endDate.getMonth()+1)},{immediate:!0});const G=$(null);function ve(){if(Array.isArray(i.value)){const[J,fe]=i.value;d.startDate=J||null,d.endDate=fe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const oe=d.startDate||d.endDate||new Date;B.value=oe.getFullYear(),V.value=oe.getMonth()+1}nt(()=>{var oe,J,fe,Ne,ot,_e,mt,bt;return[((fe=(J=(oe=i.value)==null?void 0:oe[0])==null?void 0:J.getTime)==null?void 0:fe.call(J))||((Ne=i.value)==null?void 0:Ne[0]),((mt=(_e=(ot=i.value)==null?void 0:ot[1])==null?void 0:_e.getTime)==null?void 0:mt.call(_e))||((bt=i.value)==null?void 0:bt[1]),i.timezone,i.format,i.placeholder,i.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:k,openEnd:L,closePicker:Y,clearAll:x,isOpen:T,drpRef:G,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{var oe;d.startDate||d.endDate?d.startDate?k():L():(k(),(oe=s.value)==null||oe.focus())}});const re=$(null);return nt(()=>T.value,oe=>{if(i.disabled||i.readOnly)return;const J=re.value;J&&(oe?J.show():J.hide())},{immediate:!0}),(oe,J)=>(U(),ue("div",{class:j(oe.$style["calendar-wrapper"])},[ae(x7,{year:B.value,"onUpdate:year":J[6]||(J[6]=fe=>B.value=fe),month:V.value,"onUpdate:month":J[7]||(J[7]=fe=>V.value=fe),locale:i.locale,disabled:i.disabled,readOnly:i.readOnly,onKeydown:ee,ref_key:"navigationRef",ref:Z},{selection:me(()=>[he("div",{class:j(oe.$style["calendar-input-section"])},[ae(wP,{ref_key:"starDateRef",ref:s,"model-value":K(d).startDate,placeholder:i.startPlaceholder,timezone:i.timezone,active:K(d).isSelectingStart,onClick:k,onClear:I,onComplete:R,onInvalid:J[0]||(J[0]=fe=>c.start=!0),disabled:i.disabled,readOnly:i.readOnly,isMultipleDate:K(h)},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"]),ae(wP,{"model-value":K(d).endDate,placeholder:i.duePlaceholder,timezone:i.timezone,active:K(d).isSelectingEnd,onClick:L,onClear:O,disabled:i.disabled,onComplete:A,onInvalid:J[1]||(J[1]=fe=>c.end=!0),readOnly:i.readOnly,isMultipleDate:K(f)},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:me(({year:fe,month:Ne})=>[ae(R7,{disabled:i.disabled,disableConfirm:c.end||c.start,readOnly:i.readOnly,ref_key:"drpRef",ref:G,"tracing-case":o.value,"onUpdate:tracingCase":J[2]||(J[2]=ot=>o.value=ot),year:fe,month:Ne,"start-date":K(d).startDate,"end-date":K(d).endDate,"active-field":b.value,timezone:i.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:K(w),onSelectEnd:K(p),onGotoToday:u,onConfirm:J[3]||(J[3]=()=>{a(K(v),Y)}),onCancel:J[4]||(J[4]=ot=>l(K(m),Y)),onClose:J[5]||(J[5]=ot=>a(K(v),Y))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],2))}}),gC=wt(I7,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_f7hcw_1","calendar-input-section":"_calendar-input-section_f7hcw_10","display-wrapper":"_display-wrapper_f7hcw_18","calendar-actions":"_calendar-actions_f7hcw_22","clear-all-btn":"_clear-all-btn_f7hcw_28"}}]]),A7={ref:"mainRef"},k7=ut({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated"],setup(e,{emit:t}){const n=t,o=e,i=Io("bulkUpdate",!1),{apiServices:s}=ao(!i,o),r=async b=>{var F,A,I;C.value=!0;let R={workspaceId:o.workspaceId,itemIds:o.ids,startDate:void 0,dueDate:void 0};"start"in b&&(R.startDate=b.start?cF(b.start):null),"end"in b&&(R.dueDate=b.end?cF(b.end):null),await((A=(F=s.value)==null?void 0:F.changeDate)==null?void 0:A.call(F,R)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:R}),(I=p.value)==null||I.resetCalendarLogic()},a=()=>{if(!o.rowSelected||o.rowSelected.length===0){l();return}o.rowSelected.length===1?u():c()},l=()=>{f.value=!1,h.value=!1,_.value=[null,null]},u=()=>{const R=o.rowSelected[0].dateRange;_.value=[(R==null?void 0:R[0])??null,(R==null?void 0:R[1])??null],f.value=!1,h.value=!1},c=()=>{var R,F;if(o.rowSelected.some(A=>A.dateRange&&(A.dateRange[0]!==null||A.dateRange[1]!==null))){const A=d(0),I=d(1);if(h.value=A,f.value=I,A)_.value[0]=null;else{const O=((R=o.rowSelected[0].dateRange)==null?void 0:R[0])??null;_.value[0]=O}if(I)_.value[1]=null;else{const O=((F=o.rowSelected[0].dateRange)==null?void 0:F[1])??null;_.value[1]=O}}else h.value=!1,f.value=!1,_.value=[null,null]},d=b=>{const R=o.rowSelected.map(A=>{var I;return(I=A.dateRange)==null?void 0:I[b]});return R.length===0?!1:new Set(R.map(A=>{var I;return(I=A==null?void 0:A.getTime)==null?void 0:I.call(A)})).size>1},h=$(!1),f=$(!1),p=$(null),{triggerRef:m,popupRef:v,hide:w,isVisible:E}=lo(),_=$([null,null]);nt([()=>o.ids,()=>o.rowSelected,E],b=>{var R;a(),(R=p.value)==null||R.focus()},{immediate:!0,deep:!0});const C=$(!1);return(b,R)=>(U(),ue("div",A7,[he("div",{ref_key:"triggerRef",ref:m},[ae(ht,{variant:o.variant,loading:C.value},{default:me(()=>[ae(ft,{src:"Calendar"}),R[2]||(R[2]=st(" Date ",-1))]),_:1},8,["variant","loading"])],512),he("div",{ref_key:"popupRef",ref:v,style:{display:"none"}},[K(E)?(U(),$e(gC,{key:0,immediatelyUpdate:!1,value:_.value,onConfirmed:r,ref_key:"calendarRef",ref:p,onClosed:K(w),onStartUpdate:R[0]||(R[0]=F=>C.value=!0),onFinishUpdate:R[1]||(R[1]=F=>C.value=!1),multipleDueDates:f.value,multipleStartDates:h.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):qe("",!0)],512)],512))}}),O7=e=>{if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"},CP=al("metricStore",()=>{const e=$();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var i;if(((i=o==null?void 0:o.auth_permission)==null?void 0:i.permission)==2)return O7(o)}}}),M7=["onKeydown"],L7=["width","height","viewBox"],N7=["d"],V7="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",bP=ut({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change"],setup(e,{emit:t}){const n=e,o=t,i=$(n.modelValue??0),s=$(null),r=z(()=>{var b;return((b=n.params)==null?void 0:b.size)??24}),a=z(()=>{var b;return((b=n.params)==null?void 0:b.iconViewBox)??"0 0 24 24"}),l=z(()=>{var b;return((b=n.params)==null?void 0:b.iconPath)??V7}),u=z(()=>{var b;return((b=n.params)==null?void 0:b.wrapperTag)??"span"}),c=z(()=>{var b;return n.disabled||((b=n.params)==null?void 0:b.disabled)||!1}),d=z(()=>{var b;return n.readOnly||((b=n.params)==null?void 0:b.readOnly)||!1}),h=z(()=>!c.value&&!d.value),f=z(()=>c.value?"not-allowed":d.value?"default":"pointer");nt(()=>n.modelValue,b=>{typeof b=="number"&&b!==i.value&&(i.value=b)});const p=b=>{var R;return((R=n.params)==null?void 0:R.maxRating)-b+1<=i.value},m=b=>{console.log("RatingComponent: handleClick called with value",b),h.value&&w(b)},v=b=>{h.value&&w(b)},w=b=>{var F,A;if(!h.value)return;let R=((F=n.params)==null?void 0:F.maxRating)-b+1;R===i.value&&(R=0),i.value=R,o("update:modelValue",R),o("update",R),o("change",R),(A=n.params)!=null&&A.onUpdate&&n.params.onUpdate(R)},E=b=>{var R;b!==i.value&&(i.value=b,o("update:modelValue",b),o("update",b),o("change",b),(R=n.params)!=null&&R.onUpdate&&n.params.onUpdate(b))},_=()=>{h.value&&(i.value=i.value+1%(n.params.maxRating+1),E(i.value))},C=()=>{h.value&&(i.value=(i.value-1+(n.params.maxRating+1))%(n.params.maxRating+1),E(i.value))};return(b,R)=>(U(),ue("div",{class:j(["rating-component",{"rating-component--disabled":c.value,"rating-component--readOnly":d.value}]),style:on({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:s,tabindex:"0",onKeydown:[iu(Gt(C,["prevent"]),["left"]),iu(Gt(_,["prevent"]),["right"]),iu(Gt(C,["prevent"]),["down"]),iu(Gt(_,["prevent"]),["up"])]},[(U(!0),ue(Pt,null,Tn(e.params.maxRating,F=>(U(),$e(BE(u.value),{key:F,class:j(["rating-item",{filled:p(F),"rating-item--disabled":c.value,"rating-item--readOnly":d.value}]),style:on({cursor:f.value,order:e.params.maxRating-F,height:r.value+"px",width:r.value+"px"}),"aria-checked":p(F),"aria-disabled":c.value,"aria-readOnly":d.value,tabindex:-1,onClick:Gt(A=>m(F),["prevent","stop"]),onKeyup:[iu(Gt(A=>v(F),["prevent"]),["enter"]),iu(Gt(A=>v(F),["prevent"]),["space"])]},{default:me(()=>[Tt(b.$slots,"icon",{index:F,filled:p(F),size:r.value,iconViewBox:a.value,disabled:c.value,readOnly:d.value},()=>[(U(),ue("svg",{class:"rating-icon",width:r.value,height:r.value,viewBox:a.value,"aria-hidden":"true",focusable:"false"},[he("path",{d:l.value},null,8,N7)],8,L7))]),Tt(b.$slots,"overlay",{index:F,filled:p(F),disabled:c.value,readOnly:d.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","onClick","onKeyup"]))),128))],46,M7))}}),B7={style:{maxWidth:"180px",lineHeight:"15px"}},H7=["innerHTML"],SP=ut({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close"],setup(e,{expose:t,emit:n}){const o=cn,i=e,s=n,r=()=>{console.log("Closing MetricEditorDropdown"),s("close")},a=m=>{var v;if(m.format_type==="dropdown"&&m.format_value)try{const w=JSON.parse(m.format_value);if(Array.isArray(w)){const E=w.map(_=>({label:_.name,value:_.name,id:_.name}));return E.unshift({label:"-",value:void 0,id:"-"}),E}}catch(w){console.error("Failed to parse dropdown options",w)}if(m.format_type=="number"&&m.restricted_type=="exact"){const w=((v=m.restricted_value)==null?void 0:v.split(",").map(E=>({label:m.mapping[`!${E}`]||E,value:E,id:E})))||[];return w.unshift({label:"-",value:void 0,id:"-"}),w}return[]},l=z(()=>a(i.config)),u=$(i.modelValue),c=m=>{u.value=m,s("update:modelValue",m),s("change",m||null)},d=$(l.value),h=$(!1),f=m=>{h.value=!0,m?d.value=l.value.filter(v=>v.label.toLowerCase().includes(m.toLowerCase())):d.value=l.value,setTimeout(()=>{h.value=!1},300)},p=$(null);return an(()=>{var m;(m=p.value)==null||m.focus()}),t({focus:()=>{var m;(m=p.value)==null||m.focus()}}),(m,v)=>(U(),$e(ll,{style:{width:326},loading:h.value,options:d.value,"selected-id":e.modelValue||void 0,onSearch:f,onSelect:v[0]||(v[0]=w=>c(w.id)),ref_key:"searchListRef",ref:p,onClose:r,onCancel:r},{item:me(({item:w,getHighlightedLabel:E,selectedIndex:_,index:C})=>[ae(ea,{hover:_==C,selected:w.value===e.modelValue,label:w.label,onSelect:b=>c(w.value||null)},{label:me(()=>[he("div",B7,[Ke(he("span",{innerHTML:E(w.label)},null,8,H7),[[K(o),{content:w.label}]])])]),_:2},1032,["hover","selected","label","onSelect"])]),"empty-list":me(()=>[...v[1]||(v[1]=[st("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),EP=ut({__name:"MetricEditorInput",props:{config:{},modelValue:{}},emits:["update:modelValue","handleChange"],setup(e,{emit:t}){const n=e,o=$(n.modelValue),i=$(n.modelValue),s=z(()=>{var p;let f="";return Number((p=n.config)==null?void 0:p.format_value)&&(f+="."+Array.from({length:Number(n.config.format_value)}).map(()=>"0").join("")),`0${f}`});nt(()=>n.modelValue,f=>{o.value=f,i.value=f});const r=f=>f5(n.config,f),a=t,l=$(null),u=f=>{console.log("MetricEditorInput: handleEnter called",f),f!==i.value&&(o.value=f,a("update:modelValue",f),a("handleChange",f||null),i.value=f)},c=f=>{console.log("MetricEditorInput: handleBlur called",f),f!==i.value&&(o.value=f,a("update:modelValue",f),a("handleChange",f||null),i.value=f)},d=()=>{var f;console.log("MetricEditorInput: handleClear called"),o.value=null,i.value=null,a("update:modelValue",null),(f=l.value)==null||f.focus()},h=()=>{console.log("MetricEditorInput: handleCancel called - reverting to:",i.value),o.value=i.value,a("update:modelValue",i.value),a("handleChange",i.value)};return an(()=>{var f;(f=l.value)==null||f.focus()}),(f,p)=>(U(),$e(fC,{modelValue:o.value,"onUpdate:modelValue":p[0]||(p[0]=m=>o.value=m),placeholder:s.value,validatorFnc:r,style:{"--bg-input":"#FAFAFA"},onEnterValue:u,onBlur:c,onClear:d,onCancel:h,type:"number",ref_key:"inputRef",ref:l},null,8,["modelValue","placeholder"]))}}),$7=["max"],G7={key:2},W7={class:"wrapper-suffix"},U7={key:3},z7=wt(ut({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","loseFocus","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=e,i=$(null),s=$(0),r=z(()=>lF(o.config)),a=z(()=>!!L.value),l=()=>{I("loseFocus")},u=()=>{k(),I("loseFocus")},c=()=>{k(),b()},d=()=>(o.config.format_symbol||"").split(/[\s-_]+/).map(G=>G.charAt(0).toUpperCase()+G.slice(1)).join("").replace(/Outline|Solid/g,""),h=$(null),f=$(!0),p=z(()=>{var V;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((V=i.value)==null?void 0:V.length)===0,wrapperRef:x,active:a,focus:o.focus,bordered:!0}}),m=$(null),v=z(()=>f.value),w=z(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:s.value===0,wrapperRef:m,active:v,focus:f.value,bordered:!0})),{argsMain:E}=Co(w),{argsMain:_}=Co(p),C=$(null),b=()=>{var V;(V=C.value)==null||V.focus()},R=V=>{var G;if(V.format_type==="dropdown"&&V.format_value)try{const ve=JSON.parse(V.format_value);if(Array.isArray(ve))return ve.map(pe=>({label:pe.name,value:pe.name,id:pe.name}))}catch(ve){console.error("Failed to parse dropdown options",ve)}return V.format_type=="number"&&V.restricted_type=="exact"?((G=V.restricted_value)==null?void 0:G.split(",").map(pe=>({label:V.mapping[`!${pe}`]||pe,value:pe,id:pe})))||[]:[]},F=z(()=>R(o.config)),A=z(()=>{var V;return((V=F.value.find(G=>G.value===i.value))==null?void 0:V.label)||i.value||"-"}),I=n,O=()=>{r.value=="rating"?I("updateMetric",s.value==0?null:s.value):I("updateMetric",i.value||null),k()},{triggerRef:x,popupRef:T,hide:k,isVisible:L,show:Y}=lo({appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),ee=()=>{switch(r.value){case"dropdown":Y(),jt(()=>{var V;(V=h.value)==null||V.focus()});break;case"rating":f.value=!0,jt(()=>{var V;(V=B.value)==null||V.focus()});break}};t({resetState:()=>{i.value=null,s.value=0},focus:ee});const Z=V=>{V.preventDefault(),V.key==="ArrowRight"||V.key==="ArrowUp"?s.value<(o.config.range||5)&&(s.value+=1):V.key==="ArrowLeft"||V.key==="ArrowDown"?s.value>0&&(s.value-=1):V.key==="Enter"||(V.key==="Tab"?f.value=!1:V.key=="Escape"&&(console.log("escape key pressed"),V.preventDefault(),V.stopImmediatePropagation(),V.stopPropagation()))},B=$(null);return an(()=>{jt(()=>{if(m.value){const V=m.value.rootEl;console.log("triggerRef2",V),V==null||V.addEventListener("keyup",G=>{console.log("keypress event",G),Z(G)})}setTimeout(()=>{ee()},300)})}),(V,G)=>{const ve=Ma("tooltip");return U(),ue("div",{class:j(V.$style["metric-editor"])},[r.value=="number"?(U(),$e(EP,{key:0,config:o.config,modelValue:i.value,"onUpdate:modelValue":G[0]||(G[0]=pe=>i.value=pe),style:{width:"100%"},onCancel:l,onEnter:b},null,8,["config","modelValue"])):r.value=="rating"?(U(),$e(bo,Kt({key:1,"tab-index":1},K(E),{ref_key:"triggerRef2",ref:m,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{default:me(()=>[Ke(he("input",{ref_key:"ratingInputRef",ref:B,type:"number","onUpdate:modelValue":G[1]||(G[1]=pe=>s.value=pe),max:o.config.range,min:0,style:{position:"absolute","z-index":"-1"}},null,8,$7),[[oy,s.value]]),ae(bP,{params:{maxRating:o.config.range},modelValue:s.value,"onUpdate:modelValue":G[2]||(G[2]=pe=>s.value=pe)},{icon:me(()=>[ae(ft,{source:"rating",src:d()||"Star",size:14},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):r.value=="dropdown"?(U(),ue("div",G7,[ae(bo,Kt(K(_),{ref_key:"triggerRef",ref:x,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:me(({})=>[he("div",W7,[ae(ft,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:me(()=>[Ke((U(),ue("span",null,[st(yt(A.value||""),1)])),[[ve,{content:A.value}]])]),_:1},16),he("div",{ref_key:"popupRef",ref:T},[K(L)?(U(),$e(SP,{key:0,ref_key:"metricEditorDropdownRef",ref:h,config:o.config,modelValue:i.value,"onUpdate:modelValue":G[3]||(G[3]=pe=>i.value=pe),onChange:c,onCancel:u},null,8,["config","modelValue"])):qe("",!0)],512)])):(U(),ue("span",U7,"Formular")),Ke((U(),$e(ht,{ref_key:"confirmButtonRef",ref:C,onHandleClick:O},{default:me(()=>[ae(ft,{src:"Check"})]),_:1})),[[ve,"Update"]])],2)}}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_g3nkq_1","dropdown-trigger":"_dropdown-trigger_g3nkq_10"}}]]),j7=wt(ut({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate"],setup(e,{expose:t,emit:n}){const o=e,i=n,s=u=>{i("handleUpdate",{id:o.config.id.toString(),value:u})},r=()=>{console.log("MetricBulkItem: handleLoseFocus called"),a.value=!1,i("loseFocus")},a=$(!1);nt(a,u=>{u&&i("open")});const l=$(null);return t({hide:()=>{var u;a.value=!1,(u=l.value)==null||u.resetState()},show:()=>{var u;a.value=!0,(u=l.value)==null||u.focus()}}),(u,c)=>{const d=Ma("tooltip");return U(),ue("div",{class:j([u.$style["metric-item"],a.value?u.$style.open:""])},[he("div",{class:j(u.$style["metric-label"]),onClick:c[0]||(c[0]=Gt(h=>a.value=!a.value,["stop"]))},[Tt(u.$slots,"default",{open:a.value},()=>[Ke((U(),ue("span",{class:j(u.$style["metric-name"])},[st(yt(e.label),1)],2)),[[d,{content:e.label}]]),e.morpheme?(U(),ue("small",{key:0,class:j(u.$style["metric-morpheme"])}," ("+yt(e.morpheme)+") ",3)):qe("",!0)])],2),ae(T2,{mode:"out-in",name:"slide"},{default:me(()=>[a.value?(U(),$e(z7,{"read-only":!1,focus:a.value,onLoseFocus:r,ref_key:"metricEditorRef",ref:l,onUpdateMetric:s,key:`editor-${e.label}`,type:e.type,config:e.config,"attach-to":o.attachTo},null,8,["focus","type","config","attach-to"])):qe("",!0)]),_:1})],2)}}}),[["__cssModules",{$style:{"metric-item":"_metric-item_1lcgq_1","metric-label":"_metric-label_1lcgq_9",open:"_open_1lcgq_15","metric-editor":"_metric-editor_1lcgq_19","dropdown-trigger":"_dropdown-trigger_1lcgq_38","metric-name":"_metric-name_1lcgq_46"}}]]),K7=(e,t,n,o)=>{const{apiServices:i}=ao(n,o),s=$(!1);return{isUpdating:s,handleUpdate:async a=>{var u;console.log("Initiating bulk metric update for metric ID:",e.value.itemIds,a.id,"with value:",a.value);const l=a.value;s.value=!0;try{const c={itemIds:e.value.itemIds,metricId:a.id,workspaceId:String(e.value.workspaceId)};a.value==null?c.clear=1:c.value=l;const d=await((u=i.value)==null?void 0:u.bulkUpdateMetric(c));(d==null?void 0:d.message)=="Done"&&t(a),console.log("Bulk metric update response:",d)}catch(c){console.error("Error during bulk metric update:",c)}s.value=!1}}},q7={class:"metric-label"},Y7=["innerHTML"],Z7={key:0,class:"metric-morpheme"},X7=wt(ut({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{}},emits:["update"],setup(e,{emit:t}){const n=CP(),{metricList:o}=ri(n),i=z(()=>o.value?o.value.filter(x=>!x.formula).filter(x=>{var T;return((T=x.auth_permission)==null?void 0:T.permission)==2}).map(x=>({id:String(x.id),label:String(x.name),value:String(x.id),description:x.morpheme_value?`(${String(x.morpheme_value)})`:"",type:n.checkEditType(x),metricConfig:x})):[]),s=$(i.value),r=e,a=t,l=$([]),u=$(null),c=x=>{var k;console.log("Open item:",x);const T=i.value.findIndex(L=>L.id===x.id);u.value=T,d(T),(k=l.value[T])==null||k.show()},d=x=>{u.value=x,l.value.forEach((T,k)=>{k!==x&&T&&T.hide()})},h=$(""),f=$(null),{popupRef:p,triggerRef:m,hide:v,isVisible:w}=lo({appendTo:f.value||void 0}),E=()=>{h.value="",l.value.forEach(x=>{x==null||x.hide()}),u.value=null,v()},_=z(()=>r.selectedIds||[]),C=z(()=>({itemIds:_.value,workspaceId:String(r.workspaceId)})),{handleUpdate:b,isUpdating:R}=K7(C,x=>{a("update",x),E()},!1,r),F=()=>{u.value=null,jt(()=>{var x,T;(x=A.value)==null||x.focus(),(T=A.value)==null||T.reset()})},A=$(null);nt(()=>w.value,x=>{var T;x?(T=A.value)==null||T.focus():E()});const I=$(!1),O=x=>{I.value=!0,h.value=x,x?s.value=i.value.filter(T=>T.label.toLowerCase().includes(x.toLowerCase())):s.value=i.value,setTimeout(()=>{jt(()=>{I.value=!1})},300)};return(x,T)=>(U(),ue("div",{ref_key:"wrapperRef",ref:f},[ae(ht,{class:"action-button",variant:r.variant,ref_key:"triggerRef",ref:m,loading:K(R)},{default:me(()=>[ae(ft,{src:"SquareRootVariable",class:"icon"}),T[0]||(T[0]=st(" Metric ",-1))]),_:1},8,["variant","loading"]),he("div",{ref_key:"popupRef",ref:p,style:{display:"none","border-radius":"4px"}},[ae(ll,{loading:I.value,ref_key:"searchListRef",ref:A,style:{width:"320px"},options:s.value,"selected-id":void 0,onSearch:O,onSelect:c},{item:me(({item:k,index:L,getHighlightedLabel:Y,selectedIndex:ee})=>[ae(j7,{ref:Z=>l.value[L]=Z,label:k.label,type:k.type,morpheme:k.description||"",onOpen:Z=>d(L),attachTo:K(p),config:k.metricConfig,onHandleUpdate:K(b),onLoseFocus:F,class:j(["metric-update-item",{selected:u.value===L||ee===L}])},{default:me(({open:Z})=>[he("div",q7,[he("div",{class:"metric-title",innerHTML:Y(k.label)},null,8,Y7),Z?(U(),ue("div",Z7,yt(k.description),1)):qe("",!0)])]),_:2},1032,["label","type","morpheme","onOpen","attachTo","config","onHandleUpdate","class"])]),"extra-item":me(()=>[...T[1]||(T[1]=[he("div",{style:{width:"320px"}},null,-1)])]),"empty-list":me(()=>[...T[2]||(T[2]=[st("No options available.",-1)])]),_:1},8,["loading","options"])],512)],512))}}),[["__scopeId","data-v-97422330"]]),RP=wt(ut({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,i=n,{hide:s,triggerRef:r,popupRef:a,isVisible:l}=lo({placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=z(()=>l.value);nt(l,h=>{i(h?"open":"close")});const c=()=>{s()};t({closeDropdown:c,isOpen:u});const d=h=>{h.key==="Escape"&&a.value&&s()};return an(()=>{var f;const h=r.value instanceof HTMLElement?r.value:(f=r.value)==null?void 0:f.$el;h&&h.addEventListener("keydown",d)}),Yn(()=>{var f;const h=r.value instanceof HTMLElement?r.value:(f=r.value)==null?void 0:f.$el;h&&h.removeEventListener("keydown",d)}),(h,f)=>(U(),ue("div",{ref_key:"triggerRef",ref:r,class:j(h.$style["dropdown-wrapper"])},[Tt(h.$slots,"trigger",{open:K(l)},()=>[he("button",{class:j(h.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),he("div",{ref_key:"popupRef",ref:a,class:j(h.$style["dropdown-content"]),style:on({display:K(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Tt(h.$slots,"content",{closeDropdown:c,visible:K(l)},()=>[he("div",{class:j(h.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_1fn64_1","dropdown-content":"_dropdown-content_1fn64_5","dropdown-list":"_dropdown-list_1fn64_9"}}]]),_P=ut({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","error","cancel","start-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},i=e,s=n,r=$([]),a=$(!1),l=$(!1),u=$(null),c=$(o.INITIAL_PAGE),d=$(!0),h=$(0),f=$(""),p=z(()=>{var O;return(O=i.value)==null?void 0:O.id}),m=z(()=>!!(i.id||i.ids&&i.ids.length>0)),v=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),w=z(()=>{const O=new Set;return i.id&&O.add(String(i.id)),i.ids&&i.ids.forEach(x=>{x&&O.add(String(x))}),Array.from(O)}),E=Io("bulkUpdate",!1),{apiServices:_}=ao(!E,i),C=async(O=o.INITIAL_PAGE,x="",T=!1)=>{var k,L,Y,ee;if(!m.value){console.error("Missing required props",i);return}T?l.value=!0:a.value=!0,u.value=null;try{const Z={workspaceId:String(i.workspaceId),itemIds:w.value,page:O,perPage:o.PER_PAGE,name_like:x.trim()};if(((k=_.value)==null?void 0:k.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const B=await((L=_.value)==null?void 0:L.getAssignableStatus(Z));if(!(B!=null&&B.data)){T||(r.value=[]),d.value=!1;return}const V=B.data.map(v);r.value=T?[...r.value,...V]:V,h.value=((Y=B.meta)==null?void 0:Y.total)??B.data.length,d.value=!((ee=B.meta)!=null&&ee.on_last_page),c.value=O}catch(Z){console.error("Error fetching statuses:",Z),u.value="Failed to load statuses",T||(r.value=[]),d.value=!1,s("error",u.value)}finally{a.value=!1,l.value=!1}},b=Es(async O=>{f.value=O,c.value=o.INITIAL_PAGE,await C(o.INITIAL_PAGE,O,!1)},hr),R=async()=>{!d.value||l.value||await C(c.value+1,f.value,!0)},F=async O=>{var x,T,k;if(!m.value){console.error("Missing required props for updating status",i);return}try{s("start-update");const L=await _.value.updateItemStatus({workspaceId:String(i.workspaceId),itemIds:w.value,statusId:String(O.value)});if(!(L!=null&&L.message))throw s("error","API did not return success"),new Error("API did not return success");i.params&&((T=i.params)==null||T.node.setData({...(x=i.params)==null?void 0:x.node.data,status:{id:O.id,name:O.label,color:O.color}}),(k=i.params)==null||k.api.stopEditing()),s("updated",{workspaceId:String(i.workspaceId),itemIds:w.value,data:{id:O.id,name:O.label,color:O.color}})}catch(L){console.error("Error updating status:",L),u.value="Failed to update status",s("error",u.value)}},A=z(()=>r.value.map(O=>({...O})));nt([()=>i.id,()=>i.workspaceId,()=>i.ids],()=>{C()},{deep:!0,immediate:!0}),t({refresh:()=>C(o.INITIAL_PAGE,f.value,!1),loadMore:R});const I=$(null);return an(()=>{jt(()=>{var O;(O=I.value)==null||O.focus()})}),(O,x)=>{var T;return U(),$e(ll,Kt({ref_key:"popupRef",ref:I},i,{"selected-id":(T=i.value)==null?void 0:T.id,options:A.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:K(b),onSelect:F,onLoadMore:R,onCancel:x[0]||(x[0]=k=>s("cancel"))}),null,16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),J7=ut({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{}},emits:["updated"],setup(e,{emit:t}){const n=e,o=z(()=>{const p=so();return p==null?void 0:p.appContext.config.globalProperties.apiServices}),{popupRef:i,triggerRef:s,isVisible:r,hide:a}=lo(),l=t,u=$(!1),c=p=>{u.value=!1,l("updated",p),a()},d=z(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId})),h=$(null),f=p=>{p.key==="Escape"&&i.value&&a()};return an(()=>{var m;const p=h.value instanceof HTMLElement?h.value:(m=h.value)==null?void 0:m.$el;p&&p.addEventListener("keydown",f)}),Yn(()=>{var m;const p=h.value instanceof HTMLElement?h.value:(m=h.value)==null?void 0:m.$el;p&&p.removeEventListener("keydown",f)}),Va("bulkUpdate",!0),(p,m)=>(U(),ue("div",{ref_key:"mainRef",ref:h},[ae(ht,{ref_key:"triggerRef",ref:s,variant:e.variant,loading:u.value},{default:me(()=>[ae(ft,{src:"Square",class:"icon"}),m[2]||(m[2]=st(" Status ",-1))]),_:1},8,["variant","loading"]),he("div",{ref_key:"popupRef",ref:i},[K(r)?(U(),$e(_P,Kt({key:0},d.value,{onUpdated:c,onCancel:K(a),onStartUpdate:m[0]||(m[0]=v=>u.value=!0),onError:m[1]||(m[1]=v=>u.value=!1)}),null,16,["onCancel"])):qe("",!0)],512)],512))}}),mC=al("bulkUpdate",()=>{const e=vi({loaded:0,total:0}),t=c=>{e.total=c},n=c=>{e.loaded=c},o=vi({isBulkUpdating:!1});function i(c){o.isBulkUpdating=c}const s=$({}),r=c=>{s.value=c},a=(c,d)=>{s.value[c]=d},l=$(0);return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:s,setSelectionIds:r,setCheckedForId:a,setSelectionStatus:c=>{l.value=c},selectionStatus:l,rowCount:e,setTotalRowCount:t,setLoadedRowCount:n}}),Q7=wt(ut({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated"],setup(e,{emit:t}){const n=cn,o=e,i=t,s=mC(),{selectionStatus:r}=ri(s),a=z(()=>o.selectRowData.map(L=>L.id));Va("bulkUpdate",!0);const l=({itemIds:L,data:Y})=>{const ee=o.gridApi;L.forEach(Z=>{if(!ee){console.error("Grid API is undefined");return}const B=ee.getRowNode(Z);if(B){const V={...B.data,status:Y};B.setData(V)}})},u=z(()=>o.selectRowData),c=({itemIds:L,data:Y})=>{const ee=o.gridApi;if(!ee){console.error("Grid API is undefined");return}L.forEach(Z=>{const B=ee.getRowNode(Z);if(B){const V=B.data.dateRange||[null,null];"startDate"in Y&&Y.startDate!==void 0&&(V[0]=Y.startDate?new Date(Y.startDate):null),"dueDate"in Y&&Y.dueDate!==void 0&&(V[1]=Y.dueDate?new Date(Y.dueDate):null);const G={...B.data,dateRange:V};B.setData(G)}}),i("updated")},d=z(()=>o.selectRowData.map(L=>L.id)),h=L=>{const Y=o.gridApi,{id:ee,value:Z}=L;if(!Y){console.error("Grid API is undefined");return}d.value.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,[`metric_${ee}`]:Z};V.setData(G)}}),console.log("Metric updated:",L),i("updated")},f=["primary"],p=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],m=()=>{i("unselect")},v=uC(),{userPermissions:w}=ri(v),E=z(()=>w.value.includes(cC)),_=()=>{const L=o.selectRowData.map(ee=>ee.id).join(","),Y=ni({type:"review_multiple_scenes",config:{reviewDomain:Mn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:L}}).url;window.open(Y,"_blank")},C=L=>{const{assignees:Y,type:ee}=L,Z=o.gridApi;if(!Z){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(V=>{const G=Z.getRowNode(V.id);if(!G)return null;const ve=G.data.assignees||[];let pe=[];switch(ee){case"add":{const re=new Set(ve.map(J=>J.id)),oe=Y.filter(J=>!re.has(J.id));pe=[...ve,...oe];break}case"overwrite":{pe=Y;break}case"remove":{const re=new Set(Y.map(oe=>oe.id));pe=ve.filter(oe=>!re.has(oe.id));break}case"removeAll":{pe=[];break}}return{...G.data,assignees:pe}}).filter(V=>V!==null).forEach(V=>{const G=Z.getRowNode(V.id);G&&G.setData(V)})},{apiServices:b}=ao(!1,o),R=async()=>{var Z;const L=o.selectRowData.map(B=>B.id),Y=o.gridApi;if(!Y){console.error("Grid API is not available for bulk delete.");return}const ee=await((Z=b.value)==null?void 0:Z.bulkDeleteItems(String(o.workspaceId),L));(ee==null?void 0:ee.message)=="Done"&&(L.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,isDeleted:!0,disabled:!0};V.setData(G)}}),Y.deselectAll())},F=async()=>{var Z;const L=o.selectRowData.map(B=>B.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const ee=await((Z=b.value)==null?void 0:Z.bulkUnarchiveItems(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to unarchive items.");return}I(L,"isArchived",!1)},A=async()=>{var Z;const L=o.selectRowData.map(B=>B.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const ee=await((Z=b.value)==null?void 0:Z.bulkArchiveItems(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to archive items.");return}I(L,"isArchived",!0)},I=(L,Y,ee)=>{const Z=o.gridApi;if(!Z){console.error("Grid API is not available for bulk update.");return}const B=L.map(V=>{const G=Z.getRowNode(V);if(G){const ve={...G.data,[Y]:ee};G.setData(ve)}return G}).filter(V=>V!=null);Z.redrawRows({rowNodes:B})},O=async()=>{var Z;const L=o.selectRowData.map(B=>B.id),Y=o.gridApi;if(!Y){console.error("Grid API is not available for bulk thumbnail deletion.");return}const ee=await((Z=b.value)==null?void 0:Z.deleteThumbnail(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to delete thumbnails.");return}L.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,thumbnail:null};V.setData(G)}})},x=async()=>{var Z;const L=o.selectRowData.map(B=>B.id),Y=o.gridApi;if(!Y){console.error("Grid API is not available for bulk rendition deletion.");return}const ee=await((Z=b.value)==null?void 0:Z.deleteRendition(String(o.workspaceId),L));if((ee==null?void 0:ee.message)!="Done"){console.error("Failed to delete renditions.");return}L.forEach(B=>{const V=Y.getRowNode(B);if(V){const G={...V.data,rendition:null};V.setData(G)}})},T=$(!1),k=async L=>{switch(T.value=!0,L.id){case"unarchive":await F();break;case"delete":await R();break;case"archive":await A();break;case"delete-thumbnail":await O();break;case"delete-rendition":await x();break;default:console.error("Unknown action:",L.id),T.value=!1;break}jt(()=>{T.value=!1})};return(L,Y)=>Ke((U(),ue("div",{class:j(L.$style["bulk-update-action"])},[he("div",{class:j(L.$style["left-actions"])},[he("div",{class:j(L.$style["selection-track"])},[ae(ht,{variant:["icon","tertiary"],onClick:m},{default:me(()=>[ae(ft,{src:"XMarkSolid",source:"remote"})]),_:1}),K(r)==1?(U(),ue("span",{key:0,class:j(L.$style["selected-count"])},yt(e.selectRowData.length)+" selected ",3)):qe("",!0),K(r)==2?(U(),ue("span",{key:1,class:j(L.$style["selected-count"])}," All in "+yt(e.takeName),3)):qe("",!0),he("span",{class:j(L.$style.divider)},null,2)],2),ae(J7,{ids:a.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:f,onUpdated:l},null,8,["ids","workspace-id","entity-id"]),ae(C7,{onUpdate:C,ids:a.value,"workspace-id":e.workspaceId,variant:f,"entity-id":e.entityId},null,8,["ids","workspace-id","entity-id"]),ae(k7,{ids:a.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:f,"row-selected":u.value,onUpdated:c},null,8,["ids","workspace-id","entity-id","row-selected"]),ae(X7,{onUpdate:h,selectedIds:a.value,"workspace-id":e.workspaceId,variant:f,"entity-id":e.entityId},null,8,["selectedIds","workspace-id","entity-id"]),he("span",{class:j(L.$style.divider)},null,2),E.value?Ke((U(),$e(ht,{key:0,class:j(L.$style["action-button"]),variant:[...f,"icon"],onClick:_},{default:me(()=>[ae(ft,{src:"PenRuler",class:j(L.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant"])),[[K(n),{content:"Open in Review"}]]):qe("",!0),he("span",{class:j(L.$style.divider)},null,2),ae(RP,{placement:"top-end"},{trigger:me(({open:ee})=>[Ke((U(),$e(ht,{actived:ee,class:j(L.$style["action-button"]),variant:[...f,"icon"],loading:T.value},{default:me(()=>[ae(ft,{src:"EllipsisVertical",class:j(L.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["actived","class","variant","loading"])),[[K(n),{content:"More actions"}]])]),content:me(({visible:ee,closeDropdown:Z})=>[(U(),ue(Pt,null,Tn(p,B=>ae(ea,Kt({key:B.id,selected:!1},{ref_for:!0},B,{show:ee,onSelect:()=>{k(B),Z()}}),null,16,["show","onSelect"])),64))]),_:1})],2)],2)),[[ir,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_o4psi_1","left-actions":"_left-actions_o4psi_19","right-actions":"_right-actions_o4psi_20","selection-track":"_selection-track_o4psi_25","close-icon":"_close-icon_o4psi_30","selected-count":"_selected-count_o4psi_34",divider:"_divider_o4psi_37","more-button":"_more-button_o4psi_42",dropdown:"_dropdown_o4psi_46","dropdown-content":"_dropdown-content_o4psi_49",delete:"_delete_o4psi_72","icon-btn":"_icon-btn_o4psi_79","selected-list":"_selected-list_o4psi_83"}}]]),ta=wt(ut({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Xo,n=cn,o=e,i=z(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:s}=Co(i),r=z(()=>{var l,u,c;return!!((l=o.params)!=null&&l.api||(u=o.params)!=null&&u.node||(c=o.params)!=null&&c.context)}),a=z(()=>o.value===void 0);return(l,u)=>Ke((U(),$e(bo,df(Wf(K(s))),{default:me(()=>[he("span",{class:j(l.$style["item-table-label-renderer"])},yt(o.value||"-"),3)]),_:1},16)),[[K(t),{isLoading:a.value||!r.value}],[K(n),o.tooltip?o.tooltip:{content:void 0}]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),e9=["placeholder","maxlength"],t9={key:0,class:"wrapper-suffix"},n9=wt(ut({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Xo,i=cn,s=e,r=n,a=$(s.value),l=$(null),u=$(null),c=z(()=>{var b;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:((b=s.value)==null?void 0:b.length)===0,inputRef:l,wrapperRef:u,clickable:!0}}),{argsMain:d,isFocus:h}=Co(c),f=b=>{const R=document.createElement("div");return R.textContent=b,R.innerHTML},p=b=>{h.value=!1,C.value=a.value,r("update:value",a.value)},m=b=>{if(!h.value||!l.value)return;const R=f(l.value.value);r("update:value",R),r("enter",R),h.value=!1},v=b=>{var R;if(b.key==="ArrowLeft"||b.key==="ArrowRight"){b.stopPropagation();return}b.ctrlKey&&b.key=="a"||b.key=="A"?(b.stopPropagation(),(R=l.value)==null||R.select()):b.key==="Enter"?(b.preventDefault(),b.stopPropagation(),m()):b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),p())},w=()=>{a.value=s.value,h.value=!0,jt(()=>{var b;(b=l.value)==null||b.focus()})},E={focus:()=>{var b;h.value=!0,(b=l.value)==null||b.focus()}};an(()=>{const b=u.value.$el;b&&(b.__sceneNameEditor=E)}),Yn(()=>{const b=u.value;b&&delete b.__sceneNameEditor}),t({focus:()=>{w()}});const _=z(()=>s.value===void 0),C=$(s.value||"");return vP(u,b=>{h.value&&m()}),(b,R)=>Ke((U(),$e(K(bo),Kt(K(d),{ref_key:"wrapperRef",ref:u}),Wc({default:me(()=>[K(h)?qe("",!0):Tt(b.$slots,"default",{key:0},()=>[Ke((U(),ue("span",{class:j(b.$style["label-renderer"])},[st(yt(C.value),1)],2)),[[K(i),{content:C.value||void 0}]])]),Ke(he("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":R[0]||(R[0]=F=>C.value=F),class:j(b.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:v},null,42,e9),[[ir,K(h)],[oy,C.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:me(({hovered:F,focused:A})=>[F||A?(U(),ue("div",t9,[F&&!A?Ke((U(),$e(K(ht),{key:0,variant:["icon","secondary"],size:24,onClick:Gt(w,["prevent","stop"])},{default:me(()=>[ae(K(ft),{src:"Pen",source:"remote"})]),_:1})),[[K(i),"Edit"]]):A?Ke((U(),$e(K(ht),{key:1,variant:["icon","tertiary","danger"],size:24,onMousedown:Gt(p,["prevent"])},{default:me(()=>[ae(K(ft),{src:"XMarkSolid",source:"remote"})]),_:1})),[[K(i),"Cancel"]]):qe("",!0)])):qe("",!0)]),key:"0"}:void 0]),1040)),[[K(o),{isLoading:_.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),DP=wt(ut({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{emit:t}){const n=Mn.getInstance().getItem("ws.code"),o=Mn.getInstance().getItem("BASE_URL"),i=cn,s=Xo,r=e,a=t,l=$(r.value),u=$(r.value),c=$(null),d=$(null),h=Io("bulkUpdate",!1),{apiServices:f}=ao(!h,r),p=z(()=>{var x;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((x=l==null?void 0:l.value)==null?void 0:x.length)===0,inputRef:c,wrapperRef:d,clickable:!0}}),{isFocus:m}=Co(p),v=z(()=>{const x=n||r.workspaceId;return ni({type:"scene_hub",config:{baseDomain:o,ws_code:x,scene_id:String(r.id)}}).url}),w=z(()=>{var x,T,k;return((x=r.data)==null?void 0:x.isDeleted)==!0||((k=(T=r.data)==null?void 0:T.isProcessing)==null?void 0:k.length)>0}),E=z(()=>{var x;return(x=r.data)==null?void 0:x.isProcessing}),_=z(()=>{var x;return((x=r.data)==null?void 0:x.isArchived)==1}),C=z(()=>r.value===void 0),b=async x=>{var T,k,L,Y;l.value=x,m.value=!1;try{const ee=await((k=(T=f.value)==null?void 0:T.updateSceneName)==null?void 0:k.call(T,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:l.value})),Z=uF.get(tF)||"UTC";if(ee){const B=sF(ee,Z),V={...r.data,...B};(Y=(L=r.params)==null?void 0:L.node)==null||Y.setData(V),u.value=l.value,a("enter")}else l.value=u.value}catch(ee){console.error("Failed to update scene name:",ee),l.value=u.value}},R={focus:()=>{m.value=!0,setTimeout(()=>{var x;return(x=d.value)==null?void 0:x.focus()},0)}},F=()=>d.value?"$el"in d.value?d.value.$el:d.value:null;nt(()=>r.value,x=>{l.value=x,u.value=x}),an(()=>{const x=F();x&&(x.__sceneNameEditor=R)}),Yn(()=>{const x=d.value,T=x&&"$el"in x?x.$el:x;T&&delete T.__sceneNameEditor});const A=gP(),{openSceneHub:I}=A,O=x=>{try{if(x.ctrlKey||x.metaKey){window.open(v.value,"_blank");return}I(String(r.id))}catch{window.open(v.value,"_blank")}};return(x,T)=>Ke((U(),$e(n9,{"save-on-blur":!0,ref_key:"wrapperRef",ref:d,disabled:r.disabled,"read-only":r.readOnly||C.value,placeholder:r.placeholder,value:l.value,"onUpdate:value":T[0]||(T[0]=k=>l.value=k),id:`scene-name-${r.id}`,onEnter:b,"max-length":25},{default:me(()=>[Ke(he("div",{class:j(x.$style["scene-name-display"])},[Ke((U(),ue("a",{onClick:Gt(O,["prevent"]),target:"_blank",class:j(x.$style["scene-name-text"])},[st(yt(l.value),1)],2)),[[K(i),{content:l.value}]]),_.value?(U(),ue("div",{key:0,class:j([x.$style["icon-processing"],x.$style.archived])},[ae(ft,{src:"BoxArchive",color:"#959595"})],2)):qe("",!0),w.value?Ke((U(),ue("div",{key:1,class:j([x.$style["icon-processing"],x.$style.processing])},[ae(ft,{src:"AnimatedHourglass",color:"#DE851A"})],2)),[[K(i),E.value]]):qe("",!0)],2),[[ir,!K(m)]])]),_:1},8,["disabled","read-only","placeholder","value","id"])),[[K(s),{isLoading:C.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nlzfn_1","scene-name-display":"_scene-name-display_nlzfn_11","icon-processing":"_icon-processing_nlzfn_18",archived:"_archived_nlzfn_26",processing:"_processing_nlzfn_29","scene-name-text":"_scene-name-text_nlzfn_33"}}]]),o9=wt(ut({__name:"OptionList",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},options:{}},emits:["select"],setup(e,{emit:t}){const n=t;function o(i){n("select",i)}return(i,s)=>(U(),ue("div",{class:j(i.$style["dropdown-list"])},[(U(!0),ue(Pt,null,Tn(e.options,r=>(U(),$e(ea,Kt({key:r.value},{ref_for:!0},{...r},{"icon-name":r.icon,onClick:Gt(a=>o(r.value),["stop","prevent"])}),{label:me(()=>[st(yt(r.label),1)]),_:2},1040,["icon-name","onClick"]))),128)),e.options.length==0?(U(),ue("div",{key:0,class:j(i.$style["empty-list"])}," No options available. ",2)):qe("",!0)],2))}}),[["__cssModules",{$style:{"dropdown-list":"_dropdown-list_1d2i1_1","empty-list":"_empty-list_1d2i1_8"}}]]),vC=wt(ut({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const o=e,i=z(()=>typeof o.size=="number"?`${o.size}px`:{small:"24px",medium:"32px",large:"48px"}[o.size]??"32px"),s=z(()=>{let p=[];return typeof o.variant=="string"?p.push(o.variant):Array.isArray(o.variant)&&(p=[...o.variant]),[...p,"icon"]}),r=n,{hide:a,isVisible:l,show:u,triggerRef:c,popupRef:d,instance:h}=lo();function f(p){r("select",p),a()}return kf(()=>{h.value&&h.value.setProps({placement:o.placement})}),t({show:u,hide:a,popupRef:d}),(p,m)=>(U(),ue("div",{class:j(p.$style["button-dropdown-wrapper"]),style:on({"--button-size":i.value})},[he("div",{class:j(p.$style["button-group"])},[Tt(p.$slots,"prefix"),he("div",{ref_key:"triggerRef",ref:c,class:j(K(l)?p.$style.open:"")},[Tt(p.$slots,"triggerDropdown",{open:K(l)},()=>[o.readOnly?qe("",!0):(U(),$e(ht,{key:0,actived:K(l),class:j(p.$style["button-dropdown-trigger"]),variant:s.value,size:e.size,disabled:o.disabled},{default:me(()=>[Tt(p.$slots,"iconDropdown",{},()=>[ae(ft,{class:j(p.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["actived","class","variant","size","disabled"]))])],2)],2),he("div",{ref_key:"popupRef",ref:d,class:j(p.$style["button-dropdown-list"])},[ae(o9,{options:e.options,onSelect:f,style:{width:"max-content"}},null,8,["options"])],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_12xlv_1","button-group":"_button-group_12xlv_7","overflow-elipsis":"_overflow-elipsis_12xlv_26","button-dropdown-list":"_button-dropdown-list_12xlv_33",show:"_show_12xlv_36","button-dropdown-item":"_button-dropdown-item_12xlv_39","icon-dropdown":"_icon-dropdown_12xlv_43",open:"_open_12xlv_46"}}]]),i9=wt(ut({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=cn,n=Xo,o=Ry,i=e,{isEditing:s}=Wd(i),r=$(i.value),a=$(null),l=$(null),{apiServices:u}=ao(!0,i),c=$(!0),d=()=>{c.value=i.value===void 0};Af(()=>{d()}),an(()=>{d()}),nt(()=>i.value,b=>{d()});const h=z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:i.error,inputRef:a,wrapperRef:l,clickable:!(i.readOnly||c.value),active:s})),{argsMain:f,isHover:p}=Co(h),m=z(()=>{var b;return((b=r.value)==null?void 0:b.slice(0,i.maxVisible))||[]}),v=z(()=>{var b;return Math.max(0,(((b=r.value)==null?void 0:b.length)||0)-i.maxVisible)}),w=z(()=>{var b;return v.value<=0?"":((b=r.value)==null?void 0:b.slice(i.maxVisible).map(R=>R.name).join(", "))||""}),E=z(()=>m.value.map(b=>({id:b.id,name:b.name,initial:b.initial,avatarId:b.id,profile_image:b.profile_image,color:b.color,size:24,user:b}))),_=z(()=>({color:p.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"})),C=async b=>{var F;const R=i.workspaceId;return await((F=u.value)==null?void 0:F.getUserInformation(R,b))??void 0};return nt(()=>i.value,b=>{r.value=b},{immediate:!0,deep:!0}),(b,R)=>Ke((U(),$e(bo,Kt(K(f),{ref_key:"wrapperRef",ref:l}),{default:me(()=>{var F;return[he("div",{class:j(b.$style.assigneeGroupRenderer)},[((F=r.value)==null?void 0:F.length)===0?(U(),$e(ft,{key:0,src:"UserPlus",source:"remote",style:on(_.value)},null,8,["style"])):qe("",!0),(U(!0),ue(Pt,null,Tn(E.value,A=>Ke((U(),$e(fu,{key:A.id,readOnly:!0,class:j(b.$style["ib-assignee-avatar"]),name:A.name,initial:A.initial,id:`assignee-avatar-${A.avatarId}`,profile_image:A.profile_image,color:A.color,size:A.size},null,8,["class","name","initial","id","profile_image","color","size"])),[[K(o),{user:A.user,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:C}]])),128)),v.value>0?Ke((U(),ue("div",{key:1,class:j(b.$style["extra-avatars"])},[st(" +"+yt(v.value),1)],2)),[[K(t),w.value]]):qe("",!0)],2)]}),_:1},16)),[[K(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_1tgm9_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_1tgm9_7","ib-assignee-avatar":"_ib-assignee-avatar_1tgm9_17","assignee-wrapper":"_assignee-wrapper_1tgm9_21","extra-avatars":"_extra-avatars_1tgm9_28"}}]]),s9=wt(ut({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var b,R;const t=cn,n=Xo,o=Iw(),i=e,s=$(null),r=$(null),a=F=>{if(F){if(typeof F=="string")return F;if(F instanceof Date)return F.toISOString()}},l=z(()=>i.value===void 0),u=z(()=>{var F;return(F=i.data)==null?void 0:F.isStarted}),c=z(()=>{var F;return(F=i.data)==null?void 0:F.isCompleted}),d=z(()=>!!(i.value&&(i.value[0]||i.value[1]))),h=z(()=>d.value?i.disabled&&!i.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),f=z(()=>({disabled:i.disabled,error:!1,readOnly:i.readOnly,inputRef:s,wrapperRef:r,clickable:!0})),{argsMain:p}=Co(f),{startDate:m,endDate:v,startClasses:w,endClasses:E,fullStartDate:_,fullEndDate:C}=y5({start:a((b=i.value)==null?void 0:b[0]),end:a((R=i.value)==null?void 0:R[1]),isStarted:u.value,isEnded:c.value,timezone:i.timezone||o});return(F,A)=>Ke((U(),$e(bo,Kt(K(p),{ref_key:"wrapperRef",ref:r}),{default:me(()=>[l.value?qe("",!0):(U(),ue("div",{key:0,class:j(F.$style.dateRangeRenderer)},[d.value?qe("",!0):(U(),$e(ft,{key:0,src:"Calendar",class:j(F.$style.calendarIcon),color:h.value},null,8,["class","color"])),d.value?(U(),ue(Pt,{key:1},[Ke((U(),ue("span",{class:j([F.$style.dateLabelDisplay,...K(w).map(I=>F.$style[I])])},[st(yt(K(m)),1)],2)),[[K(t),K(_)]]),A[0]||(A[0]=he("span",null,"→",-1)),Ke((U(),ue("span",{class:j([F.$style.dateLabelDisplay,...K(E).map(I=>F.$style[I])])},[st(yt(K(v)),1)],2)),[[K(t),K(C)]])],64)):qe("",!0)],2))]),_:1},16)),[[K(n),{isLoading:l.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),r9=ut({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:Iw()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=$(null);an(()=>{jt(()=>{o.value&&o.value.focus()})});const i=e,s=n,r=v=>`${it.fromJSDate(v,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,a=async v=>{await m({startDate:v[0]?r(v[0]):null,dueDate:v[1]?r(v[1]):null})},l=async()=>{await m({startDate:null})},u=async()=>{await m({dueDate:null})},c=async v=>{await m({startDate:v?r(v):null})},d=async v=>{await m({dueDate:v?r(v):null})},h=async()=>{await m({startDate:null,dueDate:null})},f=Io("bulkUpdate",!1),{apiServices:p}=ao(!f,i),m=async v=>{var w,E,_,C,b;try{const R=(w=o.value)==null?void 0:w.getValues(),F=await((_=(E=p.value)==null?void 0:E.changeDate)==null?void 0:_.call(E,{workspaceId:i.workspaceId,itemIds:[i.id],startDate:v.startDate,dueDate:v.dueDate}));F!=null&&F.message&&((b=i.params)==null||b.node.setData({...(C=i.params)==null?void 0:C.node.data,dateRange:R==null?void 0:R.dateRange}))}catch(R){console.error("Failed to update scene name:",R)}};return t({focus:()=>{jt(()=>{var v;(v=o.value)==null||v.focus()})}}),(v,w)=>(U(),$e(gC,Kt(i,{onUpdate:a,"onUpdate:end":d,"onUpdate:start":c,onClearAll:h,onClearDue:u,onClearStart:l,onClosed:w[0]||(w[0]=E=>s("closed")),ref_key:"calendarRef",ref:o}),null,16))}}),a9=wt(ut({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=$(null),o=$(0);let i=null;an(()=>{n.value&&(i=new ResizeObserver(r=>{for(const a of r)o.value=a.contentRect.height}),i.observe(n.value))}),Gc(()=>{i&&n.value&&i.unobserve(n.value)});const s=z(()=>{const r=o.value;return r>120?r-42-36:0});return(r,a)=>(U(),ue("div",{class:j(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[he("div",{class:j(r.$style["item-header"])},[he("div",{class:j(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[he("h1",{class:j(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=st("Items",-1))])],2)])],2),he("div",{class:j(r.$style["item-header__spacer"])},null,2),he("div",{class:j(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:s.value}),he("div",{class:j(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),xP=wt(ut({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0}},emits:["actionExecuted"],setup(e,{emit:t}){const n=e,o=z(()=>(n==null?void 0:n.workspaceId)||""),i=z(()=>(n==null?void 0:n.entityId)||""),s=m=>{const v=`scene-name-${n.id}`,w=document.getElementById(v);w.__sceneNameEditor&&w.__sceneNameEditor.focus()},{apiServices:r}=ao(!0,n),a=z(()=>{var m;return{ws_code:o.value,entity_id:i.value,scene_id:n.id,axiosService:r,optionBlock:n.optionBlock,permissions:(m=n.data)==null?void 0:m.permissions}}),l=m=>{var w,E,_,C,b,R;let v=(E=(w=n.params)==null?void 0:w.api)==null?void 0:E.getRowNode(String(n.id));if(v){const F={...v.data,isDeleted:m==="deleted",isArchived:m==="archived"?!0:v.data.isArchived,disabled:!0};(C=(_=n.params)==null?void 0:_.api)==null||C.redrawRows({rowNodes:[v]}),v.setData(F),(R=(b=n.params)==null?void 0:b.api)==null||R.redrawRows({rowNodes:[v]})}},{options:u}=e7(a,l,s),c=t,d=m=>{var v,w;m.id!=="copy-link"&&((w=(v=n==null?void 0:n.params)==null?void 0:v.api)==null||w.stopEditing()),c("actionExecuted",m)},h=m=>{var v,w,E,_;return m=="archive"?!((w=(v=n.params)==null?void 0:v.data)!=null&&w.isArchived):m==="unarchive"?(_=(E=n.params)==null?void 0:E.data)==null?void 0:_.isArchived:!0},f=m=>m.map(v=>({...v,options:v.options.filter(w=>!w.hide)})),p=z(()=>f(u.value));return(m,v)=>(U(),ue("div",{class:j([m.$style["more-option-section"],{[m.$style.submenu]:e.isSubmenu}])},[(U(!0),ue(Pt,null,Tn(p.value,w=>(U(),ue("div",{key:w.id,style:on({"--g-number":Math.min(w.options.filter(E=>!E.hide&&h(E.id)).length,4),"--g-size":w.type=="column"?"40px":"auto"}),class:j([m.$style["option-block"],m.$style[w.type]])},[(U(!0),ue(Pt,null,Tn(w.options.filter(E=>!E.hide&&h(E.id)),E=>(U(),ue("div",{key:E.id,class:j(m.$style["option-item"])},[!E.hide&&h(E.id)?(U(),$e(u9,{key:0,layer:n.layer,"scene-id":String(n.id),option:E,type:w.type,onActionExecuted:d},null,8,["layer","scene-id","option","type"])):qe("",!0)],2))),128))],6))),128))],2))}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1xceh_1","option-block":"_option-block_1xceh_8","option-item":"_option-item_1xceh_18",row:"_row_1xceh_22",column:"_column_1xceh_28",block:"_block_1xceh_32"}}]]),l9={key:0},u9=wt(ut({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{}},emits:["actionExecuted"],setup(e,{emit:t}){const n=cn,o=e,i=$(!1),s=$(!1),r=(C,b)=>{if(!b){h();return}const R=b.target;R.closest(".tippy-content")||R.closest(".tippy-box")||R.closest("[data-tippy-root]")||R.closest(".option-item")||h()},a=$(null),{triggerRef:l,popupRef:u,show:c,isVisible:d,hide:h}=lo({interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:r,appendTo:a.value||void 0}),f=t,p=async C=>{var b,R;if(!s.value){s.value=!0;try{await((R=(b=o.option).action)==null?void 0:R.call(b,C)),f("actionExecuted",o.option)}catch(F){console.error("Action execution failed:",F)}finally{s.value=!1,i.value=!1}}},m=async C=>{var b,R;if(C.preventDefault(),C.stopPropagation(),!s.value){if(o.option.isDanger){i.value=!i.value;return}if(!o.option.subMenu){s.value=!0;try{await((R=(b=o.option).action)==null?void 0:R.call(b,C)),f("actionExecuted",o.option)}catch(F){console.error("Action execution failed:",F)}finally{s.value=!1}return}jt(()=>{d.value?h():c()})}},v=C=>{f("actionExecuted",C),h()},w=C=>{C.key==="Escape"?h():(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),m(C))},E=C=>({row:"small",column:"large",block:"small"})[C]||"large",_=C=>{const b=o.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...b],column:["menu-item",...b],block:["secondary",...b]}[C]||[]};return(C,b)=>{var R;return Ke((U(),ue("div",{ref_key:"wrapperRef",ref:a,class:j(C.$style["option-item-wrapper"]),style:{width:"100%"}},[ae(ht,{ref_key:"triggerRef",ref:l,class:j(C.$style["option-item"]),disabled:e.option.disabled||s.value,actived:K(d)||i.value,size:E(e.type),variant:_(e.type),tabindex:"0",onClick:Gt(m,["stop","prevent"]),onKeydown:w},{prefix:me(()=>[e.option.icon?Ke((U(),$e(ft,{key:0,src:e.option.icon,source:"remote"},null,8,["src"])),[[K(n),{content:e.option.label,delay:[500,0],contentClass:["extra-padding"]}]]):qe("",!0)]),suffix:me(()=>[e.option.subMenu?(U(),$e(ft,{key:0,src:"Play",source:"remote"})):qe("",!0),e.option.isDanger&&i.value?(U(),ue("div",{key:1,class:j(C.$style["confirm-action"])},[Ke((U(),$e(ht,{variant:["tertiary","icon","danger"],size:"small",onClick:b[0]||(b[0]=Gt(F=>i.value=!1,["stop","prevent"]))},{default:me(()=>[ae(ft,{src:"XMarkSolid",source:"remote"})]),_:1})),[[K(n),{content:"Cancel ",delay:[500,0],contentClass:["extra-padding"]}]]),Ke((U(),$e(ht,{variant:["danger","primary","icon"],size:"small",onClick:Gt(p,["stop","prevent"])},{default:me(()=>[ae(ft,{src:"Check",source:"remote"})]),_:1})),[[K(n),{delay:[500,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):qe("",!0)]),default:me(()=>[e.option.label?(U(),ue("span",l9,yt(e.option.label),1)):qe("",!0)]),_:1},8,["class","disabled","actived","size","variant"]),e.option.subMenu?(U(),ue("div",{key:0,ref_key:"popupRef",ref:u,class:j(C.$style["submenu-container"])},[ae(xP,{layer:o.layer+1,ref:"submenuRef","option-block":[((R=e.option)==null?void 0:R.subMenu)||[]],"is-submenu":!1,onActionExecuted:v},null,8,["layer","option-block"])],2)):qe("",!0)],2)),[[K(n),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_82ug7_1","icon-wrapper":"_icon-wrapper_82ug7_11","confirm-action":"_confirm-action_82ug7_19"}}]]);var Vu=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(Vu||{});const FP=(e,t)=>{const n=$(Number(e.value.value)),o=z(()=>e.value.metricConfig),i=z(()=>{var p,m,v,w;const u=t.value,c=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=o.value.format_type==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||c&&((m=(p=o.value)==null?void 0:p.metric_type)==null?void 0:m.code)==="formula",isEmpty:c,isError:d,hasPrefix:!c&&!d&&o.value.morpheme_type==="prefix",hasSuffix:!c&&!d&&o.value.morpheme_type==="suffix",isDropdown:o.value.format_type==="dropdown",isFormula:((w=(v=o.value)==null?void 0:v.metric_type)==null?void 0:w.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:u&&!c&&!f}}),s=14,r=z(()=>({maxRating:o.value.range||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:s})),a=z(()=>{var c;const u=o.value;return!!(((c=u.auth_permission)==null?void 0:c.permission)!==2||u.formula)});return{componentState:i,metricConfig:o,ICON_SIZE:s,ratingParams:r,standardNameforIcon:()=>(o.value.format_symbol||"").split(/[\s-_]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("").replace(/Outline|Solid/g,""),internalValue:n,isMetricReadonly:a}},TP=wt(ut({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Xo,o=cn,i=e,s=cE(!1),r=$(null),a=$(null),{isEditing:l}=Wd(i),u=z(()=>{var T,k,L;const x=(k=(T=i.params)==null?void 0:T.colDef)==null?void 0:k.context;return!!(((L=x.auth_permission)==null?void 0:L.permission)!==2||i.disabled||x.formula)}),c=z(()=>{var x,T;return{value:i.value,metricConfig:(T=(x=i.params)==null?void 0:x.colDef)==null?void 0:T.context,error:i.error,hovered:s.value,readOnly:u.value,disabled:i.readOnly,active:l}}),{componentState:d,metricConfig:h,internalValue:f}=FP(c,s),p=z(()=>{if(d.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(d.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(d.value.isEmpty)return;const x=C.value,T=h.value.morpheme_type;return T==="prefix"?`${h.value.morpheme_value||""} ${x}`.trim():T==="suffix"?`${x} ${h.value.morpheme_value||""}`.trim():x}),m=z(()=>{const{format_type:x,format_value:T}=h.value;if(x==="dropdown"&&typeof T=="string"&&T.startsWith("["))try{return JSON.parse(T)}catch{return[]}return[]}),v=z(()=>({disabled:i.disabled,error:d.value.isError,inputRef:r,wrapperRef:a,clickable:!0,readOnly:u.value||i.readOnly,isEmpty:d.value.isEmpty})),{argsMain:w,isHover:E}=Co(v),_=(x,T,k="en-US")=>new Intl.NumberFormat(k,{minimumFractionDigits:T,maximumFractionDigits:T}).format(x),C=z(()=>{if(d.value.isEmpty)return"";if(d.value.pendingCalculation)return"pending";const x=i.value,{format_type:T,format_value:k,mapping:L}=h.value;if(L&&typeof L=="object"&&!Array.isArray(L)){const Y=L[`!${x}`];if(Y)return Y}if(T==="dropdown"){const Y=m.value.find(ee=>String(ee.name)===String(x));if(Y)return Y.name}if(typeof x=="string"){const Y=Number(x);return Number.isNaN(Y)?x:x.replace(/[.-]/g,"").length>16?b(x,k):b(Y,k)}return typeof x=="number"?b(x,k):String(x)}),b=(x,T)=>{const k=Number.parseInt(String(T)||"2",10),L=Number.isFinite(k)&&k>=0?k:2;try{if(typeof x=="string"){const Y=x.split("."),ee=Y[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),Z=Y[1]?Y[1].substring(0,L).padEnd(L,"0"):"0".repeat(L);return L>0?`${ee}.${Z}`:ee}return _(x,L)}catch(Y){return console.error("Error formatting metric value:",Y,{num:x,decimals:L}),String(x)}},{copyToClipboard:R,tooltip:F}=kw(C.value);nt(()=>i.value,x=>{const T=Number(x);Number.isFinite(T)&&T!==f.value?f.value=T:x==null&&f.value!==0&&(f.value=0)},{immediate:!0});const I=()=>{s.value=!0},O=()=>{s.value=!1};return(x,T)=>Ke((U(),$e(bo,Kt(K(w),{onMouseenter:I,style:{"--icon-size":"24px"},onMouseleave:O,ref_key:"wrapperRef",ref:a,actived:K(l)}),{suffix:me(()=>[i.disabled?qe("",!0):(U(),ue("div",{key:0,class:j([x.$style.suffix,"wrapper-suffix"])},[s.value&&!K(d).isEmpty&&!K(d).isError?Ke((U(),$e(ht,{key:0,variant:["icon","secondary"],size:24,onClick:Gt(K(R),["prevent","stop"])},{default:me(()=>[ae(ft,{src:"Copy",source:"remote",size:12})]),_:1},8,["onClick"])),[[K(o),{content:K(F),hideOnClick:!1,contentClass:"extra-padding"}]]):qe("",!0)],2))]),default:me(()=>[he("div",{class:j(x.$style["metric-wrapper"])},[he("div",{class:j([x.$style["metric-content"],i.disabled?x.$style.disabled:""])},[!K(d).isError&&K(d).isEmpty?(U(),ue(Pt,{key:0},[K(d).pendingCalculation?Ke((U(),ue("span",{key:0,class:j(x.$style["metric-empty"])},[...T[0]||(T[0]=[st(" - ",-1)])],2)),[[K(o),"Can’t calculate yet. Complete required fields."]]):K(d).isEmpty?(U(),ue("span",{key:1,class:j(x.$style["metric-empty"])}," - ",2)):qe("",!0)],64)):qe("",!0),K(d).isError?Ke((U(),ue("div",{key:1,class:j(x.$style["metric-error"])},[...T[1]||(T[1]=[st(" Error ",-1)])],2)),[[K(o),"Something went wrong. Review formula, inputs and retry."]]):qe("",!0),!K(d).isEmpty&&!K(d).isError?Ke((U(),ue("span",{key:2,class:j([x.$style["metric-value"],K(E)?x.$style.hovered:"",{[x.$style.disabled]:i.disabled}])},[st(yt(C.value),1)],2)),[[K(o),{content:p.value,bypassOverflowCheck:!!K(h).morpheme_value||K(d).isEmpty}]]):qe("",!0)],2)],2)]),_:1},16,["actived"])),[[K(n),{isLoading:K(d).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),c9={key:0,style:{color:"#6b6b6b"}},d9=wt(ut({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=cn,o={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},i={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},s={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default"},u=z(()=>{var O,x;if(a.headerType)return a.headerType;if(((x=(O=a.params)==null?void 0:O.column)==null?void 0:x.getColId()).includes("metric"))return"default";const I=a.headerType??a.params.column.getColId();return l[I]||"default"}),c=z(()=>{var A,I;return((I=(A=a.params)==null?void 0:A.column.getColDef().context)==null?void 0:I.morpheme_value)||void 0}),d=z(()=>{var A;return(A=a.params)==null?void 0:A.displayName}),h=z(()=>{let A=[];switch(u.value){case"dateRange":A=Object.values(o).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break;case"date":A=Object.values(i).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break;case"number":A=Object.values(s).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break;default:A=Object.values(r).map(I=>({...I,selected:p.value===I.value,type:"text",hover:b.value===I.value}));break}return p.value!=="none"&&A.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:b.value=="none"}),A}),f=z(()=>String(p.value).endsWith("asc")?"SortUp":String(p.value).endsWith("desc")?"SortDown":"Sort"),p=$(a.modelValue??"none"),m=A=>{_("update:modelValue",A),_("sort-changed",A)},v=A=>{p.value=A},w=Es(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let A;p.value==="none"?A="asc":p.value==="asc"?A="desc":A="none",p.value=A}else{const A=[o.START_ASC.value,o.START_DESC.value,o.DUE_ASC.value,o.DUE_DESC.value,"none"],O=(A.indexOf(p.value)+1)%A.length;p.value=A[O]}},hr),E=z(()=>{if(p.value==="none")return"No sorting applied";const A=h.value.find(I=>I.value===p.value);return(A==null?void 0:A.label)||""}),_=t,C=z(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(p.value!=="none")return"var(--primary-color-hover)"});nt(()=>a.modelValue,A=>{A!=p.value&&(p.value=A)}),nt(p,A=>{A!==a.modelValue&&m(A)});const b=$(p.value);nt(()=>p.value,A=>{b.value=A});const R=A=>{var T,k;if(a.readOnly||a.disabled)return;let I=0;A.key==="ArrowDown"?I=1:A.key==="ArrowUp"&&(I=-1);const O=h.value.findIndex(L=>L.value===b.value),x=h.value.length;if(A.key==="Enter"||A.key===" ")A.preventDefault(),p.value=b.value,(T=F.value)==null||T.hide();else if(I!==0){A.preventDefault();let L=(O+I+x)%x;b.value=h.value[L].value}else A.key==="Escape"&&((k=F.value)==null||k.hide())},F=$(null);return an(()=>{var A,I;(I=(A=F.value)==null?void 0:A.$el)==null||I.addEventListener("keydown",R)}),Gc(()=>{var A,I;(I=(A=F.value)==null?void 0:A.$el)==null||I.removeEventListener("keydown",R)}),(A,I)=>(U(),$e(vC,{ref_key:"dropdownRef",ref:F,options:h.value,label:d.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:K(w),onSelect:I[0]||(I[0]=O=>v(O))},{prefix:me(()=>[ae(ht,{variant:["text"],onClick:K(w),size:"small"},{default:me(()=>[Ke((U(),ue("b",null,[st(yt(d.value),1)])),[[K(n),{content:d.value}]]),c.value?(U(),ue("small",c9," ("+yt(c.value)+") ",1)):qe("",!0)]),_:1},8,["onClick"])]),iconDropdown:me(()=>[Ke(ae(ft,{src:f.value,source:"remote",color:C.value},null,8,["src","color"]),[[K(n),E.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{iconSorting:"_iconSorting_18bqx_1","button-group":"_button-group_18bqx_7","ab-table-button":"_ab-table-button_18bqx_18","button-main":"_button-main_18bqx_24","button-dropdown-trigger":"_button-dropdown-trigger_18bqx_29",headerSorting:"_headerSorting_18bqx_39"}}]]),h9=["disabled","readonly","checked","indeterminate"],PP=wt(ut({__name:"Checkbox",props:{modelValue:{type:[Number,Boolean]},disabled:{type:Boolean},readOnly:{type:Boolean},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=cn,o=e,i=t,s=z(()=>o.allowIndeterminate?[0,1,2]:[0,2]),r=z(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(l.value){case 0:return o.tooltipText.unchecked;case 1:return o.tooltipText.indeterminate;case 2:return o.tooltipText.checked;default:return""}}),a=()=>{if(c.value)return;const h=(s.value.indexOf(l.value)+1)%s.value.length;l.value=s.value[h]},l=$(typeof o.modelValue=="boolean"?o.modelValue?2:0:o.modelValue),u=z(()=>({checked:l.value===2,indeterminate:l.value===1,none:l.value===0})),c=z(()=>o.disabled||o.readOnly);return nt(()=>l.value,d=>{i("update:modelValue",d===2)}),(d,h)=>Ke((U(),ue("input",{disabled:o.disabled,key:l.value,readonly:o.readOnly,type:"checkbox",class:j([d.$style["input-checkbox"],d.$style[o.size||"medium"]]),checked:u.value.checked,indeterminate:u.value.indeterminate,onChange:a,"aria-label":"Select All Items"},null,42,h9)),[[K(n),{content:r.value,hideOnClick:!1,contentClass:"extra-padding"}]])}}),[["__cssModules",{$style:{small:"_small_p7d2l_68",large:"_large_p7d2l_72",medium:"_medium_p7d2l_76"}}]]),f9=wt(ut({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=cn,o=mC(),{setSelectionStatus:i}=o,{rowCount:s}=ri(o),r=$(0);nt(r,E=>{i(r.value)},{immediate:!0});const a=z(()=>r.value!==0),l=z(()=>({checked:r.value===2,indeterminate:r.value===1,UNCHECK:r.value===0})),u=z(()=>({0:"Click to select check visible items",1:"Click to select All",2:"Click to clear selection"})[r.value]),c=z(()=>{const E=[{label:"All visible",value:"INDETERMINATE",type:"text",clickable:!0,selected:r.value===1,id:"indeterminate"},{label:"All",value:"CHECKED",type:"text",clickable:!0,selected:r.value===2,id:"checked"}];return a.value&&E.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,selected:r.value===0,id:"uncheck"}),E}),d=E=>({selected:E.getSelectedRows().length,total:s.value.total,loaded:s.value.loaded}),h=({api:E,state:_})=>{r.value=_,_===0?E==null||E.deselectAll():E==null||E.forEachNode(C=>C.setSelected(!0))},f=()=>{var C;const E=(C=t.params)==null?void 0:C.api;E||console.error("[HeaderCheckbox] There is no API available"),h({api:E,state:{0:1,1:2,2:0}[r.value]})},p=E=>{var b;const _=(b=t.params)==null?void 0:b.api;_||console.error("no api"),h({api:_,state:{INDETERMINATE:1,CHECKED:2,UNCHECK:0}[E]})},m=Es(E=>{const{selected:_,total:C}=d(E);_===0?r.value=0:_===C?r.value=2:r.value=1},300);let v=[];an(()=>{var b;const E=(b=t.params)==null?void 0:b.api;if(!E)return;const _=R=>m(R.api),C=()=>m(E);E.addEventListener("selectionChanged",_),E.addEventListener("rowDataUpdated",C),E.addEventListener("modelUpdated",C),v=[()=>E.removeEventListener("selectionChanged",_),()=>E.removeEventListener("rowDataUpdated",C),()=>E.removeEventListener("modelUpdated",C)]}),Yn(()=>{v.forEach(E=>E())});const w=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(E,_)=>(U(),$e(vC,{options:c.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:p},{prefix:me(()=>[Ke((U(),$e(PP,{id:w,disabled:t.disabled,key:r.value,readonly:t.readOnly,type:"checkbox",checked:l.value.checked,indeterminate:l.value.indeterminate,modelValue:r.value,"onUpdate:modelValue":_[0]||(_[0]=C=>r.value=C),onChange:f,"aria-label":"Select CHECKED Items",class:j(E.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","class"])),[[K(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_1efbt_1","button-group":"_button-group_1efbt_46","button-main":"_button-main_1efbt_46",headerCheckbox:"_headerCheckbox_1efbt_50"}}]]),p9={key:1},g9=wt(ut({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Xo,n=cn,o=e,{isEditing:i}=Wd(o),s=$(null),r=$(null),a=z(()=>o.value),l=z(()=>a.value===void 0),u=z(()=>{var f;return((f=a.value)==null?void 0:f.name)||"No status"}),c=z(()=>{var p;const f=(p=a.value)==null?void 0:p.color;return{backgroundColor:Ay(f)?f:"#fff",border:pp(f,"white")?"1px solid #ccc":"1px solid #fff"}}),d=z(()=>{var f;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:t6((f=a.value)==null?void 0:f.label),inputRef:s,wrapperRef:r,clickable:!o.disabled&&!o.readOnly,active:i}}),{argsMain:h}=Co(d);return(f,p)=>Ke((U(),$e(K(bo),Kt(K(h),{ref_key:"wrapperRef",ref:r}),{default:me(()=>[l.value?qe("",!0):(U(),ue("div",{key:0,class:j(f.$style["status-renderer"])},[a.value?(U(),ue(Pt,{key:0},[he("div",{class:j(f.$style["status-renderer__color-code"]),style:on(c.value)},null,6),Ke((U(),ue("div",{class:j(f.$style["status-renderer__status-name"])},[st(yt(u.value),1)],2)),[[K(n),{content:u.value}]])],64)):l.value?qe("",!0):(U(),ue("div",p9,"No status"))],2))]),_:1},16)),[[K(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_ui0ga_1","status-renderer__color-code":"_status-renderer__color-code_ui0ga_10","status-renderer__status-name":"_status-renderer__status-name_ui0ga_20"}}]]),IP=wt(ut({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,{popupRef:i,show:s,hide:r,isVisible:a}=R5({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(c){return document.body}}),l=c=>{o.closeOnEscape&&c.key==="Escape"&&a.value&&r()};an(()=>{document.addEventListener("keydown",l)}),Yn(()=>{document.removeEventListener("keydown",l)}),t({show:s,hide:r,isVisible:a});const u=n;return nt(()=>a.value,c=>{u(c?"shown":"hidden")}),(c,d)=>{const h=Ma("tooltip");return U(),ue("div",{ref_key:"popupRef",ref:i,class:j(c.$style.popupContainer)},[he("div",{class:j(c.$style.popupWrapper)},[he("div",{class:j(c.$style.header)},[he("span",{class:j(c.$style["header-title"])},yt(e.popupName),3),Ke((U(),$e(ht,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:K(r),"aria-label":"Close popup"},{default:me(()=>[ae(ft,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),he("div",{class:j(c.$style.body)},[Tt(c.$slots,"default")],2),he("div",{class:j(c.$style.footer)},[Tt(c.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1cwaa_1",popupWrapper:"_popupWrapper_1cwaa_5",popupFadeIn:"_popupFadeIn_1cwaa_1",header:"_header_1cwaa_19","header-title":"_header-title_1cwaa_28",body:"_body_1cwaa_38",footer:"_footer_1cwaa_43"}}]]),m9={list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch data. Please try again."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},createNewScene:{error:"Creation failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{success:"Archive successful.",error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},getStatuses:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."}},zd=al("toast",()=>{const e=$([]),t=(i,s)=>{const r=m9[i];if(r){const a=r[s];if(a){n({id:i,type:s,message:a});return}}else n({id:i,type:s,message:i})},n=(i,s=5e3)=>{const r={...i,id:i.id??Date.now()+Math.random()};e.value.push(r),setTimeout(()=>{o(r.id)},s)};function o(i){e.value=e.value.filter(s=>s.id!==i)}return{notifications:e,addNotification:n,removeNotification:o,showMessage:t}}),v9=["innerHTML"],y9=wt(ut({__name:"Snackbar",setup(e){const t=cB,n=zd(),{removeNotification:o}=n,{notifications:i}=ri(n),s=u=>u.trim().startsWith("<svg"),r=$("Copy to clipboard"),a=()=>{setTimeout(()=>{r.value="Copy to clipboard"},1e3)},l=u=>{navigator.clipboard.writeText(u).then(()=>{r.value="Copied!",a()},()=>{r.value="Copy failed",a()})};return(u,c)=>{const d=Ma("tooltip");return U(),$e(K2,{name:"list",tag:"div",class:j(u.$style["notification-wrapper"])},{default:me(()=>[(U(!0),ue(Pt,null,Tn(K(i),h=>{var f;return Ke((U(),ue("div",{key:h.id,class:j([u.$style["notification-item"],u.$style[`notification--${h.type||"info"}`],!(h!=null&&h.actions)||((f=h==null?void 0:h.actions)==null?void 0:f.length)==0?u.$style["snackbar-type"]:""])},[he("p",{class:j(u.$style.snackbar__message)},[h.icon&&!s(h.icon)?(U(),$e(ft,{key:0,src:h.icon,source:"remote"},null,8,["src"])):qe("",!0),h.icon&&s(h.icon)?(U(),ue("i",{key:1,class:j(u.$style["icon-draw"]),innerHTML:h.icon},null,10,v9)):qe("",!0),Ke((U(),ue("span",{class:j(u.$style["error-message"])},[st(yt(h.message),1)],2)),[[d,{content:h.message}]])],2),h.actions?(U(),ue("div",{key:0,class:j(u.$style["actions-notification"])},[(U(!0),ue(Pt,null,Tn(h.actions,p=>(U(),$e(ht,Kt({key:p.label},{ref_for:!0},p,{onClick:p.action}),{prefix:me(()=>[p.btnIcon?(U(),$e(ft,{key:0,src:p.btnIcon,source:"remote",color:"white"},null,8,["src"])):qe("",!0)]),_:2},1040,["onClick"]))),128))],2)):qe("",!0),h.type=="error"?Ke((U(),$e(ht,{key:1,variant:"tertiary",onClick:p=>l(h.message)},{prefix:me(()=>[ae(ft,{src:"Copy",source:"remote",color:"white"})]),_:1},8,["onClick"])),[[d,r.value]]):qe("",!0),ae(ht,{variant:"tertiary",onClick:p=>K(o)(h.id),class:j(u.$style["close-btn"]),size:18},{default:me(()=>[ae(ft,{src:"Xmark",color:"var(--icon-color)"})]),_:1},8,["onClick","class"])],2)),[[K(t)]])}),128))]),_:1},8,["class"])}}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1tunr_1","notification-item":"_notification-item_1tunr_16","notification--success":"_notification--success_1tunr_30","notification--error":"_notification--error_1tunr_33","close-btn":"_close-btn_1tunr_37","notification--info":"_notification--info_1tunr_40","notification--warning":"_notification--warning_1tunr_47","notification--interactive":"_notification--interactive_1tunr_54","snackbar-type":"_snackbar-type_1tunr_60",snackbar__message:"_snackbar__message_1tunr_68","error-message":"_error-message_1tunr_80","actions-notification":"_actions-notification_1tunr_89"}}]]);/*!
88
88
  * vue-draggable-next v2.3.0
89
89
  * (c) 2025 Anish George
90
90
  * @license MIT
@@ -176,4 +176,4 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
176
176
  <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"/>
177
177
  </svg>
178
178
  `,Xhe=wt(ut({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Xo,o=uC(),{setUserPermissions:i,setEntityPermissions:s}=o,{entityPermissions:r}=ri(o),{addNotification:a}=zd(),l=cn,u=$(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=z(()=>{var Ae;const Te=((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:!Te},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Te,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Te,id:"overwrite_scenes_option"}]}),h=e;oh.initialize({wrapVueCellRenderer:bg,wrapVueCellEditor:uI});const f=$(null),p=$([]),m=mC(),{rowCount:v}=ri(m),w=$(!1),E=$(""),_=CP(),{metricList:C}=ri(_),b=$(""),R=$(!1),F=$(new Set),A=$(new Map),{apiServices:I}=ao(!1,h),{columnDefs:O,checkboxColumn:x,saveColumnConfig:T}=lde(C,h.entityId,f),k=$();nt(()=>O,()=>{var Te;(Te=k.value)==null||Te.updateColumnDefs(O.value)},{deep:!0});const L=(Te,Ae)=>{T(Te,Ae)},{updateRowData:Y,setMetricValues:ee}=Ghe(f),Z=z(()=>({isSearching:E.value.length>0,isFiltering:Object.keys(vt.value||{}).length>0})),B=z(Ad),V=z(()=>O.value.filter(Te=>{var Ae;return((Ae=Te.field)==null?void 0:Ae.startsWith("metric_"))&&!Te.hide}).map(Te=>{var Ae;return((Ae=Te.field)==null?void 0:Ae.replace("metric_",""))||""}));Va("timezone",B);const G=z(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:Y})),{fetchItems:ve,getMetricList:pe,cusorMap:re,getMetricValues:oe}=$he(G),J=z(()=>{if(!f.value)return!1;const Te=f.value.getSelectedRows().length;return Te>0&&Te>=v.value.total}),fe=z(()=>{var Te;return((Te=u.value)==null?void 0:Te.name)||"Items"}),Ne=(Te,Ae)=>{var Rt,pn,Ir;v.value.total=Te.meta.total??0,(Rt=Te.meta.next)!=null&&Rt.cursor&&(re[Ae+1]=Te.meta.next.cursor),b.value=Te.meta["X-Tsr-signature"]||"",Te.meta.total===0?(pn=f.value)==null||pn.showNoRowsOverlay():(Ir=f.value)==null||Ir.hideOverlay()},ot=nI(),_e=$(null),{sortingAPIConfiguration:mt,isSortingRunning:bt}=ri(ot),vt=$({}),N=$([]),q=async({page:Te,pageSize:Ae,filterText:Rt})=>{var Ll;(Ll=f.value)==null||Ll.hideOverlay();const pn=re[Te],Ir=!pn&&Te>1?(Te-1)*Ae:void 0,Ml=mt.value;Ml.length>0&&(bt.value=!0);try{const qh={cursor:pn,size:Ae,searchQuery:Rt,offset:Ir,sort_by:Ml,...vt.value},Hi=await ve(qh);if(!Hi)return{rows:[],total:0};const js=(Sc=>{const Bm=Sc.data.map(pi=>sF(pi,B.value));return Bm.forEach(pi=>{F.value.add(String(pi.id)),A.value.set(String(pi.id),{})}),Bm})(Hi);return Ne(Hi,Te),{rows:js,total:v.value.total}}catch(qh){return console.error("Failed to fetch items:",qh),{rows:[],total:0}}finally{bt.value=!1}},{isLoading:le,toggleSidebar:Pe,onGridReady:De,handleUnSelect:Ie,onSearch:Be,firstLoad:Le}=Uhe({selectRowData:$([]),isSidebarOpen:w,quickFilterText:E,gridApi:f,perPage:c.ROWS_PER_PAGE,fetcher:q}),Me=$([]),xe=()=>{var Te;Me.value=((Te=f.value)==null?void 0:Te.getSelectedRows())||[]},rt=vi({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Ue=z(()=>({blockLoadDebounceMillis:1e3,columnDefs:O.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:dt,noRowsOverlayComponent:bg(uK),noRowsOverlayComponentParams:()=>Z.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Te=>Te.data.id,getRowClass:Te=>{if(!Te.data)return["row-empty"];const Ae=["row-highlight"];return Te.data.id||Ae.push("row-inactive"),Te.data.isDeleted&&Ae.push("row-deleted"),Te.data.isArchived&&Ae.push("row-archived"),Ae},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:I.value,sorting:bt.value},suppressKeyboardEvent:Te=>{const Ae=Te.event.key;return Te.editing&&Ae==="Enter"?!1:Ae==="Enter"?(Te.event.preventDefault(),Te.event.stopPropagation(),!0):Ae==="ArrowUp"||Ae==="ArrowDown"||Ae==="ArrowLeft"||Ae==="ArrowRight"||Ae==="Tab"||Ae==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Te=>{const Ae=Te.api.getFirstDisplayedRowIndex(),Rt=Te.api.getLastDisplayedRowIndex();console.log(`User is looking at rows: ${Ae} to ${Rt}`),rt.rowsDisplay.fromIndex=Ae,rt.rowsDisplay.toIndex=Rt,rt.columnsDisplay=Te.api.getAllDisplayedVirtualColumns().map(pn=>pn.getColId())},onViewportChanged:Te=>{console.log("Viewport changed",Te),rt.columnsDisplay=Te.api.getAllDisplayedVirtualColumns().map(Ae=>Ae.getColId())},suppressHeaderFocus:!0}));function dt(){if(!f.value)return;const Te=f.value.getCacheBlockState();if(!Te)return;const Ae=Object.values(Te).reduce((Rt,pn)=>(pn==null?void 0:pn.pageStatus)==="loaded"?Rt+(pn.endRow-pn.startRow):Rt,0);v.value.loaded=Math.min(Ae,v.value.total)}nt(()=>mt,()=>{f.value&&(b.value="",F.value.clear(),f.value.deselectAll(),Object.keys(re).forEach(Te=>delete re[Number(Te)]),f.value.purgeInfiniteCache(),f.value.ensureIndexVisible(0),f.value.refreshCells({force:!0}))},{deep:!0});const Ct=$(),Ot=$(),Ht=()=>{var Te;(Te=Ot.value)==null||Te.open()},zt=()=>{var Te;(Te=Ct.value)==null||Te.open()},dn=async()=>{Le.value=!0,f.value&&(b.value="",F.value.clear(),Object.keys(re).forEach(Te=>delete re[Number(Te)]),await f.value.deselectAll(),await f.value.ensureIndexVisible(0,"top"),await f.value.purgeInfiniteCache(),await f.value.refreshInfiniteCache())},fn=z(()=>Mn.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Hn=$(),no=z(()=>{var Te;return(Te=jhe(fn.value))==null?void 0:Te.map(Ae=>`<div>• ${Ae}</div>`).join(`
179
- `)});function Re(Te){var Ae;Te==="new_scene"?(Ae=Hn.value)==null||Ae.show():Te==="import_scenes"?zt():Te==="overwrite_scenes"&&Ht()}const ke=Te=>{p.value=Te.api.getSelectedRows().map(Ae=>Ae.id)},ct=Te=>{const Ae=De(Te);return Ae&&(Ae.addEventListener("modelUpdated",dt),Ae.addEventListener("bodyScroll",()=>Ae.stopEditing()),Ae.addEventListener("selectionChanged",xe),Ae.addEventListener("columnMoved",pn=>L(pn,!0)),Ae.addEventListener("columnResized",pn=>L(pn,!0)),Ae.addEventListener("firstDataRendered",()=>{Le.value=!1}),!document.querySelector(".ag-body-viewport")),Ae},xt=(Te,Ae)=>{if(!f.value)return;const Rt=f.value.getRowNode(Te);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")},Mt=async Te=>{var Rt;let Ae;if(!(!I.value||!Te.trim())){le.value=!0;try{Ae=await I.value.createNewScene({workspaceId:h.workspaceId,entityId:h.entityId,name:Te}),v.value.total<50&&await dn()}catch(pn){console.error("Error creating new scene:",pn)}finally{le.value=!1,Ae!=null&&Ae.id&&a({id:String(Ae==null?void 0:Ae.id),message:`${Te} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{xt(String(Ae==null?void 0:Ae.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const pn=ni({type:"scene_hub",config:{ws_code:h.workspaceId,baseDomain:Mn.getInstance().getItem("BASE_URL")||"",scene_id:String(Ae==null?void 0:Ae.id)}}).url;window.open(pn,"_blank")},btnIcon:"CustomSceneHub"}],icon:Zhe,type:"interactive"}),(Rt=Hn.value)==null||Rt.hide()}}},We=Te=>Te.metric_type.code==="number"?"number":"default",oo=async()=>{if(h.entityId)try{const Te=await pe(h.entityId);C.value=Te.data.map(Ae=>({...Ae,sortType:We(Ae)}))}catch(Te){console.error("Failed to initialize metric list:",Te),C.value=[]}},us=async()=>{if(I.value)try{const Te=await I.value.getUserPermission(h.workspaceId);i(Te)}catch(Te){console.error("Failed to fetch user permissions:",Te)}},ba=async()=>{if(I.value)try{const Te=await I.value.getEntityDetail(h.workspaceId,h.entityId);s(Te.permission),u.value=Te}catch(Te){console.error("Failed to fetch entity details:",Te)}},fi=BC(),{setUser:Pr}=fi,Sa=async()=>{if(I.value)try{const Te=await I.value.getMe();return Pr(Te),Te}catch(Te){console.error("Failed to fetch user details:",Te)}},Ws=async()=>{var Te;if(I.value)try{const Ae=await I.value.getWorkspaces(h.workspaceId),Rt=(Te=Ae.data[0])==null?void 0:Te.ws_user_role_id;return Rt&&fi.setUserRoleId(Rt),Ae}catch(Ae){console.error("Failed to fetch workspace details:",Ae)}};nt(()=>[h.entityId,h.workspaceId],async([Te,Ae])=>{!Te||!Ae||(Sa(),Ws(),oo(),us(),ba())},{immediate:!0,deep:!0}),nt(V,(Te,Ae)=>{const Rt=Te.filter(pn=>!(Ae!=null&&Ae.includes(pn)));Rt.length>0&&oe(Array.from(F.value),Rt).then(pn=>{ee(pn,F.value,Rt)})},{immediate:!0,deep:!0}),nt(b,(Te,Ae)=>{R.value=!!(Ae&&Te&&Ae!==Te)}),t({refreshTable:dn});const Us=Te=>{vt.value=Te,dn()},Bi=Te=>{N.value=Te,dn()},zs=Te=>{O.value=Te||[]};return(Te,Ae)=>(U(),$e(K(a9),{"is-sidebar-open":w.value,onCloseSidebar:K(Pe),onSidebarClear:K(Pe),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:K(Pe)},{"header-left":me(()=>[he("h1",{class:j(Te.$style.tableTitle)},"Scenes",2),he("div",{class:j(Te.$style["beta-tag"])},"Beta",2),ae(K(vC),{variant:["primary"],options:d.value,onSelect:Re,onHandleClick:Ae[1]||(Ae[1]=Rt=>Re("new_scene")),id:"create_scene_dropdown"},{prefix:me(()=>[ae(K(ht),{id:"create_new_scene",variant:["primary"],onClick:Ae[0]||(Ae[0]=Rt=>Re("new_scene")),label:"New"})]),_:1},8,["options"]),Ke((U(),ue("span",Yhe,[st(yt(fn.value),1)])),[[K(l),no.value||""]])]),"header-actions":me(()=>[ae(K(OK),{"onUpdate:assignees":Bi,onApplyFilter:Us,loading:K(Le)},null,8,["loading"]),Ke(ae(K(pC),{modelValue:E.value,"onUpdate:modelValue":Ae[2]||(Ae[2]=Rt=>E.value=Rt),onSearch:K(Be),class:j(Te.$style.itemSearchBox),onClear:Ae[3]||(Ae[3]=Rt=>K(Be)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),[[K(n),{isLoading:K(Le),fullwidth:!0}]]),Ke((U(),$e(K(pP),{status:K(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":R.value},{default:me(()=>[ae(K(ht),{variant:"secondary",disabled:K(le),onClick:dn},{prefix:me(()=>[ae(K(ft),{src:"ArrowsRotate"})]),default:me(()=>[Ae[5]||(Ae[5]=st(" Refresh ",-1))]),_:1},8,["disabled"])]),_:1},8,["status","show-badge"])),[[K(n),{isLoading:K(Le),fullwidth:!0}]]),Ke(ae(K(oK),{"model-value":K(O),onChange:Ae[4]||(Ae[4]=Rt=>zs(Rt)),id:"table_customization",gridApi:f.value,ref_key:"tableCustomizationRef",ref:k,"checkbox-column":K(x)},null,8,["model-value","gridApi","checkbox-column"]),[[K(n),{isLoading:K(Le),fullwidth:!0}]])]),grid:me(({availableHeight:Rt})=>[ae(K(ode),Kt({id:"item_table_main",ref_key:"agGrid",ref:_e},Ue.value,{height:Rt+"px",isSorting:K(bt),onOnGridReady:ct,onSelectionChanged:ke}),null,16,["height","isSorting"])]),footer:me(()=>[he("div",{class:j(Te.$style.tableFooter),id:"table_footer"},[he("span",null,[Ae[6]||(Ae[6]=st(" Showing ",-1)),he("b",null,yt(K(v).loaded)+" of "+yt(K(v).total),1)])],2)]),"new-row":me(()=>[ae(K(dK),{onCreateNewItem:Mt,ref_key:"createNewSceneRef",ref:Hn},null,512)]),"bulk-update-actions":me(()=>[!w.value&&p.value.length>0?(U(),$e(K(Q7),{key:0,selectRowData:Me.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":f.value,onUnselect:K(Ie),"take-name":fe.value,"selected-all":J.value,onUpdated:xe},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"])):qe("",!0)]),snackbar:me(()=>[ae(K(y9))]),popup:me(()=>[ae(VK,{ref_key:"popupCreateSceneRef",ref:Ct,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:dn},null,8,["workspace-id","entity-id"]),ae(qhe,{ref_key:"popupOverwriteScenesRef",ref:Ot,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:dn},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"}}]]),wL="0.0.115",Jhe={key:0},Qhe=wt(ut({__name:"app",setup(e){const t=z(()=>n.id.length===0||n.workspaceId.length===0),n=vi({id:"",workspaceId:"",apiConfig:{}}),o=zd(),{showMessage:i}=o,s=c=>{var d,h;c.success?i(c.apiCode,"success"):i(((h=(d=c.res)==null?void 0:d.data)==null?void 0:h.message)||c.apiCode,"error")},r=$(null),a=()=>{const c=Mn.getInstance().getItem("API_BASE_URL");return c!=null&&c.includes("v1")?c.slice(0,c.lastIndexOf("/v1")):String(c)};Af(()=>{var c,d,h;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",wL);try{if(r.value=so(),!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)||Mn.getInstance().getItem("ws.code");const f={domainApi:a(),wsCode:Mn.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 yL(n.apiConfig,f);p.on("call-api",s),r.value.appContext.config.globalProperties.apiServices=p}catch(f){console.error("Error getting current instance:",f)}}),Yn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",s)});const l=z(()=>n.id),u=z(()=>n.workspaceId);return Va("workspaceId",u),Va("entityId",l),(c,d)=>(U(),ue("div",{class:j(c.$style.dashboardPluginWrapper)},[t.value?(U(),ue("span",Jhe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):l.value?(U(),$e(K(Xhe),{key:1,entityId:l.value,workspaceId:u.value},null,8,["entityId","workspaceId"])):qe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),s0=async(e={},t={})=>{const n=a_(Qhe),o=jj();n.use(o);const i=["apiConfig","workspaceId","id"],s={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,s[r]=a,i.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=s,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${wL}`,"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=s0),yn.default=s0,yn.initDashboard=s0,Object.defineProperties(yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
179
+ `)});function Re(Te){var Ae;Te==="new_scene"?(Ae=Hn.value)==null||Ae.show():Te==="import_scenes"?zt():Te==="overwrite_scenes"&&Ht()}const ke=Te=>{p.value=Te.api.getSelectedRows().map(Ae=>Ae.id)},ct=Te=>{const Ae=De(Te);return Ae&&(Ae.addEventListener("modelUpdated",dt),Ae.addEventListener("bodyScroll",()=>Ae.stopEditing()),Ae.addEventListener("selectionChanged",xe),Ae.addEventListener("columnMoved",pn=>L(pn,!0)),Ae.addEventListener("columnResized",pn=>L(pn,!0)),Ae.addEventListener("firstDataRendered",()=>{Le.value=!1}),!document.querySelector(".ag-body-viewport")),Ae},xt=(Te,Ae)=>{if(!f.value)return;const Rt=f.value.getRowNode(Te);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")},Mt=async Te=>{var Rt;let Ae;if(!(!I.value||!Te.trim())){le.value=!0;try{Ae=await I.value.createNewScene({workspaceId:h.workspaceId,entityId:h.entityId,name:Te}),v.value.total<50&&await dn()}catch(pn){console.error("Error creating new scene:",pn)}finally{le.value=!1,Ae!=null&&Ae.id&&a({id:String(Ae==null?void 0:Ae.id),message:`${Te} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{xt(String(Ae==null?void 0:Ae.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const pn=ni({type:"scene_hub",config:{ws_code:h.workspaceId,baseDomain:Mn.getInstance().getItem("BASE_URL")||"",scene_id:String(Ae==null?void 0:Ae.id)}}).url;window.open(pn,"_blank")},btnIcon:"CustomSceneHub"}],icon:Zhe,type:"interactive"}),(Rt=Hn.value)==null||Rt.hide()}}},We=Te=>Te.metric_type.code==="number"?"number":"default",oo=async()=>{if(h.entityId)try{const Te=await pe(h.entityId);C.value=Te.data.map(Ae=>({...Ae,sortType:We(Ae)}))}catch(Te){console.error("Failed to initialize metric list:",Te),C.value=[]}},us=async()=>{if(I.value)try{const Te=await I.value.getUserPermission(h.workspaceId);i(Te)}catch(Te){console.error("Failed to fetch user permissions:",Te)}},ba=async()=>{if(I.value)try{const Te=await I.value.getEntityDetail(h.workspaceId,h.entityId);s(Te.permission),u.value=Te}catch(Te){console.error("Failed to fetch entity details:",Te)}},fi=BC(),{setUser:Pr}=fi,Sa=async()=>{if(I.value)try{const Te=await I.value.getMe();return Pr(Te),Te}catch(Te){console.error("Failed to fetch user details:",Te)}},Ws=async()=>{var Te;if(I.value)try{const Ae=await I.value.getWorkspaces(h.workspaceId),Rt=(Te=Ae.data[0])==null?void 0:Te.ws_user_role_id;return Rt&&fi.setUserRoleId(Rt),Ae}catch(Ae){console.error("Failed to fetch workspace details:",Ae)}};nt(()=>[h.entityId,h.workspaceId],async([Te,Ae])=>{!Te||!Ae||(Sa(),Ws(),oo(),us(),ba())},{immediate:!0,deep:!0}),nt(V,(Te,Ae)=>{const Rt=Te.filter(pn=>!(Ae!=null&&Ae.includes(pn)));Rt.length>0&&oe(Array.from(F.value),Rt).then(pn=>{ee(pn,F.value,Rt)})},{immediate:!0,deep:!0}),nt(b,(Te,Ae)=>{R.value=!!(Ae&&Te&&Ae!==Te)}),t({refreshTable:dn});const Us=Te=>{vt.value=Te,dn()},Bi=Te=>{N.value=Te,dn()},zs=Te=>{O.value=Te||[]};return(Te,Ae)=>(U(),$e(K(a9),{"is-sidebar-open":w.value,onCloseSidebar:K(Pe),onSidebarClear:K(Pe),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:K(Pe)},{"header-left":me(()=>[he("h1",{class:j(Te.$style.tableTitle)},"Scenes",2),he("div",{class:j(Te.$style["beta-tag"])},"Beta",2),ae(K(vC),{variant:["primary"],options:d.value,onSelect:Re,onHandleClick:Ae[1]||(Ae[1]=Rt=>Re("new_scene")),id:"create_scene_dropdown"},{prefix:me(()=>[ae(K(ht),{id:"create_new_scene",variant:["primary"],onClick:Ae[0]||(Ae[0]=Rt=>Re("new_scene")),label:"New"})]),_:1},8,["options"]),Ke((U(),ue("span",Yhe,[st(yt(fn.value),1)])),[[K(l),no.value||""]])]),"header-actions":me(()=>[ae(K(OK),{"onUpdate:assignees":Bi,onApplyFilter:Us,loading:K(Le)},null,8,["loading"]),Ke(ae(K(pC),{modelValue:E.value,"onUpdate:modelValue":Ae[2]||(Ae[2]=Rt=>E.value=Rt),onSearch:K(Be),class:j(Te.$style.itemSearchBox),onClear:Ae[3]||(Ae[3]=Rt=>K(Be)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),[[K(n),{isLoading:K(Le),fullwidth:!0}]]),Ke((U(),$e(K(pP),{status:K(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":R.value},{default:me(()=>[ae(K(ht),{variant:"secondary",disabled:K(le),onClick:dn},{prefix:me(()=>[ae(K(ft),{src:"ArrowsRotate"})]),default:me(()=>[Ae[5]||(Ae[5]=st(" Refresh ",-1))]),_:1},8,["disabled"])]),_:1},8,["status","show-badge"])),[[K(n),{isLoading:K(Le),fullwidth:!0}]]),Ke(ae(K(oK),{"model-value":K(O),onChange:Ae[4]||(Ae[4]=Rt=>zs(Rt)),id:"table_customization",gridApi:f.value,ref_key:"tableCustomizationRef",ref:k,"checkbox-column":K(x)},null,8,["model-value","gridApi","checkbox-column"]),[[K(n),{isLoading:K(Le),fullwidth:!0}]])]),grid:me(({availableHeight:Rt})=>[ae(K(ode),Kt({id:"item_table_main",ref_key:"agGrid",ref:_e},Ue.value,{height:Rt+"px",isSorting:K(bt),onOnGridReady:ct,onSelectionChanged:ke}),null,16,["height","isSorting"])]),footer:me(()=>[he("div",{class:j(Te.$style.tableFooter),id:"table_footer"},[he("span",null,[Ae[6]||(Ae[6]=st(" Showing ",-1)),he("b",null,yt(K(v).loaded)+" of "+yt(K(v).total),1)])],2)]),"new-row":me(()=>[ae(K(dK),{onCreateNewItem:Mt,ref_key:"createNewSceneRef",ref:Hn},null,512)]),"bulk-update-actions":me(()=>[!w.value&&p.value.length>0?(U(),$e(K(Q7),{key:0,selectRowData:Me.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":f.value,onUnselect:K(Ie),"take-name":fe.value,"selected-all":J.value,onUpdated:xe},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"])):qe("",!0)]),snackbar:me(()=>[ae(K(y9))]),popup:me(()=>[ae(VK,{ref_key:"popupCreateSceneRef",ref:Ct,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:dn},null,8,["workspace-id","entity-id"]),ae(qhe,{ref_key:"popupOverwriteScenesRef",ref:Ot,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:dn},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"}}]]),wL="0.0.116",Jhe={key:0},Qhe=wt(ut({__name:"app",setup(e){const t=z(()=>n.id.length===0||n.workspaceId.length===0),n=vi({id:"",workspaceId:"",apiConfig:{}}),o=zd(),{showMessage:i}=o,s=c=>{var d,h;c.success?i(c.apiCode,"success"):i(((h=(d=c.res)==null?void 0:d.data)==null?void 0:h.message)||c.apiCode,"error")},r=$(null),a=()=>{const c=Mn.getInstance().getItem("API_BASE_URL");return c!=null&&c.includes("v1")?c.slice(0,c.lastIndexOf("/v1")):String(c)};Af(()=>{var c,d,h;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",wL);try{if(r.value=so(),!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)||Mn.getInstance().getItem("ws.code");const f={domainApi:a(),wsCode:Mn.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 yL(n.apiConfig,f);p.on("call-api",s),r.value.appContext.config.globalProperties.apiServices=p}catch(f){console.error("Error getting current instance:",f)}}),Yn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",s)});const l=z(()=>n.id),u=z(()=>n.workspaceId);return Va("workspaceId",u),Va("entityId",l),(c,d)=>(U(),ue("div",{class:j(c.$style.dashboardPluginWrapper)},[t.value?(U(),ue("span",Jhe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):l.value?(U(),$e(K(Xhe),{key:1,entityId:l.value,workspaceId:u.value},null,8,["entityId","workspaceId"])):qe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),s0=async(e={},t={})=>{const n=a_(Qhe),o=jj();n.use(o);const i=["apiConfig","workspaceId","id"],s={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,s[r]=a,i.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=s,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${wL}`,"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=s0),yn.default=s0,yn.initDashboard=s0,Object.defineProperties(yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbocollab/arbo-plugin-item-table",
3
- "version": "0.0.115",
3
+ "version": "0.0.116",
4
4
  "type": "module",
5
5
  "main": "./lib/index.umd.js",
6
6
  "module": "./lib/index.es.js",