@arbocollab/arbo-plugin-item-table 0.1.79 → 0.1.80

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.
@@ -81,6 +81,8 @@ Expected function or array of functions, received type ${typeof e}.`),is)}functi
81
81
  --tooltip-text-color: #232323;
82
82
  color: var(--tooltip-text-color) !important;
83
83
  background-color: var(--tooltip-background-color) !important;
84
+ box-shadow: var(--card-shadow);
85
+ border-radius: var(--radius-md);
84
86
  }
85
87
 
86
88
  .tippy-box[data-placement^='top'] > .tippy-arrow::before {
@@ -136,7 +138,7 @@ Only state can be modified.`);r[0]="$state",Eu=!1,s.set(i,r,s.state.value),Eu=!0
136
138
  state: () => new MyClass()
137
139
  Found in store "${T.$id}".`),p&&i&&n.hydrate&&n.hydrate(T.$state,p),c=!0,u=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Zl(e,t,n){let s;const o=typeof t=="function";s=o?n:t;function i(r,a){const l=ww();if(r=(Y.env.NODE_ENV==="test"&&Kl&&Kl._testing?null:r)||(l?Sn(wm,null):null),r&&Kh(r),Y.env.NODE_ENV!=="production"&&!Kl)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
138
140
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
139
- This will fail in production.`);r=Kl,r._s.has(e)||(o?Ub(e,t,s,r):AA(e,s,r),Y.env.NODE_ENV!=="production"&&(i._pinia=r));const c=r._s.get(e);if(Y.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=o?Ub(u,t,s,r,!0):AA(u,Qo({},s),r,!0);a._hotUpdate(d),delete r.state.value[u],r._s.delete(u)}if(Y.env.NODE_ENV!=="production"&&Yr){const u=bs();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return i.$id=e,i}function Xs(e){const t=Mt(e),n={};for(const s in t){const o=t[s];o.effect?n[s]=Z({get:()=>e[s],set(i){e[s]=i}}):(pn(o)||Ho(o))&&(n[s]=wi(e,s))}return n}const Wb=Zl("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}}}),jq="woohoo_getWoohooUserInterface_read",zb="media_getReviewUserInterface_read",Kq="update_getUpdateUserInterface_read",qq=(e,t,n,s,o,i)=>{qt(()=>{console.log("Scene data in useSceneAction:",i.value)});const r=Wb(),{userPermissions:a}=Xs(r),l=Z(()=>{const k=En.getInstance().getItem("BASE_URL"),A=En.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:I,entity_id:D,scene_id:x}=e.value;return{baseDomain:k||"",ws_code:I||"",entity_id:D||"",scene_id:x||"",reviewDomain:A||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=Z(()=>{var A;const k=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(zb),canCopyLink:!0,canRename:(k==null?void 0:k.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(zb),canOpenTakeInUpdate:a.value.includes(Kq),canOpenTakeInWoohoo:a.value.includes(jq),canDeleteRendition:((A=k==null?void 0:k.media)==null?void 0:A.has_delete_rendition_permission)??!1,canDeleteThumbnail:(k==null?void 0:k.has_edit_thumbnail_permission)??!1,canArchiveScene:k==null?void 0:k.has_archive_permission,canUnarchiveScene:k==null?void 0:k.has_archive_permission,canDeleteScene:(k==null?void 0:k.has_delete_permission)??!1}}),u=Z(()=>({project:To({type:"project",config:l.value}).url,take_review:To({type:"review_take",config:l.value}).url,review:To({type:"review_scene",config:l.value}).url,review_scene:To({type:"review_scene",config:l.value}).url,woohoo:To({type:"woohoo",config:l.value}).url,update:To({type:"update",config:l.value}).url,scene_hub:To({type:"scene_hub",config:l.value}).url})),d=(k,A)=>{const I=k.metaKey||k.ctrlKey,D=u.value[A]||"";if(D){if(A==="scene_hub"){if(I){window.open(D,"_blank");return}if(!s){console.error("Switch instance not found.",{openSceneHub:s,windowFunc:globalThis.window.$switchInstance});return}s(l.value.scene_id||"");return}I?window.open(D,"_blank"):window.location.href=D}},h=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete rendition.")}catch(D){console.error("Error deleting rendition",D)}finally{o()}},f=async(k,A)=>{var I;try{await((I=e.value.axiosService.value)==null?void 0:I.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{o()}},p=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to archive scene."),A&&A("archived")}catch(D){console.error("Error archiving item",D)}finally{o()}},g=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete scene."),A&&A("deleted")}catch(D){console.error("Error deleting item",D)}finally{o()}},v=k=>{const A=u.value.scene_hub||"";A&&(E.value="Copied",navigator.clipboard.writeText(A),setTimeout(()=>{E.value="Copy link"},5e3))},y=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to unarchive scene."),A&&A("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{o()}},b=k=>p(k,t),S=k=>y(k,t),C=k=>g(k,t),E=$("Copy link"),R=k=>d(k,"review"),T=Z(()=>{let k=[];if(!l.value.scene_id&&e.value.optionBlock&&k.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const A=()=>Math.random().toString(36).substring(2,9);return[{id:A(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:R,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:A(),label:E.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:A(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:b,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:S,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:C,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:y,options:T}};function ms(e){const t=$(!1),n=$(!1),s=Z(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),o=()=>{t.value=!0,Et(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},i=()=>{t.value=!1},r=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",o),c.addEventListener("blur",i)),u&&(u.addEventListener("mouseenter",r),u.addEventListener("mouseleave",a))}),as(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",o),c.removeEventListener("blur",i)),u&&(u.removeEventListener("mouseenter",r),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:s,handleFocus:o}}const Ru=e=>{const t=$(!1),n=Z(()=>t.value);return qt(()=>{var a,l,c,u;const s=(a=e.params)==null?void 0:a.api,o=(l=e.params)==null?void 0:l.node,i=o==null?void 0:o.rowIndex,r=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},kA=St(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=So,{triggerRef:n,popupRef:s}=us({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),o=Z(()=>{switch(i.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),i=e;return(r,a)=>(K(),ie("div",{class:J(r.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${i.size}px`,"--badge-color":o.value})},[xt(r.$slots,"default"),We(ye("div",{class:J(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ei,i.showBadge],[U(t),{isLoading:i.loading,fullwidth:!0}]]),ye("div",{ref_key:"popupRef",ref:s,class:J(r.$style["badge-tooltip"])},yt(i.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),qh=Zl("switchStore",()=>{const e=$(null),t=Sn("switchInstance");return{openSceneHub:(o,i)=>{if(o){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:o,commentId:i},{showLoading:!1})}},openPeopleInsight:o=>{const i=t||e.value;if(!i)throw console.error("Switch instance not found"),new Error("Switch instance not found");o||console.trace("No people_id provided, defaulting to empty string"),i("people_insight",{tab:"home",id:o||""},{showLoading:!1})},switchInstanceFunc:e}}),Yq=it({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:om()},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=Yt,s=So,o=e,i=t,r={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=$(o.status),l=$(o.timezone),c=$(!0),u=$(null),d=Z(()=>r[a.value]),h=Z(()=>{var x;return(x=o.user)==null?void 0:x.name}),f=$(!1),p=$(new Date);let g;qt(async()=>{g=setInterval(()=>{p.value=new Date},6e4)}),Rl(()=>{g&&clearInterval(g)});const v=Z(()=>{if(!l.value)return"";try{return p.value.toLocaleTimeString("en-US",{timeZone:l.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",l.value),""}}),y=async()=>{var x,O,z;if(o.apiUpdateFunction)try{const V=await o.apiUpdateFunction(o.user.id);if(!V){f.value=!0,console.error("No data returned from API");return}(x=V==null?void 0:V.private_info)!=null&&x.is_offline?a.value="offline":(O=V.private_info)!=null&&O.last_active?a.value="active":a.value="away",(z=V.private_info)!=null&&z.timezone&&(l.value=V.private_info.timezone),i("dataUpdated",V)}catch(V){f.value=!0,console.error("Failed to fetch user data:",V)}finally{c.value=!1}},b=()=>{!o.apiUpdateFunction||!o.enableAutoRefresh||(u.value!==null&&clearInterval(u.value),u.value=setInterval(y,o.refreshInterval))},S=()=>{u.value!==null&&(clearInterval(u.value),u.value=null)},C=Z(()=>{const x=globalThis.location.origin,O=En.getInstance().getItem("ws.code");return To({type:"people_insight",config:{ws_code:O,baseDomain:x,user_id:o.user.id}}).url}),{copyToClipboard:E,tooltip:R}=FF(C.value,()=>i("copyLink",o.user.id)),T=qh(),{openPeopleInsight:k}=T,A=x=>{if(x.ctrlKey||x.metaKey){window.open(C.value,"_blank");return}try{k(String(o.user.id))}catch{window.open(C.value,"_blank")}},I=x=>{A(x),i("insightClick",o.user.id)};Je([()=>o.enableAutoRefresh,()=>o.refreshInterval,()=>o.apiUpdateFunction],()=>{S(),o.enableAutoRefresh&&o.apiUpdateFunction&&b()}),qt(async()=>{o.apiUpdateFunction&&(await y(),b())}),as(S);const D=Z(()=>({name:o.user.name,initial:o.user.initial,id:o.user.id,profile_image:o.user.profile_image,color:o.user.color,size:72,borderRadius:"20px"}));return(x,O)=>(K(),ie("div",{class:J([x.$style["mini-people-card"],{[x.$style.loading]:c.value},"bg-skeleton"])},[ye("div",{class:J(x.$style["avatar-section"])},[!o.private&&!f.value?(K(),Ke(kA,{key:0,size:12,status:a.value,loading:c.value,"status-tooltip":d.value},{default:me(()=>[he(bh,Zt({readOnly:!0},D.value,{borderRadius:"8px"}),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ke(bh,Zt({key:1,readOnly:!0},D.value,{borderRadius:"8px"}),null,16))],2),ye("div",{class:J(x.$style["user-info"])},[ye("div",{class:J(x.$style["info-column"])},[We((K(),ie("span",{class:J(x.$style["user-name"])},[nt(yt(h.value),1)],2)),[[U(n),{content:h.value,delay:[1e3,0]}]]),l.value&&!f.value?(K(),ie("div",{key:0,class:J([x.$style["info-row"],x.$style["time-row"]])},[We((K(),ie("div",{class:J(x.$style["time-display"])},[he(at,{source:"remote",src:"Globe",class:J(x.$style["clock-icon"]),size:"10"},null,8,["class"]),ye("span",{class:J(x.$style["time-text"])},yt(v.value)+" ("+yt(e.timezone)+")",3)],2)),[[U(s),{isLoading:c.value,fullwidth:!0}]])],2)):Ze("",!0)],2),!e.readOnly&&!o.private&&!f.value?(K(),ie("div",{key:0,class:J([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(K(),Ke(ht,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Pt(I,["prevent","stop"]),disabled:o.disabled},null,8,["disabled"])):Ze("",!0),e.showCopyLinkButton?We((K(),Ke(ht,{key:1,variant:["icon","secondary"],size:"small","aria-label":"Copy link",onClick:Pt(U(E),["prevent","stop"]),disabled:o.disabled},{default:me(()=>[he(at,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[U(n),{content:U(R),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ze("",!0)],2)):Ze("",!0)],2)],2))}}),Zq=St(Yq,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_fq991_1",loading:"_loading_fq991_25","avatar-section":"_avatar-section_fq991_28","user-info":"_user-info_fq991_33","info-column":"_info-column_fq991_42","info-row":"_info-row_fq991_50","time-row":"_time-row_fq991_56","time-display":"_time-display_fq991_62","time-text":"_time-text_fq991_70",actions:"_actions_fq991_79","status-badge":"_status-badge_fq991_83",active:"_active_fq991_96",offline:"_offline_fq991_99",busy:"_busy_fq991_102",away:"_away_fq991_105","user-local-time":"_user-local-time_fq991_108","clock-icon":"_clock-icon_fq991_116",separator:"_separator_fq991_128",timezone:"_timezone_fq991_131","refresh-btn":"_refresh-btn_fq991_134",spinning:"_spinning_fq991_137",spin:"_spin_fq991_137","insight-btn":"_insight-btn_fq991_140","copy-link-btn":"_copy-link-btn_fq991_144","last-update":"_last-update_fq991_147","user-name":"_user-name_fq991_153","loading-overlay":"_loading-overlay_fq991_166","loading-spinner":"_loading-spinner_fq991_178"}}]]),Xq=St(it({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=Gr,s=Yt,o=e,{isEditing:i}=Ru(o),r=()=>{var h,f;const u=(h=o.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(o.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Z(()=>{var d,h;const u=(h=(d=o.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(o.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=o.params)==null?void 0:u.api)==null||d.stopEditing()},c=$();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>We((K(),Ke(ht,{class:J(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:U(i),onClick:Pt(r,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:me(()=>[he(at,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[U(s),"More actions"],[U(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),Jq=["src","width","height","alt"],Rm=St(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=So,{getCachedValue:n,setCachedValue:s}=wh({dbName:"visual-cache-db",storeName:"visuals"}),o=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},i=e,r=Z(()=>({minWidth:o(i.minWidth),maxWidth:o(i.maxWidth),minHeight:o(i.minHeight),maxHeight:o(i.maxHeight),aspectRatio:i.ratio,width:o(i.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await s(h,f)},c=Z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:u,loading:d}=WT(c,"visual",l,a);return(h,f)=>We((K(),ie("div",{class:J([h.$style.visualWrapper,{[h.$style.loading]:U(d)}]),style:cn(r.value)},[ye("img",{src:U(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(r.value)},null,12,Jq)],6)),[[U(t),{isLoading:U(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),Ha=St(it({name:"ListItem",directives:{tooltip:Yt},__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},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(!1),r=$(!1);function a(C){if(!C||typeof C!="object")return!1;const E=C;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const l=Z(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!S.prefix),c=Z(()=>!!S.suffix||s.danger&&i.value),u=Z(()=>{var C;return s.type==="status"&&typeof((C=s.data)==null?void 0:C.color)=="string"?{backgroundColor:s.data.color,border:Pg(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=dg(),h=Z(()=>({[d.active]:s.selected??!1,[d.disabled]:s.disabled??!1,[d.hover]:s.hover??!1,[d.clickable]:(s.clickable??!0)&&!s.disabled,[d.danger]:s.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:c.value,[d.readOnly]:s.readOnly}));Z(()=>({content:"Cancel",...b})),Z(()=>({content:"Confirm",theme:"warning",...b}));function f(C){return{name:C.name,initial:C.initial,id:C.id,profile_image:C.profile_image??null,color:C.color,size:24}}function p(){i.value=!1}function g(C){C?o("click",C):(s.clickable??!0)&&(o("update:selected",!s.selected),o("select",!s.selected))}function v(C){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||g(C);o("handleClick",C)}}const y=()=>{i.value?p():o("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),S=Xp();return Je(()=>s.show,C=>{C===!1&&(i.value=!1)}),t({select:()=>{v(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(C,E)=>{const R=oo("focusable"),T=oo("tooltip");return We((K(),Ke(ht,{variant:["menu-item",e.danger?"danger":"menu-item"],class:J([C.$style["list-item"],h.value]),onHandleClick:v,onMouseenter:E[0]||(E[0]=k=>r.value=!0),onMouseleave:E[1]||(E[1]=k=>r.value=!1),onEscape:y},{default:me(()=>[l.value?(K(),ie("div",{key:0,class:J(C.$style["list-item__prefix"])},[xt(C.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ke(at,{key:0,src:e.icon,source:"remote",class:J(C.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(K(),ie("div",{key:1,class:J(C.$style["status-indicator"]),style:cn(u.value)},null,6)):e.type==="assignee"&&a(e.data)?(K(),Ke(bh,Zt({key:2},f(e.data),{class:C.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ze("",!0)])],2)):Ze("",!0),ye("div",{class:J(C.$style["list-item__label"])},[xt(C.$slots,"label",{selected:e.selected},()=>[nt(yt(e.label),1)])],2),c.value?(K(),ie("div",{key:1,class:J(C.$style["list-item__suffix"])},[xt(C.$slots,"suffix",{item:C.$props,hovered:r.value},()=>[e.danger&&i.value?(K(),ie("div",{key:0,class:J(C.$style["confirm-action"])},[We((K(),Ke(ht,{variant:["tertiary","icon","danger"],size:"small",onClick:Pt(p,["stop","prevent"])},{default:me(()=>[he(at,{src:"Xmark",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.0`],[T,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),We((K(),Ke(ht,{variant:["danger","primary","icon"],size:"small",onClick:Pt(g,["stop","prevent"])},{default:me(()=>[he(at,{src:"Check",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.1`],[T,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ze("",!0)])],2)):Ze("",!0)]),_:3},8,["variant","class"])),[[R,s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_y7vz1_1",disabled:"_disabled_y7vz1_16",danger:"_danger_y7vz1_23","has-prefix":"_has-prefix_y7vz1_26","has-suffix":"_has-suffix_y7vz1_26",clickable:"_clickable_y7vz1_40",readOnly:"_readOnly_y7vz1_43",hover:"_hover_y7vz1_47",active:"_active_y7vz1_53","list-item__prefix":"_list-item__prefix_y7vz1_78","list-item__label":"_list-item__label_y7vz1_86","list-item__suffix":"_list-item__suffix_y7vz1_100","status-indicator":"_status-indicator_y7vz1_107","item-icon":"_item-icon_y7vz1_113","arbo-icon-state":"_arbo-icon-state_y7vz1_118","item-avatar":"_item-avatar_y7vz1_121","confirm-action":"_confirm-action_y7vz1_130"}}]]),Qq=["tabindex"],vs=St(it({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n;Xp();const i=dg(),r=$(null),a=$("default"),l=Z(()=>{if(typeof s.size=="number")return`${s.size}px`;switch(s.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=Z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=Z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:s.disabled,[i.readOnly]:s.readOnly,[i.error]:s.error,[i.clickable]:s.clickable,[i.active]:s.actived,[i.hovered]:s.hovered,[i.focused]:!s.readOnly&&!s.disabled&&s.focused,[i.bordered]:s.bordered})),d=()=>{var C,E;const g=((C=r.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=r.value)==null?void 0:E.querySelectorAll(":scope > .wrapper-suffix").length)||0,y="var(--icon-size)",S=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${S}))`:!g&&v?`calc(100% - (${v} * ${y} + ${S})) repeat(${v}, ${y})`:g&&v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${v} * ${y} + ${S})) repeat(${v}, ${y})`:"100%"},h=$("100%"),f=()=>{h.value=d()};qd(()=>{f()}),qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:r,updateState:p,componentState:a,focus:()=>{Et(()=>{var g;(g=r.value)==null||g.focus()})},escape:()=>{o("escape")}}),(g,v)=>(K(),ie("div",{ref_key:"rootEl",ref:r,class:J([U(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[xt(g.$slots,"prefix",{hovered:s.hovered,focused:s.focused}),xt(g.$slots,"default",{hovered:s.hovered,focused:s.focused,updateComponentState:p,disabled:s.disabled}),xt(g.$slots,"suffix",{hovered:s.hovered,focused:s.focused})],14,Qq))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_11gbb_1",readOnly:"_readOnly_11gbb_26",bordered:"_bordered_11gbb_29",disabled:"_disabled_11gbb_29",active:"_active_11gbb_29",focused:"_focused_11gbb_29",hovered:"_hovered_11gbb_34",error:"_error_11gbb_38",clickable:"_clickable_11gbb_51",suffix:"_suffix_11gbb_57",prefix:"_prefix_11gbb_58"}}]]),eY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const tY=Object.prototype.toString,nY=e=>tY.call(e)==="[object Object]",Du=()=>{};function sY(e,t){function n(...s){return new Promise((o,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(o).catch(i)})}return n}function oY(e,t={}){let n,s,o=Du;const i=l=>{clearTimeout(l),o(),o=Du};let r;return l=>{const c=Mr(e),u=Mr(t.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(s&&(i(s),s=void 0),Promise.resolve(l())):new Promise((d,h)=>{o=t.rejectOnCancel?h:d,r=l,u&&!s&&(s=setTimeout(()=>{n&&i(n),s=void 0,d(r())},u)),n=setTimeout(()=>{s&&i(s),s=void 0,d(l())},c)})}}function jb(e){return Array.isArray(e)?e:[e]}function iY(e,t=200,n={}){return sY(oY(t,n),e)}function rY(e,t,n){return Je(e,t,{...n,immediate:!0})}const OA=eY?window:void 0;function Yh(e){var t;const n=Mr(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Kb(...e){const t=(s,o,i,r)=>(s.addEventListener(o,i,r),()=>s.removeEventListener(o,i,r)),n=Z(()=>{const s=jb(Mr(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0});return rY(()=>{var s,o;return[(s=(o=n.value)===null||o===void 0?void 0:o.map(i=>Yh(i)))!==null&&s!==void 0?s:[OA].filter(i=>i!=null),jb(Mr(n.value?e[1]:e[0])),jb(U(n.value?e[2]:e[1])),Mr(n.value?e[3]:e[2])]},([s,o,i,r],a,l)=>{if(!(s!=null&&s.length)||!(o!=null&&o.length)||!(i!=null&&i.length))return;const c=nY(r)?{...r}:r,u=s.flatMap(d=>o.flatMap(h=>i.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function qb(e,t,n={}){const{window:s=OA,ignore:o=[],capture:i=!0,detectIframe:r=!1,controls:a=!1}=n;if(!s)return a?{stop:Du,cancel:Du,trigger:Du}:Du;let l=!0;const c=v=>Mr(o).some(y=>{if(typeof y=="string")return Array.from(s.document.querySelectorAll(y)).some(b=>b===v.target||v.composedPath().includes(b));{const b=Yh(y);return b&&(v.target===b||v.composedPath().includes(b))}});function u(v){const y=Mr(v);return y&&y.$.subTree.shapeFlag===16}function d(v,y){const b=Mr(v),S=b.$.subTree&&b.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(C=>C.el===y.target||y.composedPath().includes(C.el))}const h=v=>{const y=Yh(e);if(v.target!=null&&!(!(y instanceof Element)&&u(e)&&d(e,v))&&!(!y||y===v.target||v.composedPath().includes(y))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[Kb(s,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:i}),Kb(s,"pointerdown",v=>{const y=Yh(e);l=!c(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),r&&Kb(s,"blur",v=>{setTimeout(()=>{var y;const b=Yh(e);((y=s.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(b!=null&&b.contains(s.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const aY=["value","placeholder","disabled","readonly","inputmode","maxlength"],Yb=St(it({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const s=Gr,o=Yt,i=e,r=n,a=$(null),l=$(i.modelValue||"");Je(l,()=>{r("onValidation",l.value)});const c=$(!1),u=$(i.modelValue||"");Je(()=>i.modelValue,P=>{l.value=P||"",u.value=P||""});const d=Z(()=>{var P;return((P=l.value)==null?void 0:P.length)>0}),h={text:P=>P.slice(0,i.maxLength||255),number:P=>{let L=P.replace(/[^\d.-]/g,"");const te=L.split(".");te.length>2&&(L=te[0]+"."+te.slice(1).join("")),L=L.replace(/-/g,(X,we)=>we===0?X:"");const Fe=L.startsWith("-")?"-":"",ce=L.replace("-","").split(".");return ce[0].length>17&&(ce[0]=ce[0].substring(0,17)),i.maxDecimalChar!==void 0&&ce.length>1&&(ce[1]=ce[1].substring(0,i.maxDecimalChar)),L=Fe+ce.join("."),L},email:P=>P.replace(/\s/g,"").slice(0,i.maxLength||255),url:P=>P.replace(/\s/g,"").slice(0,i.maxLength||255),tel:P=>P.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},f=P=>{const L=h[i.type];return L?L(P):P},p=iY(P=>{i.autoEmit&&(r("update:modelValue",P),r("input",P))},i.debounceDelay),g=P=>{const L=P;if(i.disabled||i.readOnly){L.preventDefault();return}const te=L.target,de=te.selectionStart||0,Fe=l.value,pe=f(te.value);Fe!==pe&&(l.value=pe,r("input",pe),i.autoEmit&&p(pe),te.value!==pe&&(te.value=pe,Et(()=>{let ce=de;if(pe.length<te.value.length)ce=de;else{const X=pe.length-Fe.length;ce=de+X}ce=Math.max(0,Math.min(ce,pe.length)),te.setSelectionRange(ce,ce)})))},v=P=>{if(i.disabled||i.readOnly){P.preventDefault();return}c.value=!0;const L=l.value;l.value="",r("update:modelValue",""),r("clear"),L!==""&&r("change",""),P.preventDefault(),P.stopImmediatePropagation(),P.stopPropagation(),Et(()=>{var te;(te=a.value)==null||te.focus(),setTimeout(()=>{c.value=!1},100)})},y=P=>{i.disabled||i.readOnly||(r("focus",P),i.selectOnFocus&&Et(()=>{P.target.select()}))},b=P=>{if(c.value)return;const te=P.target.value;i.autoEmit||r("update:modelValue",te),u.value!==te&&(r("change",te),u.value=te),r("blur",te,P)},S=P=>{setTimeout(()=>{Et(()=>{const te=P.target.value;r("enter",te,P),r("enterValue",te),i.submitOnEnter&&(P.preventDefault(),i.autoEmit||r("update:modelValue",te),u.value!==te&&(r("change",te),u.value=te))})},1e3)},C=P=>{const L=P.target,te=L.value;if(r("escape",te,P),P.preventDefault(),P.stopImmediatePropagation(),P.stopPropagation(),i.autoEmit){r("cancel"),i.blurOnEscape&&L.blur();return}l.value=i.modelValue||"",a.value&&(a.value.value=l.value),r("cancel"),i.blurOnEscape&&L.blur()},E=P=>{const te=P.target.value;r("tab",te,P),i.autoEmit||(r("update:modelValue",te),u.value!==te&&(r("change",te),u.value=te))},R=(P,L,te)=>P===""?!0:P==="."?te>0:new RegExp(`^\\d{0,${L}}(\\.\\d{0,${te}})?$`).test(P),T=P=>{if(r("keydown",P),P.key===" "&&P.stopPropagation(),i.type==="number"){if(P.key==="e"||P.key==="E"){P.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(P.key)||P.ctrlKey||P.metaKey||P.altKey)){if(Number.isNaN(Number(P.key))&&P.key!=="."&&P.key!=="-"){P.preventDefault();return}const de=l.value+P.key;if(!R(de,17,i.maxDecimalChar||2)){P.preventDefault(),console.log("BLOCKED",de);return}}}P.key==="Escape"?C(P):P.key==="Enter"?S(P):P.key==="Tab"?E(P):(P.key==="ArrowUp"||P.key==="ArrowDown")&&i.type==="number"&&P.preventDefault()},k=P=>{r("keyup",P)},A=P=>{if(i.disabled||i.readOnly){P.preventDefault();return}r("paste",P)},I=P=>{if(i.disabled||i.readOnly){P.preventDefault();return}r("cut",P)},D=P=>{r("select",P)},x=`input-text-${Math.random().toString(36).substr(2,9)}`,O=$(!1),z=Z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Je(()=>l.value,P=>{i.validatorFnc?O.value=!!P&&!i.validatorFnc(P):O.value=!1});const V=$(null),j=Z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:O.value,inputRef:a,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:V,bordered:!0})),{argsMain:ee,isHover:Q,isFocus:G}=ms(j);t({triggerFocus:()=>{Et(()=>{var P;(P=a.value)==null||P.focus()})},focus:()=>{fe()},blur:()=>{Et(()=>{var P;(P=a.value)==null||P.blur()})},select:()=>{Et(()=>{var P;(P=a.value)==null||P.select()})},setSelectionRange:(P,L)=>{Et(()=>{var te;(te=a.value)==null||te.setSelectionRange(P,L)})},getValue:()=>l.value,setValue:P=>{l.value=f(P),a.value&&(a.value.value=l.value)}});const fe=()=>{!i.disabled&&!i.readOnly&&Et(()=>{var P;(P=a.value)==null||P.focus()})},q=Z(()=>G.value&&d.value);return(P,L)=>(K(),ie("div",{class:J([P.$style["input-wrapper"],"input-editor"]),onClick:fe},[We((K(),Ke(vs,Zt(U(ee),{ref_key:"wrapperRef",ref:V,class:[P.$style["input-box"],{[P.$style["is-hovered"]]:U(Q),[P.$style["is-focused"]]:U(G),[P.$style["has-input"]]:d.value,[P.$style["is-editting"]]:q.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:me(()=>[xt(P.$slots,"prefix")]),suffix:me(()=>[d.value&&!i.disabled&&!i.readOnly?xt(P.$slots,"clear",{key:0},()=>[We((K(),Ke(ht,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Pt(v,["prevent","stop"]),size:18,rounded:!0,class:J(["wrapper-suffix",P.$style["clear-button"]])},{default:me(()=>[he(at,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[U(o),{content:"Clear",contentClass:"extra-padding"}]])]):xt(P.$slots,"suffix",{key:1})]),default:me(()=>[ye("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:J([P.$style["column-config__input"]]),id:x,disabled:e.disabled,readonly:e.readOnly,inputmode:z.value,maxlength:i.maxLength,onInput:g,onFocus:y,onBlur:b,onKeydown:T,onKeyup:k,onPaste:A,onCut:I,onSelect:D},null,42,aY)]),_:3},16,["class","bordered"])),[[U(s),i.focusIndex]]),O.value?xt(P.$slots,"error",{key:0}):Ze("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wqanj_1","is-disabled":"_is-disabled_wqanj_16","is-readonly":"_is-readonly_wqanj_16","is-hovered":"_is-hovered_wqanj_16","is-focused":"_is-focused_wqanj_20","column-config__input":"_column-config__input_wqanj_40","clear-button":"_clear-button_wqanj_55"}}]]),lY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},Zb=it({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(null),r=Ri(c=>{o("update:modelValue",c),o("search",c)},sr),a=()=>{o("update:modelValue",""),o("clear"),Et(()=>{var c;(c=i.value)==null||c.focus()})},l=$(s.modelValue);return t({focus:()=>{var c;(c=i.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(K(),Ke(Yb,{focusIndex:s.focusIndex,ref_key:"searchInput",ref:i,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:U(r),onClear:a,onCancel:u[1]||(u[1]=d=>o("cancel")),"auto-emit":!0},{prefix:me(()=>[ye("div",lY,[he(at,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),cY=["aria-activedescendant"],uY=["innerHTML"],dY=10,Xr=St(it({__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:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const s=Yt,o={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,r=n,a=$(""),l=$(-1),c=$(null),u=$(null),d=$(new Map),h=Z(()=>db(a.value)),f=()=>{const q=h.value;if(!q||q.length<i.minQueryLength)return i.options;if(d.value.has(q))return d.value.get(q);const P=i.options.map(L=>({item:L,score:aK(` ${L.label} `,q)})).filter(({score:L})=>L>0).sort((L,te)=>te.score-L.score).map(({item:L})=>L);return d.value.set(q,P),P},p=$([]);Je(()=>i.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Z(()=>i.hasMore&&!i.loading&&!i.loadingMore),v=Ri(q=>{a.value=q,l.value=-1,r("search",q)},sr),y=async q=>{G.value=0,await v(q||""),G.value=1},b=q=>a.value?lK(q,a.value):q,S=q=>{const L={[o.ARROW_DOWN]:()=>C(q),[o.ARROW_UP]:()=>E(q),[o.ENTER]:()=>k(q),[o.ESCAPE]:()=>A(q),[o.TAB]:()=>I(q)}[q.key];L&&L()},C=q=>{q.preventDefault(),R(1)},E=q=>{q.preventDefault(),R(-1)},R=q=>{const P=p.value.length;if(P===0)return;let L;q>0?L=(l.value+1)%P:l.value>0?L=l.value-1:L=P-1,l.value=L,T()},T=()=>{Et(()=>{var P;const q=(P=u.value)==null?void 0:P.querySelectorAll('[role="menuitem"]')[l.value];q==null||q.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},k=q=>{if(q.preventDefault(),l.value>=0&&l.value<p.value.length){const L=p.value[l.value];D(L,q)}},A=q=>{q.preventDefault(),O()},I=q=>{r("tab",q)},D=(q,P)=>{!q||q.disabled||(r("select",q,P),l.value=-1,O())},x=q=>{q>=0&&q<p.value.length&&(l.value=q)},O=()=>{r("close")},z=()=>{if(!g.value||!u.value)return;const{scrollTop:q,clientHeight:P,scrollHeight:L}=u.value;L-(q+P)<=dY&&r("loadMore")},V=()=>{var q,P,L;(q=u.value)==null||q.addEventListener("scroll",z),(L=(P=Q.value)==null?void 0:P.$el)==null||L.addEventListener("keydown",S)},j=()=>{var q,P,L;(q=u.value)==null||q.removeEventListener("scroll",z),(L=(P=Q.value)==null?void 0:P.$el)==null||L.removeEventListener("keydown",S)};qt(()=>{V()}),as(()=>{j()}),Je(()=>i.loading,q=>{!q&&p.value.length>0&&(l.value=-1)});const ee=q=>q?Array.isArray(i.selectedId)?i.selectedId.includes(String(q.id)):i.selectedId==q.id:!1,Q=$(null);Je(l,()=>{T()}),t({focus:()=>{Et(()=>{var q;(q=Q.value)==null||q.focus()})},reset:()=>{var q;(q=Q.value)==null||q.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:O,clearSearch:()=>{a.value=""},scrollTo:q=>{u.value&&(u.value.scrollTop=q)},selectIndex:q=>{q>=0&&q<p.value.length&&(l.value=q,T())}});const G=$(0);Je([()=>i.loading,()=>a.value,()=>i.options,()=>i.loadingMore],()=>{const q=i.options.length>0&&p.value.length>0,P=!q&&a.value.length>0,L=!q&&a.value.length===0;i.loading?G.value=0:q?G.value=1:P?G.value=2:L&&(G.value=3)},{immediate:!0,deep:!0});const fe=()=>{r("cancel")};return(q,P)=>(K(),ie("datalist",{ref_key:"searchListRef",ref:c,class:J([q.$style["search-list"],G.value===3||G.value===2?q.$style.empty:"",p.value.length>8?q.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.width})},[he(Zb,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":P[0]||(P[0]=L=>a.value=L),class:J(q.$style["search-box"]),disabled:e.loading,onSearch:y,onClear:P[1]||(P[1]=L=>y("")),onCancel:fe},null,8,["modelValue","class","disabled"]),ye("div",{ref_key:"popupRef",ref:u,class:J(q.$style["list-container"]),style:cn({maxHeight:e.maxHeight})},[xt(q.$slots,"extra-item",{query:a.value}),(K(!0),ie(Tt,null,xn(p.value,(L,te)=>We((K(),ie("div",{key:`${L.id}-${te}`,role:"menuitem"},[xt(q.$slots,"item",{item:L,index:te,selectedIndex:l.value,isSelected:ee,handleSelect:D,handleItemHover:x,getHighlightedLabel:b,query:a.value,idx:te},()=>[L.hide?Ze("",!0):(K(),Ke(Ha,Zt({key:0,ref_for:!0},L,{hover:te===l.value,selected:ee(L),type:L.type,id:`item-${te}`,"aria-selected":te===l.value,onClick:de=>D(L,de),onMouseover:de=>x(te),onEscape:O}),{prefix:me(()=>[xt(q.$slots,"prefix-item",{item:L})]),label:me(()=>[a.value?We((K(),ie("span",{key:0,class:J(q.$style.match),innerHTML:b(L.label)},null,10,uY)),[[U(s),{content:L.label,delay:[1e3,0]}]]):We((K(),ie("span",{key:1,class:J(q.$style["item-label"])},[nt(yt(L.label),1)],2)),[[U(s),{content:L.label,delay:[1e3,0]}]])]),suffix:me(({hovered:de})=>[xt(q.$slots,"action",{item:L,isHovered:te===l.value,hovered:de,selected:l.value==te})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[Ei,G.value===1]])),128)),G.value===0?xt(q.$slots,"loading-more",{key:0},()=>[(K(),ie(Tt,null,xn(8,L=>ye("div",{class:J(q.$style["loading-more"]),key:L},[ye("div",{class:J(q.$style["loading-skeleton"])},null,2),ye("div",{class:J(q.$style["loading-skeleton"])},null,2)],2)),64))]):Ze("",!0),G.value===2?(K(),ie("div",{key:1,class:J(q.$style["no-results"])},[xt(q.$slots,"empty",{query:a.value},()=>[ye("div",{class:J(q.$style["no-results-content"])},[...P[2]||(P[2]=[ye("div",null,[nt(" No results. "),ye("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ze("",!0),G.value===3?(K(),ie("div",{key:2,class:J(q.$style["no-results"])},[xt(q.$slots,"empty-list",{},()=>[ye("div",{class:J(q.$style["no-results-content"])},[...P[3]||(P[3]=[ye("div",null,"No items available.",-1)])],2)])],2)):Ze("",!0),xt(q.$slots,"footer")],6)],14,cY))}}),[["__cssModules",{$style:{"search-list":"_search-list_e1qo6_1",empty:"_empty_e1qo6_9",scrollable:"_scrollable_e1qo6_15","list-container":"_list-container_e1qo6_22","item-label":"_item-label_e1qo6_41","loading-state":"_loading-state_e1qo6_49","loading-more":"_loading-more_e1qo6_50","loading-skeleton":"_loading-skeleton_e1qo6_61","is-loading":"_is-loading_e1qo6_68","no-results":"_no-results_e1qo6_123","no-results-content":"_no-results-content_e1qo6_130",title:"_title_e1qo6_133",tips:"_tips_e1qo6_139",match:"_match_e1qo6_153","skeleton-loading":"_skeleton-loading_e1qo6_1"}}]]),Xl=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=qW,n=e,s=$(n.appendTo||void 0),o=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:s.value}),i=$(o());Je(()=>n,()=>{setTimeout(()=>{Et(()=>{s.value=n.appendTo||void 0,i.value=o()})},50)},{immediate:!0,deep:!0});const r=Z(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial}));return(a,l)=>We((K(),Ke(bh,J_(xw(r.value)),null,16)),[[U(t),i.value]])}}),hY={class:"avatar-wrapper"},fY={class:"assignee-label"},pY=St(it({__name:"AssigneeItem",props:{user:{},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Yt,s=e,o=Z(()=>({name:s.user.name,id:s.user.id,profile_image:s.user.profile_image,color:{bgColor:s.user.color.bgColor,textColor:s.user.color.textColor},initial:s.user.initial})),i=Z(()=>s.isMe),r=Xp(),a=Z(()=>{if(!l.value||!r.actions)return 0;let c=0;const u=d=>{d.forEach(h=>{h.type===Tt&&Array.isArray(h.children)?u(h.children):h.type!==Kn&&h.type!==_a&&c++})};return u(r.actions()),c}),l=$(!1);return(c,u)=>(K(),ie("div",{class:J(["assignee-selector-item",{hovered:l.value,disabled:s.disabled,selected:s.selected,single:a.value==0,focused:s.focused}]),style:cn({"--actions-count":a.value}),onMouseenter:u[0]||(u[0]=d=>l.value=!0),onMouseleave:u[1]||(u[1]=d=>l.value=!1)},[ye("div",hY,[he(Xl,{user:o.value,"show-profile":!0,isMe:i.value,"append-to":s.appendTo,"api-update-function":s.apiUpdateFunction},null,8,["user","isMe","append-to","api-update-function"]),s.multipleSelect?(K(),ie("div",{key:0,class:J(["avatar-indicator",[s.selected?"remove":"add"]])},[s.selected?(K(),Ke(at,{key:0,src:"CircleXMark"})):(K(),Ke(at,{key:1,src:"CirclePlus"}))],2)):Ze("",!0)]),We((K(),ie("div",fY,[xt(c.$slots,"name",{},()=>[nt(yt(s.user.name),1)],!0)])),[[U(n),{content:s.user.name,delay:[1e3,0]}]]),l.value?xt(c.$slots,"actions",{key:0},void 0,!0):Ze("",!0)],38))}}),[["__scopeId","data-v-90f2943c"]]),gY=["innerHTML"],mY=20,MA=St(it({__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","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,{id:i}=Np(o),r=n,a=P=>{var te,de;const L=(de=(te=o.params)==null?void 0:te.api)==null?void 0:de.getRowNode(String(i.value));L==null||L.setDataValue("assignees",Ox(P.assignees)),r("updated",P),r("update-completed")},l=$(!1),c=$(!1),u=$(null),d=$(1),h=$(!0),f=$(0),p=$(""),g=Sn("bulkUpdate",$(!1)),v=Sn("isSelectAll",$(!1)),{unAssignAll:y,replaceAssignees:b,handleSelect:S,assigneeList:C,mergedOptions:E,selectedUserIds:R}=um({...o,entityId:o.entityId,updateRowData:a,value:o.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{r("update-failed")}}),{apiServices:T}=Qn(!g.value,o),k=Sn("workspaceId"),A=async(P=1,L="",te=!1)=>{var de,Fe,pe,ce,X;if(!T.value||!o.id&&!o.ids)throw console.error("API service or item identifiers are undefined",T.value,o.id,o.ids),new Error("API service or item identifiers are undefined");if(te?c.value=!0:l.value=!0,u.value=null,!((de=T.value)!=null&&de.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const we=await((Fe=T.value)==null?void 0:Fe.multipleAssignableUser({workspaceId:String(k),itemIds:(o.ids??(o.id?[o.id]:[])).map(String),page:P,perPage:mY,q:L.trim()})),ae=((pe=mu(we.data))==null?void 0:pe.map(cm))??[];C.value=te?nu(C.value,ae,"id"):ae,f.value=we.meta.total,h.value=(((ce=we==null?void 0:we.meta)==null?void 0:ce.current_page)||0)<(((X=we==null?void 0:we.meta)==null?void 0:X.last_page)||0),d.value=P}catch(we){console.error("Error fetching assignable users:",we),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},I=()=>{!c.value&&h.value&&A(d.value+1,p.value,!0)},D=Ri(async P=>{p.value=P,await A(1,P,!1)},sr),x=()=>A(1,p.value,!1);qt(()=>{var P;(P=z.value)==null||P.focus()}),t({getValue:()=>{var P;return(P=E.value.find(L=>L.selected))==null?void 0:P.value},refresh:x,clearInternal:()=>{R.value=[]},focus:()=>{var P;(P=z.value)==null||P.focus()}});const O=()=>{const P=En.getInstance().getItem("BASE_URL"),L=To({type:"access_setting",config:{baseDomain:P,ws_code:o.workspaceId,entity_id:k}}).url;window.open(L,"_blank")},z=$(null);qt(()=>{Et(()=>{var P;(P=z.value)==null||P.focus()})}),Je([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{A()},{deep:!0,immediate:!0});const V=P=>{var te;const L=En.getInstance().getItem("ws.code");return((te=T.value)==null?void 0:te.getUserInformation(L,P))||Promise.resolve(null)},j=async P=>{try{r("start-update");const L=await S(P);r("update-completed")}catch(L){r("update-failed"),console.error("Error updating assignees:",L)}},ee=async()=>{try{r("start-update");const P=await y();r("update-completed")}catch(P){r("update-failed"),console.error("Error unassigning all assignees:",P)}},Q=async P=>{try{r("start-update");const L=await b(P);r("update-completed")}catch(L){r("update-failed"),console.error("Error replacing assignees:",L)}},G=()=>{var P,L;r("cancel"),(L=(P=o.params)==null?void 0:P.api)==null||L.stopEditing()};Ki("popupAttachRef",z);const fe=$(),q=$(!1);return qt(()=>{Et(()=>{setTimeout(()=>{q.value=!0},50)})}),(P,L)=>(K(),ie("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:fe},[he(Xr,Zt({"selected-id":U(R)},{...o},{options:U(E),loading:l.value,ref_key:"popupRef",ref:z,"loading-more":c.value,"has-more":h.value,onSelect:L[0]||(L[0]=te=>{j(te)}),"data-wrapper":"true",onSearch:U(D),onLoadMore:I,onCancel:G,onClose:G}),Yd({"extra-item":me(()=>[he(ht,{variant:"menu-item",onHandleClick:ee},{prefix:me(()=>[ye("div",{class:J(P.$style["unassign-icon"])},[he(at,{src:"UserXMark",source:"remote"})],2)]),default:me(()=>[L[1]||(L[1]=nt(" Unassign all ",-1))]),_:1})]),item:me(({item:te,selectedIndex:de,isSelected:Fe,handleItemHover:pe,getHighlightedLabel:ce,query:X,idx:we})=>[he(pY,{user:te.data,"multiple-select":!0,"append-to":fe.value,isMe:!1,hover:we===de,selected:Fe(te),onClick:Pt(ae=>j(te),["stop","prevent"]),onMouseover:ae=>pe(we),"api-update-function":V},{name:me(()=>[X?We((K(),ie("span",{key:0,class:J([P.$style["item-label"],P.$style.match]),style:{flex:"1"},innerHTML:ce(te.label)},null,10,gY)),[[U(s),{content:te.label}]]):We((K(),ie("span",{key:1,class:J(P.$style["item-label"]),style:{flex:"1"}},[nt(yt(te.label),1)],2)),[[U(s),{content:te.label}]])]),actions:me(()=>[We((K(),Ke(ht,{variant:"secondary",size:"small",label:"",onClick:Pt(ae=>{var Oe;return Q((Oe=te.data)==null?void 0:Oe.id)},["stop"])},{default:me(()=>[he(at,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[U(s),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),"empty-list":me(()=>[ye("div",{class:J(P.$style["empty-state"])},[L[4]||(L[4]=nt(" No assignee available. ",-1)),L[5]||(L[5]=ye("br",null,null,-1)),he(ht,{onClick:O,variant:["tertiary"],size:"small"},{default:me(()=>[...L[3]||(L[3]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:me(()=>[ye("div",{class:J(P.$style["error-message"])},[nt(yt(u.value)+" ",1),he(ht,{onClick:x,size:"small"},{default:me(()=>[...L[2]||(L[2]=[nt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_zb1un_1","item-assignee":"_item-assignee_zb1un_6","item-action":"_item-action_zb1un_6","item-label":"_item-label_zb1un_16","unassign-icon":"_unassign-icon_zb1un_25","error-message":"_error-message_zb1un_36","empty-state":"_empty-state_zb1un_46","skeleton-avatar":"_skeleton-avatar_zb1un_59"}}]]),vY=it({__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;Ki("bulkUpdate",!0);const s=t,o=$(null),i=f=>{var p;h.value=!1,s("update",f),(p=o.value)==null||p.clearInternal()},{triggerRef:r,popupRef:a,hide:l,isVisible:c}=us({toggleOnClick:!0,zIndex:2}),u=$(null),d=f=>{f.key==="Escape"&&a.value&&l()};qt(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",d)}),as(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",d)}),Je(c,f=>{var p,g;f?(p=o.value)==null||p.focus():(g=o.value)==null||g.clearInternal()});const h=$(!1);return(f,p)=>(K(),ie("div",{ref_key:"mainRef",ref:u},[ye("div",{ref_key:"triggerRef",ref:r},[he(ht,{class:"action-button",variant:n.variant,loading:h.value},{default:me(()=>[he(at,{src:"UserPlus",class:"icon"}),p[3]||(p[3]=nt(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),ye("div",{ref_key:"popupRef",ref:a,style:{display:"none"}},[U(c)?(K(),Ke(MA,Zt({key:0,ref_key:"assigneeGroupEditorRef",ref:o},n,{ids:e.ids,onUpdated:i,onStartUpdate:p[0]||(p[0]=g=>h.value=!0),onUpdateFailed:p[1]||(p[1]=g=>h.value=!1),onUpdateCompleted:p[2]||(p[2]=g=>h.value=!1)}),null,16,["ids"])):Ze("",!0)],512)],512))}}),Zh=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],yY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Ga=(e,t)=>{const n=s=>{var o,i;if(s.key==="Tab"){const r=s.shiftKey||s.metaKey;s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation();const a=document.activeElement,l=(o=a==null?void 0:a.dataset)==null?void 0:o.index;if(l){let c=Zh.indexOf(l);const u=r?-1:1;for(const d of Zh){c=(c+u+Zh.length)%Zh.length;const h=Zh[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(s.key==="Enter")(i=s.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(s.key==="Escape"){s.stopPropagation(),s.stopImmediatePropagation();const r=document.querySelector('[data-index="calendar-wrapper"]');r==null||r.focus()}};if(yY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},wY=["aria-label"],CY=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],bY={style:{flex:"1"}},SY=St(it({__name:"MainCalendar",props:eD({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:eD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const s=Yt,o=$(null),i=e,r=Z(()=>i.startDate&&i.endDate),a=OH(e,"tracingCase"),l=n,c=$(i.year),u=$(i.month);Je(()=>[i.year,i.month],([P,L])=>{c.value=P,u.value=L});const d=Z(()=>mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),h=Z(()=>mt.now().setZone(i.timezone)),f=Z(()=>i.startDate?mt.fromJSDate(i.startDate,{zone:i.timezone}):null),p=Z(()=>i.endDate?mt.fromJSDate(i.endDate,{zone:i.timezone}):null),g=$(f.value),v=$(p.value),y=$(f.value),b=$(p.value);Je([f,p],()=>{i.requireConfirm||(g.value=f.value,v.value=p.value,y.value=f.value,b.value=p.value)},{immediate:!0});const S=Z(()=>i.requireConfirm?g.value:f.value),C=Z(()=>i.requireConfirm?v.value:p.value);Je(()=>i.activeField,P=>{const L=P==="start"?S.value:C.value;L&&(c.value=L.year,u.value=L.month)}),Je(()=>{var P,L;return[(P=S.value)==null?void 0:P.toISODate(),(L=C.value)==null?void 0:L.toISODate(),i.activeField]},()=>{const P=i.activeField==="start"?S.value:C.value;P&&(P.year!==c.value||P.month!==u.value)&&(c.value=P.year,u.value=P.month)});function E(P){return P.setZone("utc")}const R=$("");function T(P){R.value=P.toISODate()||"",Et(()=>{const L=document.querySelector(`.arbo-calendar-day[data-date="${R.value}"]`);L==null||L.focus()})}Je(()=>{var P,L;return[c.value,u.value,i.activeField,(P=S.value)==null?void 0:P.toISODate(),(L=C.value)==null?void 0:L.toISODate()]},()=>{const P=i.activeField==="start"?S.value:C.value;let L;P&&P.year===c.value&&P.month===u.value?L=P:S.value&&S.value.year===c.value&&S.value.month===u.value?L=S.value:L=h.value,T(L)});function k(P){return P.toFormat("d")}const A=Z(()=>{const P=mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}),L=P.weekday,te=i.weekStart===1?(L+6)%7:L%7;let de=P.minus({days:te});const Fe=[],pe=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),ce=dg();for(let we=0;we<42;we++){const ae=[];de.month!==u.value&&ae.push(ce["is-outside"]),de.hasSame(h.value,"day")&&ae.push(ce["is-today"]),S.value&&de.hasSame(S.value,"day")&&ae.push(ce["is-selected-start"]),C.value&&de.hasSame(C.value,"day")&&ae.push(ce["is-selected-end"]),S.value&&C.value&&de>S.value&&de<C.value&&ae.push(ce["is-in-range"]);const Oe=k(de),H=pe[de.weekday-1]||"";Fe.push({dt:de,iso:de.toISODate()||"",label:de.toFormat("d"),displayLabel:Oe,weekdayLabel:H,aria:de.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:ae}),de=de.plus({days:1})}const X=[];for(let we=0;we<6;we++)X.push(Fe.slice(we*7,we*7+7));return X}),I=Z(()=>{const P=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?P:[P[6],...P.slice(0,6)]});function D(P,L,te){const de=P==="start"?L.startOf("day"):L.endOf("day"),Fe=E(de),pe={year:de.year,month:de.month,day:de.day,utc:Fe.toISO()||""};P==="start"?(l("select-start",pe,te??!0),l("select-start-utc",pe.utc)):(l("select-end",pe),l("select-end-utc",pe.utc))}function x(P){let L=c.value,te=u.value+P;for(;te<1;)te+=12,L-=1;for(;te>12;)te-=12,L+=1;c.value=L,u.value=te,l("update:year",L),l("update:month",te)}function O(P){const te=(R.value?mt.fromISO(R.value,{zone:i.timezone}):h.value).plus({days:P});te.month===u.value&&te.year===c.value&&T(te)}function z(P=!1){const te=(R.value?mt.fromISO(R.value,{zone:i.timezone}):h.value).weekday%7,de=P?6-te:-te;O(de)}const V=P=>{j(P)};function j(P){switch(P.preventDefault(),P.stopPropagation(),P.key){case"ArrowLeft":P.preventDefault(),O(-1);break;case"ArrowRight":P.preventDefault(),O(1);break;case"ArrowUp":P.preventDefault(),O(-7);break;case"ArrowDown":P.preventDefault(),O(7);break;case"Home":P.preventDefault(),z(!1);break;case"End":P.preventDefault(),z(!0);break;case"PageUp":P.preventDefault(),x(P.shiftKey?-12:-1);break;case"PageDown":P.preventDefault(),x(P.shiftKey?12:1);break;case"Enter":case" ":{P.preventDefault();const L=R.value?mt.fromISO(R.value,{zone:i.timezone}):h.value,te=A.value.flat().find(de=>de.iso===L.toISODate());te&&Q(te);break}}}const ee=P=>{const L=mt.now().setZone(i.timezone);c.value=L.year,u.value=L.month,l("update:year",L.year),l("update:month",L.month),T(L),l("gotoToday")};function Q(P){var Ce,Me;const L=!!f.value,te=!!p.value,de=i.activeField,Fe=((Ce=f.value)==null?void 0:Ce.toISODate())||"null",pe=((Me=p.value)==null?void 0:Me.toISODate())||"null",ce=P.dt.toISODate()||"",X=(Pe,M)=>{a.value={case:Pe,behavior:M}},we=()=>`Selected start ${ce} > existing end ${pe} -> reset both to ${ce}`,ae=()=>`Selected end ${ce} < existing start ${Fe} -> reset both to ${ce}`,Oe=()=>{D("start",P.dt,!0),D("end",P.dt),l("update:activeField","end")},H=(Pe=!1)=>{D("start",P.dt,Pe),Pe&&l("update:activeField","end")},oe=(Pe=!1)=>{D("end",P.dt),Pe&&l("close")};if(L&&te){de==="start"?p.value&&P.dt>p.value?(Oe(),X("INVERT_RANGE_FROM_START",we())):(H(!1),X("UPDATE_START_IN_RANGE",`Updated start from ${Fe} to ${ce}; end remains ${pe}`)):f.value&&P.dt<f.value?(Oe(),X("INVERT_RANGE_FROM_END",ae())):(oe(!1),X("UPDATE_END_IN_RANGE",`Updated end from ${pe} to ${ce}; start remains ${Fe}`));return}if(!L&&te&&de==="start"&&p.value&&P.dt>p.value){Oe(),X("CREATE_RANGE_FROM_LATE_START",we());return}if(L&&!te&&de==="end"&&f.value&&P.dt<f.value){Oe(),X("CREATE_RANGE_FROM_EARLY_END",ae());return}if(!L&&!te){if(de==="start"){H(!0),X("INIT_START",`Picked start ${ce}; awaiting end selection`);return}oe(i.immediatelyUpdate),X("INIT_END",`Picked end ${ce}; awaiting start selection`);return}if(!L&&te){if(de==="start"){H(!0),X("FILL_MISSING_START",`Inserted start ${ce}; existing end ${pe}`);return}oe(!1),X("STRICT_UPDATE_END_ONLY",`Updated end to ${ce}; start still null`);return}if(L&&!te){if(de==="start"){H(!0),X("RESELECT_START_BEFORE_END",`Replaced start with ${ce}; end still null, switching to end`);return}oe(i.immediatelyUpdate),X("FILL_MISSING_END",`Picked end ${ce}; start ${Fe}`);return}}function G(){y.value=g.value,b.value=v.value,l("confirm")}function fe(){g.value=y.value,v.value=b.value,l("cancel")}function q(){Et(()=>{var P;(P=o.value)==null||P.focus()})}return qt(()=>{q()}),t({focus:q}),(P,L)=>(K(),ie("div",{ref_key:"calendarRef",ref:o,class:J([P.$style["arbo-calendar"],{[P.$style["arbo-date-range-picker"]]:r.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[ye("div",{class:J([P.$style["arbo-calendar-header"],P.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ie(Tt,null,xn(I.value,te=>(K(),ie("div",{key:te,class:J(P.$style["arbo-calendar-weekday"]),role:"columnheader"},yt(te),3))),128))],2),ye("div",{class:J(P.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:L[0]||(L[0]=Pt(te=>U(Ga)(te,V),["prevent","stop"]))},[(K(!0),ie(Tt,null,xn(A.value,(te,de)=>(K(),ie("div",{key:de,class:J(P.$style["arbo-calendar-week"])},[(K(!0),ie(Tt,null,xn(te,Fe=>(K(),ie("div",{key:Fe.iso,class:J([P.$style["arbo-calendar-day"],Fe.classes,{[P.$style["is-focused"]]:Fe.iso===R.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":Fe.aria,"data-date":Fe.iso,"data-weekday":Fe.weekdayLabel,tabindex:Fe.iso===R.value?0:-1,onClick:pe=>Q(Fe)},yt(Fe.displayLabel),11,CY))),128))],2))),128))],34),i.readOnly?Ze("",!0):(K(),ie("div",{key:0,class:J(P.$style["arbo-calendar-actions"])},[ye("div",bY,[We((K(),Ke(ht,{variant:"secondary",size:"medium",onClick:L[1]||(L[1]=te=>ee()),onKeydown:U(Ga),"data-index":"today-btn"},{prefix:me(()=>[he(at,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[U(s),"Today"]])]),he(ht,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:U(Ga),variant:"secondary",size:"medium",onClick:fe,"data-index":"cancel-btn"},{default:me(()=>[nt(yt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),he(ht,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:U(Ga),onClick:G},{default:me(()=>[nt(yt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,wY))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_1a7wo_1","arbo-calendar-day":"_arbo-calendar-day_1a7wo_2","arbo-calendar-week":"_arbo-calendar-week_1a7wo_3","arbo-calendar":"_arbo-calendar_1a7wo_2","arbo-calendar-nav":"_arbo-calendar-nav_1a7wo_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_1a7wo_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_1a7wo_53","arbo-calendar-weekday":"_arbo-calendar-weekday_1a7wo_58","arbo-calendar-weeks":"_arbo-calendar-weeks_1a7wo_63","is-today":"_is-today_1a7wo_92","is-selected-start":"_is-selected-start_1a7wo_97","is-selected-end":"_is-selected-end_1a7wo_105","is-outside":"_is-outside_1a7wo_125","is-focused":"_is-focused_1a7wo_128","is-in-range":"_is-in-range_1a7wo_133","arbo-calendar-actions":"_arbo-calendar-actions_1a7wo_139","arbo-calendar-btn":"_arbo-calendar-btn_1a7wo_147",cancel:"_cancel_1a7wo_156",confirm:"_confirm_1a7wo_161"}}]]),EY=["onClick"],_Y=["variant","onClick"],RY=St(it({__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 s=e,o=Z(()=>{if(s.monthLabels&&s.monthLabels.length===12)return s.monthLabels;const O=s.locale||"en-US",z=s.monthLabelStyle||"short",V=new Intl.DateTimeFormat(O,{month:z,timeZone:"UTC"});return Array.from({length:12},(ee,Q)=>V.format(new Date(Date.UTC(2020,Q,1))))}),i=n,r=$(s.year),a=$(s.month),l=$(s.year);Je(()=>s.year,O=>{O!==r.value&&(r.value=O,l.value=O)}),Je(()=>s.month,O=>{O!==a.value&&(a.value=O)});const c=$("days");function u(O){c.value!==O&&(c.value=O,i("mode-change",O))}const d=Z(()=>s.minYear),h=Z(()=>s.maxYear),f=Z(()=>{const O=s.yearSpan;return l.value-l.value%O}),p=Z(()=>f.value+s.yearSpan-1);function g(){const O=s.yearSpan,z=f.value-O;z>=d.value&&(l.value=z)}function v(){const O=s.yearSpan,z=f.value+O;z<=h.value&&(l.value=z)}const y=Z(()=>f.value-s.yearSpan<d.value),b=Z(()=>p.value+s.yearSpan>h.value),S=Z(()=>{const O=s.yearSpan;return Math.ceil(O/3)});function C(O){const V=f.value+(O-1)*3;return Array.from({length:3},(j,ee)=>V+ee).filter(j=>j<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function R(){c.value==="years"?u("days"):u("years")}function T(O){r.value=O,l.value=O,i("update:year",O),i("year-selected",O),u("months")}function k(O){a.value=O,i("update:month",O),i("month-selected",O),u("days")}function A(){if(c.value==="days"){let O=r.value,z=a.value-1;if(z<1&&(z=12,O--),O<d.value)return;r.value=O,a.value=z,i("update:year",O),i("update:month",z)}else if(c.value==="months"){if(r.value-1<d.value)return;r.value--,i("update:year",r.value)}else c.value==="years"&&g()}function I(){if(c.value==="days"){let O=r.value,z=a.value+1;if(z>12&&(z=1,O++),O>h.value)return;r.value=O,a.value=z,i("update:year",O),i("update:month",z)}else if(c.value==="months"){if(r.value+1>h.value)return;r.value++,i("update:year",r.value)}else c.value==="years"&&v()}const D=Z(()=>c.value==="days"?r.value===d.value&&a.value===1:c.value==="months"?r.value-1<d.value:y.value),x=Z(()=>c.value==="days"?r.value===h.value&&a.value===12:c.value==="months"?r.value+1>h.value:b.value);return t({setNavigation:(O,z)=>{r.value=O,a.value=z}}),(O,z)=>(K(),ie("div",{class:J([O.$style["cal-nav-wrapper"]])},[xt(O.$slots,"selection"),c.value==="days"?(K(),ie("div",{key:0,class:J(O.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[he(ht,{variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:A,"data-index":"prev-btn",onKeydownCapture:Un(Pt(A,["prevent","stop"]),["enter"]),onKeydown:U(Ga)},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),ye("div",{class:J(O.$style["cal-nav-center"])},[he(ht,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:U(Ga)},{default:me(()=>[nt(yt(o.value[a.value-1]),1)]),_:1},8,["onKeydown"]),he(ht,{variant:"secondary",onClick:R,"data-index":"year-btn",onKeydown:U(Ga)},{default:me(()=>[nt(yt(r.value),1)]),_:1},8,["onKeydown"])],2),he(ht,{"data-index":"next-btn",variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:x.value,label:"",onClick:I,onKeydownCapture:Un(Pt(I,["prevent","stop"]),["enter"]),onKeydown:U(Ga)},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ze("",!0),c.value==="years"?(K(),ie("div",{key:1,class:J(O.$style["year-grid"])},[ye("div",{class:J(O.$style["year-grid-header"])},[he(ht,{variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Next",disabled:y.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),ye("div",{class:J(O.$style["range-label"])},yt(f.value)+" - "+yt(p.value),3),he(ht,{variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:b.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),ye("div",{class:J(O.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ie(Tt,null,xn(S.value,V=>(K(),ie("div",{key:"yr-row-"+V,class:J(O.$style["year-grid-row"])},[(K(!0),ie(Tt,null,xn(C(V),j=>(K(),ie("a",{key:j,tabindex:"0",class:J([O.$style["year-cell"],{[O.$style.selected]:j===r.value}]),onClick:ee=>T(j)},yt(j),11,EY))),128))],2))),128))],2)],2)):c.value==="months"?(K(),ie("div",{key:2,class:J(O.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[ye("div",{class:J(O.$style.months)},[(K(!0),ie(Tt,null,xn(o.value,(V,j)=>(K(),ie("a",{tabindex:"0",key:V,variant:j+1===a.value?"primary":"text",class:J([O.$style["month-cell"],{[O.$style.selected]:j+1===a.value}]),onClick:ee=>k(j+1)},yt(V),11,_Y))),128))],2)],2)):(K(),ie("div",{key:3,class:J(O.$style["days-slot"])},[xt(O.$slots,"default",{year:r.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_unh71_1","cal-nav-bar":"_cal-nav-bar_unh71_12","cal-nav-btn":"_cal-nav-btn_unh71_20",prev:"_prev_unh71_33","year-grid-header":"_year-grid-header_unh71_37","cal-nav-center":"_cal-nav-center_unh71_46","cal-nav-label":"_cal-nav-label_unh71_52","month-grid":"_month-grid_unh71_66","year-grid":"_year-grid_unh71_37",months:"_months_unh71_75","month-cell":"_month-cell_unh71_82","year-cell":"_year-cell_unh71_83","pg-btn":"_pg-btn_unh71_105","year-grid-body":"_year-grid-body_unh71_118","year-grid-row":"_year-grid-row_unh71_125",selected:"_selected_unh71_131","days-slot":"_days-slot_unh71_137","range-label":"_range-label_unh71_141"}}]]);function DY(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:s,maxDate:o}=e,i=$(""),r=Z(()=>{const g=mt.fromFormat(i.value,t,{zone:n});return g.isValid?g:null}),a=Z(()=>{if(!s||!r.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const y=new Date(g.year,g.month-1,g.day),b=new Date(v.year,v.month-1,v.day);return y<b?-1:y>b?1:0},c=Z(()=>{if(!o||!r.value)return!0;const g={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<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),u=Z(()=>i.value.length==0||i.value.length>0&&r.value!==null&&a.value&&c.value),d=Z(()=>i.value.length===t.length&&u.value);return{inputValue:i,isValid:u,isComplete:d,clear:()=>{i.value=""},setDate:g=>{let v;g instanceof Date?v=mt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?i.value=v.toFormat(t):i.value=""},getDate:()=>u.value?r.value:null}}const TY={key:0,style:{marginLeft:"8px"}},xY=["disabled","readonly","placeholder"],NA=St(it({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=$(null),a=$(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=DY({format:o.format,allowPastDates:o.allowPastDates,allowFutureDates:o.allowFutureDates,timezone:o.timezone,minDate:o.minDate,maxDate:o.maxDate}),p=Z(()=>o.active),g=Z(()=>({disabled:o.disabled,error:!l.value&&u.value.length>0,readOnly:o.readOnly,isEmpty:u.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:y,isFocus:b}=ms(g),S=k=>{var I;const A=(I=k.clipboardData)==null?void 0:I.getData("text/plain");A&&(u.value=A.trim())},C=k=>{if(k.key==="Escape"){i("blur"),k.target.blur(),k.preventDefault(),k.stopPropagation(),k.stopImmediatePropagation();return}else k.key==="Tab"&&T(k)},E=()=>{d(),i("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var k;return(k=r.value)==null?void 0:k.focus()}}),Je(()=>o.modelValue,k=>{k?h(k):d()},{immediate:!0}),Je([()=>c.value,()=>u.value],()=>{if(u.value.length===0)i("complete",null);else if(l.value&&!o.readOnly&&!o.disabled&&c.value){const k=f();(k||u.value.length===0)&&i("complete",k)}}),Je(()=>l.value,k=>{k||i("invalid","")});const R=Z(()=>!!o.isMultipleDate),T=k=>{k.preventDefault(),k.stopImmediatePropagation(),k.stopPropagation(),i("tab",k)};return(k,A)=>(K(),Ke(vs,Zt(U(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:me(()=>[ye("div",{class:J([k.$style["date-input-wrapper"]])},[R.value?(K(),ie("span",TY," Multiple ")):We((K(),ie("input",{key:1,disabled:o.disabled,readonly:o.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":A[0]||(A[0]=I=>pn(u)?u.value=I:null),onPaste:Pt(S,["prevent"]),placeholder:o.placeholder,class:J([k.$style["date-input"]]),onKeydown:C},null,42,xY)),[[m1,U(u)]]),xt(k.$slots,"clear",{handleClear:E},()=>[(U(u).length>0||R.value)&&!o.readOnly&&!o.disabled&&(U(y)||U(b))?We((K(),Ke(ht,{key:0,variant:["icon","primary"],onClick:Pt(E,["stop"]),size:16,rounded:!0},{default:me(()=>[he(at,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[U(s),"Clear"]]):(K(),Ke(at,{key:1,src:"Calendar",source:"remote",class:J(k.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_1yset_1","icon-calendar":"_icon-calendar_1yset_9",focus:"_focus_1yset_12",hover:"_hover_1yset_12",active:"_active_1yset_12","date-input":"_date-input_1yset_1",invalid:"_invalid_1yset_38"}}]]),IY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:pb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const s=$({case:"",behavior:""}),o=e,i=$(null),r=n,a=async(X,we)=>{r("start-update"),await X(),r("finish-update"),Et(()=>{var ae,Oe;we(),(Oe=(ae=o.params)==null?void 0:ae.api)==null||Oe.stopEditing()})},l=(X,we)=>{X(),Et(()=>{var ae,Oe;we(),(Oe=(ae=o.params)==null?void 0:ae.api)==null||Oe.stopEditing()})},c=()=>{var we;const X=mt.now().setZone(o.timezone);L.value=X.year,te.value=X.month,(we=P.value)==null||we.setNavigation(X.year,X.month)},u=wo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:y,beginInteraction:b,clearStart:S,clearDue:C}=fK(o,r),E=Z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Je(()=>o.multipleStartDates,X=>{h.value=!!X},{immediate:!0}),Je(()=>o.multipleDueDates,X=>{f.value=!!X},{immediate:!0});const R=$(null),T=$(null),k=X=>{X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),G()},A=()=>{var X;(X=T.value)==null||X.focus()},I=X=>{if(!X){u.start=!1,S();return}const we=d.endDate?mt.fromJSDate(d.endDate,{zone:o.timezone}):null;if(we&&D(X,we)>0){const Oe={year:X.year,month:X.month,day:X.day};u.start=!1,y(Oe,!1),p(Oe),Et(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const ae={year:X.year,month:X.month,day:X.day};u.start=!1,y(ae,!0)},D=(X,we)=>{const ae=X.startOf("day"),Oe=we.startOf("day");return ae<Oe?-1:ae>Oe?1:0},x=X=>{var we;X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),(we=document.querySelector('[data-index="prev-btn"]'))==null||we.focus()},O=X=>{if(!X){u.end=!1,C();return}const we=d.startDate?mt.fromJSDate(d.startDate,{zone:o.timezone}):null;if(we&&D(X,we)<0){const Oe={year:X.year,month:X.month,day:X.day};u.end=!1,y(Oe),p(Oe),Et(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const ae={year:X.year,month:X.month,day:X.day};u.end=!1,p(ae)},z=()=>{h.value=!1,S()},V=()=>{f.value=!1,C()},j=()=>{fe()},ee=Z(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){o.disabled||o.readOnly||(b(),d.isSelectingStart=!0,d.isSelectingEnd=!1,Et(()=>{var X;(X=i.value)==null||X.focus()}))}function G(){o.disabled||o.readOnly||(b(),d.isSelectingEnd=!0,d.isSelectingStart=!1,Et(()=>{var X;(X=R.value)==null||X.focus()}))}function fe(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function q(X){X.key==="Escape"?(X.stopPropagation(),fe()):X.key=="Tab"&&r("tab",X)}const P=$(null),L=$(new Date().getFullYear()),te=$(new Date().getMonth()+1);Je(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(L.value=d.startDate.getFullYear(),te.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(L.value=d.endDate.getFullYear(),te.value=d.endDate.getMonth()+1)},{immediate:!0});const de=$(null);function Fe(){if(Array.isArray(o.value)){const[we,ae]=o.value;d.startDate=we||null,d.endDate=ae||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const X=d.startDate||d.endDate||new Date;L.value=X.getFullYear(),te.value=X.getMonth()+1}Je(()=>{var X,we,ae,Oe,H,oe,Ce,Me;return[((ae=(we=(X=o.value)==null?void 0:X[0])==null?void 0:we.getTime)==null?void 0:ae.call(we))||((Oe=o.value)==null?void 0:Oe[0]),((Ce=(oe=(H=o.value)==null?void 0:H[1])==null?void 0:oe.getTime)==null?void 0:Ce.call(oe))||((Me=o.value)==null?void 0:Me[1]),o.timezone,o.format,o.placeholder,o.enableRangeFeedback]},()=>{Fe()},{immediate:!0,deep:!0}),t({resetCalendarLogic:Fe,openStart:Q,openEnd:G,closePicker:fe,clearAll:j,isOpen:ee,drpRef:de,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():G():Q()}});const ce=$(null);return Je(()=>ee.value,X=>{if(o.disabled||o.readOnly)return;const we=ce.value;we&&(X?we.show():we.hide())},{immediate:!0}),(X,we)=>(K(),ie("div",{class:J(X.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:T,onKeydown:q,tabindex:"1","data-index":"calendar-wrapper"},[he(RY,{year:L.value,"onUpdate:year":we[6]||(we[6]=ae=>L.value=ae),month:te.value,"onUpdate:month":we[7]||(we[7]=ae=>te.value=ae),locale:o.locale,disabled:o.disabled,readOnly:o.readOnly,ref_key:"navigationRef",ref:P},{selection:me(()=>[ye("div",{class:J(X.$style["calendar-input-section"])},[he(NA,{ref_key:"starDateRef",ref:i,"model-value":U(d).startDate,placeholder:o.startPlaceholder,timezone:o.timezone,active:U(d).isSelectingStart,onClick:Q,onClear:z,onComplete:I,onInvalid:we[0]||(we[0]=ae=>u.start=!0),disabled:o.disabled,readOnly:o.readOnly,onBlur:A,onTab:k},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),he(NA,{ref_key:"endDateRef",ref:R,"model-value":U(d).endDate,placeholder:o.duePlaceholder,timezone:o.timezone,active:U(d).isSelectingEnd,onClick:G,onClear:V,disabled:o.disabled,onComplete:O,onInvalid:we[1]||(we[1]=ae=>u.end=!0),readOnly:o.readOnly,isMultipleDate:U(f),onTab:x},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:me(({year:ae,month:Oe})=>[he(SY,{disabled:o.disabled,disableConfirm:u.end||u.start,readOnly:o.readOnly,ref_key:"drpRef",ref:de,"tracing-case":s.value,"onUpdate:tracingCase":we[2]||(we[2]=H=>s.value=H),year:ae,month:Oe,"start-date":U(d).startDate,"end-date":U(d).endDate,"active-field":E.value,timezone:o.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:U(y),onSelectEnd:U(p),onGotoToday:c,onConfirm:we[3]||(we[3]=()=>{a(U(v),fe)}),onCancel:we[4]||(we[4]=H=>l(U(g),fe)),onClose:we[5]||(we[5]=H=>a(U(v),fe))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Dm=St(IY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_15w28_1","calendar-input-section":"_calendar-input-section_15w28_12","display-wrapper":"_display-wrapper_15w28_20","calendar-actions":"_calendar-actions_15w28_24","clear-all-btn":"_clear-all-btn_15w28_30"}}]]),FY={ref:"mainRef"},PY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated"],setup(e,{emit:t}){const n=t,s=e,o=Sn("isSelectAll",$(!1)),i=Sn("bulkUpdate",$(!1)),r=Z(()=>!!s.entityId&&i.value&&o.value),{apiServices:a}=Qn(!i.value,s),l=Sn("filterParams",null),c=async k=>{var I,D,x;T.value=!0;let A={workspaceId:s.workspaceId,entityId:s.entityId,itemIds:s.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in k&&(A.startDate=k.start?lm(k.start):null),"end"in k&&(A.dueDate=k.end?lm(k.end):null),r.value?(A.itemIds=void 0,A.entityId=s.entityId):A.entityId=void 0,await((D=(I=a.value)==null?void 0:I.changeDate)==null?void 0:D.call(I,A)),n("updated",{workspaceId:s.workspaceId,itemIds:s.ids,data:A}),(x=y.value)==null||x.resetCalendarLogic()},u=()=>{if(!s.rowSelected||s.rowSelected.length===0){d();return}s.rowSelected.length===1?h():f()},d=()=>{v.value=!1,g.value=!1,R.value=[null,null]},h=()=>{const A=s.rowSelected[0].dateRange;R.value=[(A==null?void 0:A[0])??null,(A==null?void 0:A[1])??null],v.value=!1,g.value=!1},f=()=>{var A,I;if(s.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=p(0),x=p(1);if(g.value=D,v.value=x,D)R.value[0]=null;else{const O=((A=s.rowSelected[0].dateRange)==null?void 0:A[0])??null;R.value[0]=O}if(x)R.value[1]=null;else{const O=((I=s.rowSelected[0].dateRange)==null?void 0:I[1])??null;R.value[1]=O}}else g.value=!1,v.value=!1,R.value=[null,null]},p=k=>{const A=s.rowSelected.map(D=>{var x;return(x=D.dateRange)==null?void 0:x[k]});return A.length===0?!1:new Set(A.map(D=>{var x;return(x=D==null?void 0:D.getTime)==null?void 0:x.call(D)})).size>1},g=$(!1),v=$(!1),y=$(null),{triggerRef:b,popupRef:S,hide:C,isVisible:E}=us({toggleOnClick:!0}),R=$([null,null]);Je([()=>s.ids,()=>s.rowSelected,E],k=>{u(),Et(()=>{var A;(A=y.value)==null||A.focus()})},{immediate:!0,deep:!0});const T=$(!1);return(k,A)=>(K(),ie("div",FY,[ye("div",{ref_key:"triggerRef",ref:b},[he(ht,{variant:s.variant,loading:T.value},{default:me(()=>[he(at,{src:"Calendar"}),A[2]||(A[2]=nt(" Date ",-1))]),_:1},8,["variant","loading"])],512),ye("div",{ref_key:"popupRef",ref:S,style:{display:"none"}},[U(E)?(K(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:R.value,onConfirmed:c,ref_key:"calendarRef",ref:y,onClosed:U(C),onStartUpdate:A[0]||(A[0]=I=>T.value=!0),onFinishUpdate:A[1]||(A[1]=I=>T.value=!1),multipleDueDates:v.value,multipleStartDates:g.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ze("",!0)],512)],512))}}),AY=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"},LA=Zl("metricStore",()=>{const e=$();return{metricList:e,setMetricList:s=>{e.value=s},checkEditType:s=>{var o;if(((o=s==null?void 0:s.auth_permission)==null?void 0:o.permission)==2)return AY(s)}}}),kY=["onKeydown"],OY=["width","height","viewBox"],MY=["d"],NY="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",VA=it({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(s.modelValue??0),r=$(null),a=Z(()=>{var D;return((D=s.params)==null?void 0:D.size)??24}),l=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconPath)??NY}),u=Z(()=>{var D;return((D=s.params)==null?void 0:D.wrapperTag)??"span"}),d=Z(()=>{var D;return s.disabled||((D=s.params)==null?void 0:D.disabled)||!1}),h=Z(()=>{var D;return s.readOnly||((D=s.params)==null?void 0:D.readOnly)||!1}),f=Z(()=>!d.value&&!h.value),p=Z(()=>d.value?"not-allowed":h.value?"default":"pointer");Je(()=>s.modelValue,D=>{typeof D=="number"&&D!==i.value&&(i.value=D)});const g=D=>{var x;return((x=s.params)==null?void 0:x.maxRating)-D+1<=i.value&&!v.value},v=$(!1),y=()=>{v.value=!0},b=()=>{v.value=!1},S=D=>{f.value&&C(D)},C=D=>{var O,z;if(!f.value)return;let x=((O=s.params)==null?void 0:O.maxRating)-D+1;x===i.value&&(x=0),i.value=x,o("update:modelValue",x),o("update",x),o("change",x),(z=s.params)!=null&&z.onUpdate&&s.params.onUpdate(x)},E=D=>{var x;D!==i.value&&(i.value=D,o("update:modelValue",D),o("update",D),o("change",D),(x=s.params)!=null&&x.onUpdate&&s.params.onUpdate(D),R.value=D)},R=$(i.value),T=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),i.value=R.value,o("cancel")},k=D=>{D.preventDefault(),E(i.value),o("handleEnter",i.value)},A=()=>{f.value&&(i.value=Math.min(i.value+1%(s.params.maxRating+1),s.params.maxRating),E(i.value))},I=()=>{f.value&&(i.value=Math.max(i.value-1,0),E(i.value))};return t({focus:()=>{var D;(D=r.value)==null||D.focus()}}),(D,x)=>(K(),ie("div",{class:J(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:r,tabindex:"1",onKeydown:[Un(Pt(I,["prevent"]),["left"]),Un(Pt(A,["prevent"]),["right"]),Un(Pt(I,["prevent"]),["down"]),Un(Pt(A,["prevent"]),["up"]),Un(Pt(k,["prevent"]),["enter"]),Un(Pt(k,["prevent"]),["tab"]),Un(Pt(T,["prevent"]),["escape"])]},[(K(!0),ie(Tt,null,xn(e.params.maxRating,O=>(K(),Ke(ZR(u.value),{key:O,class:J(["rating-item",{filled:g(O),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-O,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(O),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-O+1,tabindex:-1,onClick:Pt(z=>S(O),["prevent","stop"]),onMouseenter:y,onMouseleave:b},{default:me(()=>[xt(D.$slots,"icon",{index:O,filled:g(O),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:O},()=>[(K(),ie("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[ye("path",{d:c.value},null,8,MY)],8,OY))]),xt(D.$slots,"overlay",{index:O,filled:g(O),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,kY))}}),LY={style:{maxWidth:"180px",lineHeight:"15px"}},VY=["innerHTML"],BA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=()=>{i("handleCancel")},a=()=>{i("close")},l=v=>{var y;if(v.format_type==="dropdown"&&v.format_value)try{const b=JSON.parse(v.format_value);if(Array.isArray(b)){const S=b.map(C=>({label:C.name,value:C.name,id:C.name}));return S.unshift({label:"-",value:void 0,id:"-"}),S}}catch(b){console.error("Failed to parse dropdown options",b)}if(v.format_type=="number"&&v.restricted_type=="exact"){const b=((y=v.restricted_value)==null?void 0:y.split(",").map(S=>({label:v.mapping[`!${S}`]||S,value:S,id:S})))||[];return b.unshift({label:"-",value:void 0,id:"-"}),b}return[]},c=Z(()=>l(o.config)),u=$(o.modelValue),d=v=>{u.value=v,i("update:modelValue",v),i("change",v||null)},h=$(c.value),f=$(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(y=>y.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=$(null);return qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,y)=>(K(),Ke(Xr,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:y[0]||(y[0]=b=>d(b.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:r},{item:me(({item:b,getHighlightedLabel:S,selectedIndex:C,index:E})=>[he(Ha,{hover:C==E,selected:b.value===e.modelValue,label:b.label,onSelect:R=>d(b.value||null),onClick:R=>d(b.value||null)},{label:me(()=>[ye("div",LY,[We(ye("span",{innerHTML:S(b.label)},null,8,VY),[[U(s),{content:b.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":me(()=>[...y[1]||(y[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),BY={class:"metric-input-wrapper"},$Y={key:0,class:"error-text input-2"},$A=it({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=$(o.modelValue),r=$(o.modelValue),a=$(!1),l=$(!0),c=$(""),u=Z(()=>{var V;const z=Number.parseInt(String((V=o.config)==null?void 0:V.format_value)||"2",10);return Number.isFinite(z)&&z>=0?z:2}),d=z=>{if(!z)return z;const V=String(z).split(".");return V.length>1&&V[1].length>u.value?u.value===0?V[0]:`${V[0]}.${V[1].slice(0,u.value)}`:String(z)},h=z=>{const V=d(z);V!==z&&S.value?i.value=V:i.value=z},f=z=>{const V=z.target;if(!V)return;const j=V.value||"",ee=j.indexOf(".");if(z.key==="."&&u.value===0){z.preventDefault();return}ee!==-1&&/[0-9]/.test(z.key)&&j.slice(ee+1).length>=u.value&&z.preventDefault()},p=Z(()=>l.value||o.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var q;const z=o.config.restricted_type.trim(),V=((q=o.config.restricted_value)==null?void 0:q.split(",").map(Number))||[],[j,ee]=V,G={range:`Enter a value between ${j} and ${ee}`,not:`These values are not allowed: ${V.join(", ")}`,exact:"Value is not allowed"}[z];return l.value?"":G},v=Z(()=>{var V;let z="";return Number((V=o.config)==null?void 0:V.format_value)&&(z+="."+Array.from({length:Number(o.config.format_value)}).map(()=>"0").join("")),`0${z}`});Je(()=>o.modelValue,z=>{i.value=z,r.value=z});const y=z=>im(o.config,z),b=n,S=$(null),C=z=>{const V=z===""?null:z,j=r.value===""?null:r.value;return V!==j},E=z=>{const V=d(z);if(!C(V))return!1;const j=V===""?null:V;return i.value=j,r.value=j,b("update:modelValue",j),b("handleChange",j),!0},R=()=>{i.value=r.value,b("update:modelValue",r.value)},T=(z,V)=>{E(z),b("enter")},k=(z,V)=>{if(a.value){a.value=!1;return}o.saveOnBlur?E(z):R()},A=z=>{if(z===null||z===""){l.value=!0;return}l.value=im(o.config,Number(z)),c.value=l.value?"":g()},I=(z,V)=>{a.value=!0,o.saveOnEscape?E(z):R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},D=z=>{A(z),b("onValidation",z)},x=()=>{a.value=!0,R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},O=()=>{var z;i.value=null,r.value=null,b("update:modelValue",null),b("handleChange",null),(z=S.value)==null||z.focus()};return t({focus:()=>{var z;return(z=S.value)==null?void 0:z.focus()},blur:()=>{var z;return(z=S.value)==null?void 0:z.blur()},getValue:()=>i.value,getCachedValue:()=>r.value,save:()=>E(i.value),revert:R}),qt(()=>{var z;(z=S.value)==null||z.focus()}),(z,V)=>We((K(),ie("div",BY,[he(Yb,{maxDecimalChar:u.value,modelValue:i.value,"onUpdate:modelValue":V[0]||(V[0]=j=>i.value=j),placeholder:v.value,validatorFnc:y,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:T,onBlur:k,onClear:O,onEscape:I,onCancel:x,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:S},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ie("span",$Y,yt(c.value),1)):Ze("",!0)])),[[U(s),p.value]])}}),HY={key:2},GY={class:"wrapper-suffix"},UY={key:3},WY=St(it({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=$(null),r=$(0),a=$(null),l=$(null),c=Z(()=>xF(o.config)),u=$(!1),d=Z(()=>!!de.value),h=n,f=()=>{u.value=!1,te(),h("cancel")},p=$(!0),g=ce=>{if(ce===null||ce===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=im(o.config,Number(ce)),y.value=b()},v=()=>{u.value=!0,ee()},y=$(""),b=()=>{var Ce;const ce=o.config.restricted_type.trim(),X=((Ce=o.config.restricted_value)==null?void 0:Ce.split(",").map(Number))||[],[we,ae]=X,H={range:`Enter a value between ${we} and ${ae}`,not:`These values are not allowed: ${X.join(", ")}`,exact:"Value is not allowed"}[ce];return p.value?"":H},S=Z(()=>{var X;const ce=Number.parseInt(String((X=o.config)==null?void 0:X.format_value)||"2",10);return Number.isFinite(ce)&&ce>=0?ce:2}),C=ce=>{u.value=!0,i.value=ce},E=()=>{u.value=!0,te(),ee()},R=ce=>{r.value=ce,u.value=!0,ee()},T=()=>(o.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(X=>X.charAt(0).toUpperCase()+X.slice(1)).join("").replace(/Outline|Solid/g,""),k=$(null),A=$(!0),I=Z(()=>{var ce;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((ce=i.value)==null?void 0:ce.length)===0,wrapperRef:P,active:d,focus:o.focus,bordered:!0}}),D=$(null),x=Z(()=>A.value),O=Z(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:r.value===0,wrapperRef:D,active:x,focus:A.value,bordered:!0})),{argsMain:z}=ms(O),{argsMain:V}=ms(I),j=$(null),ee=()=>{Et(()=>{var ce;(ce=j.value)==null||ce.focus()})},Q=ce=>{var X;if(ce.format_type==="dropdown"&&ce.format_value)try{const we=JSON.parse(ce.format_value);if(Array.isArray(we))return we.map(ae=>({label:ae.name,value:ae.name,id:ae.name}))}catch(we){console.error("Failed to parse dropdown options",we)}return ce.format_type=="number"&&ce.restricted_type=="exact"?((X=ce.restricted_value)==null?void 0:X.split(",").map(ae=>({label:ce.mapping[`!${ae}`]||ae,value:ae,id:ae})))||[]:[]},G=Z(()=>Q(o.config)),fe=Z(()=>{var ce;return((ce=G.value.find(X=>X.value===i.value))==null?void 0:ce.label)||i.value||"-"}),q=()=>{var ce;if(c.value=="rating")h("updateMetric",r.value==0?null:r.value);else if(c.value=="number"){const X=(ce=l.value)==null?void 0:ce.getValue();h("updateMetric",X||null)}else h("updateMetric",i.value||null);u.value=!1,te()},{triggerRef:P,popupRef:L,hide:te,isVisible:de,show:Fe}=us({toggleOnClick:!0,appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),pe=()=>{switch(c.value){case"number":Et(()=>{var ce;(ce=l.value)==null||ce.focus()});break;case"dropdown":Fe(),Et(()=>{var ce;(ce=k.value)==null||ce.focus()});break;case"rating":A.value=!0,Et(()=>{var ce;(ce=a.value)==null||ce.focus()});break}};return t({resetState:()=>{i.value=null,r.value=0,u.value=!1},focus:pe,hasChanges:()=>u.value}),qt(()=>{Et(()=>{setTimeout(()=>{pe()},300)})}),(ce,X)=>(K(),ie("div",{class:J(ce.$style["metric-editor"])},[c.value=="number"?(K(),Ke($A,{key:0,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[0]||(X[0]=we=>i.value=we),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:S.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(K(),Ke(vs,Zt({key:1,"tab-index":1},U(z),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:me(()=>[he(VA,{params:{maxRating:o.config.range},modelValue:r.value,"onUpdate:modelValue":X[1]||(X[1]=we=>r.value=we),onHandleEnter:R,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:me(()=>[he(at,{source:"rating",src:T()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(K(),ie("div",HY,[he(vs,Zt(U(V),{ref_key:"triggerRef",ref:P,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:me(({})=>[ye("div",GY,[he(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:me(()=>[We((K(),ie("span",null,[nt(yt(fe.value||""),1)])),[[U(s),{content:fe.value}]])]),_:1},16),ye("div",{ref_key:"popupRef",ref:L},[U(de)?(K(),Ke(BA,{key:0,ref_key:"metricEditorDropdownRef",ref:k,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[2]||(X[2]=we=>i.value=we),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ze("",!0)],512)])):(K(),ie("span",UY,"Formular")),We((K(),Ke(ht,{ref_key:"confirmButtonRef",ref:j,onHandleClick:q,"tab-index":"1",onKeypress:[Un(Pt(pe,["shift","prevent"]),["tab"]),Un(Pt(f,["prevent"]),["escape"])],disabled:!p.value},{default:me(()=>[he(at,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[U(s),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),zY=St(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=$(!1),a=$(null),l=$(null),c=()=>{r.value=!r.value},u=()=>{var g;r.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;r.value=!0,await Et(),(g=l.value)==null||g.focus()},h=g=>{i("handleUpdate",{id:o.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),i("loseFocus")},p=g=>{const y={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),i("focusOnSearch",g)},Tab:()=>{r.value&&u()},Enter:()=>{r.value||d()},ArrowDown:()=>{i("openSibling","down")},ArrowUp:()=>{i("openSibling","up")}}[g.key];y&&y()};return Je(r,g=>{g&&i("open")}),t({hide:u,show:d}),(g,v)=>(K(),ie("div",{class:J([g.$style["metric-item"],r.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[ye("div",{class:J(g.$style["metric-label"]),onClick:Pt(c,["stop"])},[xt(g.$slots,"default",{open:r.value},()=>[We((K(),ie("span",{class:J(g.$style["metric-name"])},[nt(yt(e.label),1)],2)),[[U(s),{content:e.label}]]),e.morpheme&&r.value?(K(),ie("small",{key:0,class:J(g.$style["metric-morpheme"])}," ("+yt(e.morpheme)+") ",3)):Ze("",!0)])],2),he(zD,{mode:"out-in",name:"slide"},{default:me(()=>[r.value?(K(),Ke(WY,{key:`editor-${e.config.id}`,"read-only":!1,focus:r.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Ze("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var Tu=(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))(Tu||{});function HA(e,t){return function(){return e.apply(t,arguments)}}const{toString:jY}=Object.prototype,{getPrototypeOf:Xb}=Object,{iterator:Tm,toStringTag:GA}=Symbol,xm=(e=>t=>{const n=jY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Pi=e=>(e=e.toLowerCase(),t=>xm(t)===e),Im=e=>t=>typeof t===e,{isArray:xu}=Array,Iu=Im("undefined");function Xh(e){return e!==null&&!Iu(e)&&e.constructor!==null&&!Iu(e.constructor)&&lo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const UA=Pi("ArrayBuffer");function KY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&UA(e.buffer),t}const qY=Im("string"),lo=Im("function"),WA=Im("number"),Jh=e=>e!==null&&typeof e=="object",YY=e=>e===!0||e===!1,Fm=e=>{if(xm(e)!=="object")return!1;const t=Xb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(GA in e)&&!(Tm in e)},ZY=e=>{if(!Jh(e)||Xh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},XY=Pi("Date"),JY=Pi("File"),QY=Pi("Blob"),eZ=Pi("FileList"),tZ=e=>Jh(e)&&lo(e.pipe),nZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||lo(e.append)&&((t=xm(e))==="formdata"||t==="object"&&lo(e.toString)&&e.toString()==="[object FormData]"))},sZ=Pi("URLSearchParams"),[oZ,iZ,rZ,aZ]=["ReadableStream","Request","Response","Headers"].map(Pi),lZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,o;if(typeof e!="object"&&(e=[e]),xu(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{if(Xh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),r=i.length;let a;for(s=0;s<r;s++)a=i[s],t.call(null,e[a],a,e)}}function zA(e,t){if(Xh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,o;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const Jl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jA=e=>!Iu(e)&&e!==Jl;function Jb(){const{caseless:e,skipUndefined:t}=jA(this)&&this||{},n={},s=(o,i)=>{const r=e&&zA(n,i)||i;Fm(n[r])&&Fm(o)?n[r]=Jb(n[r],o):Fm(o)?n[r]=Jb({},o):xu(o)?n[r]=o.slice():(!t||!Iu(o))&&(n[r]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Qh(arguments[o],s);return n}const cZ=(e,t,n,{allOwnKeys:s}={})=>(Qh(t,(o,i)=>{n&&lo(o)?e[i]=HA(o,n):e[i]=o},{allOwnKeys:s}),e),uZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dZ=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hZ=(e,t,n,s)=>{let o,i,r;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)r=o[i],(!s||s(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&Xb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},fZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},pZ=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!WA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},gZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xb(Uint8Array)),mZ=(e,t)=>{const s=(e&&e[Tm]).call(e);let o;for(;(o=s.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},vZ=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},yZ=Pi("HTMLFormElement"),wZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,o){return s.toUpperCase()+o}),KA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),CZ=Pi("RegExp"),qA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Qh(n,(o,i)=>{let r;(r=t(o,i,e))!==!1&&(s[i]=r||o)}),Object.defineProperties(e,s)},bZ=e=>{qA(e,(t,n)=>{if(lo(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(lo(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},SZ=(e,t)=>{const n={},s=o=>{o.forEach(i=>{n[i]=!0})};return xu(e)?s(e):s(String(e).split(t)),n},EZ=()=>{},_Z=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function RZ(e){return!!(e&&lo(e.append)&&e[GA]==="FormData"&&e[Tm])}const DZ=e=>{const t=new Array(10),n=(s,o)=>{if(Jh(s)){if(t.indexOf(s)>=0)return;if(Xh(s))return s;if(!("toJSON"in s)){t[o]=s;const i=xu(s)?[]:{};return Qh(s,(r,a)=>{const l=n(r,o+1);!Iu(l)&&(i[a]=l)}),t[o]=void 0,i}}return s};return n(e,0)},TZ=Pi("AsyncFunction"),xZ=e=>e&&(Jh(e)||lo(e))&&lo(e.then)&&lo(e.catch),YA=((e,t)=>e?setImmediate:t?((n,s)=>(Jl.addEventListener("message",({source:o,data:i})=>{o===Jl&&i===n&&s.length&&s.shift()()},!1),o=>{s.push(o),Jl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",lo(Jl.postMessage)),IZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Jl):typeof Y<"u"&&Y.nextTick||YA,Be={isArray:xu,isArrayBuffer:UA,isBuffer:Xh,isFormData:nZ,isArrayBufferView:KY,isString:qY,isNumber:WA,isBoolean:YY,isObject:Jh,isPlainObject:Fm,isEmptyObject:ZY,isReadableStream:oZ,isRequest:iZ,isResponse:rZ,isHeaders:aZ,isUndefined:Iu,isDate:XY,isFile:JY,isBlob:QY,isRegExp:CZ,isFunction:lo,isStream:tZ,isURLSearchParams:sZ,isTypedArray:gZ,isFileList:eZ,forEach:Qh,merge:Jb,extend:cZ,trim:lZ,stripBOM:uZ,inherits:dZ,toFlatObject:hZ,kindOf:xm,kindOfTest:Pi,endsWith:fZ,toArray:pZ,forEachEntry:mZ,matchAll:vZ,isHTMLForm:yZ,hasOwnProperty:KA,hasOwnProp:KA,reduceDescriptors:qA,freezeMethods:bZ,toObjectSet:SZ,toCamelCase:wZ,noop:EZ,toFiniteNumber:_Z,findKey:zA,global:Jl,isContextDefined:jA,isSpecCompliantForm:RZ,toJSONObject:DZ,isAsyncFn:TZ,isThenable:xZ,setImmediate:YA,asap:IZ,isIterable:e=>e!=null&&lo(e[Tm])};function zt(e,t,n,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}Be.inherits(zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const ZA=zt.prototype,XA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{XA[e]={value:e}}),Object.defineProperties(zt,XA),Object.defineProperty(ZA,"isAxiosError",{value:!0}),zt.from=(e,t,n,s,o,i)=>{const r=Object.create(ZA);Be.toFlatObject(e,r,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return zt.call(r,a,l,n,s,o),e&&r.cause==null&&Object.defineProperty(r,"cause",{value:e,configurable:!0}),r.name=e&&e.name||"Error",i&&Object.assign(r,i),r};const FZ=null;function Qb(e){return Be.isPlainObject(e)||Be.isArray(e)}function JA(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function QA(e,t,n){return e?e.concat(t).map(function(o,i){return o=JA(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function PZ(e){return Be.isArray(e)&&!e.some(Qb)}const AZ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Pm(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const s=n.metaTokens,o=n.visitor||u,i=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new zt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,v){let y=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&PZ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(y=Be.toArray(p)))return g=JA(g),y.forEach(function(S,C){!(Be.isUndefined(S)||S===null)&&t.append(r===!0?QA([g],C,i):r===null?g:g+"[]",c(S))}),!1}return Qb(p)?!0:(t.append(QA(v,g,i),c(p)),!1)}const d=[],h=Object.assign(AZ,{defaultVisitor:u,convertValue:c,isVisitable:Qb});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(y,b){(!(Be.isUndefined(y)||y===null)&&o.call(t,y,Be.isString(b)?b.trim():b,g,h))===!0&&f(y,g?g.concat(b):[b])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function ek(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function eS(e,t){this._pairs=[],e&&Pm(e,this,t)}const tk=eS.prototype;tk.append=function(t,n){this._pairs.push([t,n])},tk.toString=function(t){const n=t?function(s){return t.call(this,s,ek)}:ek;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function kZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nk(e,t,n){if(!t)return e;const s=n&&n.encode||kZ;Be.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=Be.isURLSearchParams(t)?t.toString():new eS(t,n).toString(s),i){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class sk{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(s){s!==null&&t(s)})}}const ok={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},OZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:eS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tS=typeof window<"u"&&typeof document<"u",nS=typeof navigator=="object"&&navigator||void 0,MZ=tS&&(!nS||["ReactNative","NativeScript","NS"].indexOf(nS.product)<0),NZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LZ=tS&&window.location.href||"http://localhost",Bs={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tS,hasStandardBrowserEnv:MZ,hasStandardBrowserWebWorkerEnv:NZ,navigator:nS,origin:LZ},Symbol.toStringTag,{value:"Module"})),...OZ};function VZ(e,t){return Pm(e,new Bs.classes.URLSearchParams,{visitor:function(n,s,o,i){return Bs.isNode&&Be.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function BZ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $Z(e){const t={},n=Object.keys(e);let s;const o=n.length;let i;for(s=0;s<o;s++)i=n[s],t[i]=e[i];return t}function ik(e){function t(n,s,o,i){let r=n[i++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=i>=n.length;return r=!r&&Be.isArray(o)?o.length:r,l?(Be.hasOwnProp(o,r)?o[r]=[o[r],s]:o[r]=s,!a):((!o[r]||!Be.isObject(o[r]))&&(o[r]=[]),t(n,s,o[r],i)&&Be.isArray(o[r])&&(o[r]=$Z(o[r])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(s,o)=>{t(BZ(s),o,n,0)}),n}return null}function HZ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const ef={transitional:ok,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",o=s.indexOf("application/json")>-1,i=Be.isObject(t);if(i&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return o?JSON.stringify(ik(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return VZ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Pm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),HZ(t)):t}],transformResponse:[function(t){const n=this.transitional||ef.transitional,s=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(s&&!this.responseType||o)){const r=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(r)throw a.name==="SyntaxError"?zt.from(a,zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bs.classes.FormData,Blob:Bs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{ef.headers[e]={}});const GZ=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UZ=e=>{const t={};let n,s,o;return e&&e.split(`
141
+ This will fail in production.`);r=Kl,r._s.has(e)||(o?Ub(e,t,s,r):AA(e,s,r),Y.env.NODE_ENV!=="production"&&(i._pinia=r));const c=r._s.get(e);if(Y.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=o?Ub(u,t,s,r,!0):AA(u,Qo({},s),r,!0);a._hotUpdate(d),delete r.state.value[u],r._s.delete(u)}if(Y.env.NODE_ENV!=="production"&&Yr){const u=bs();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return i.$id=e,i}function Xs(e){const t=Mt(e),n={};for(const s in t){const o=t[s];o.effect?n[s]=Z({get:()=>e[s],set(i){e[s]=i}}):(pn(o)||Ho(o))&&(n[s]=wi(e,s))}return n}const Wb=Zl("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}}}),jq="woohoo_getWoohooUserInterface_read",zb="media_getReviewUserInterface_read",Kq="update_getUpdateUserInterface_read",qq=(e,t,n,s,o,i)=>{qt(()=>{console.log("Scene data in useSceneAction:",i.value)});const r=Wb(),{userPermissions:a}=Xs(r),l=Z(()=>{const k=En.getInstance().getItem("BASE_URL"),A=En.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:I,entity_id:D,scene_id:x}=e.value;return{baseDomain:k||"",ws_code:I||"",entity_id:D||"",scene_id:x||"",reviewDomain:A||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=Z(()=>{var A;const k=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(zb),canCopyLink:!0,canRename:(k==null?void 0:k.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(zb),canOpenTakeInUpdate:a.value.includes(Kq),canOpenTakeInWoohoo:a.value.includes(jq),canDeleteRendition:((A=k==null?void 0:k.media)==null?void 0:A.has_delete_rendition_permission)??!1,canDeleteThumbnail:(k==null?void 0:k.has_edit_thumbnail_permission)??!1,canArchiveScene:k==null?void 0:k.has_archive_permission,canUnarchiveScene:k==null?void 0:k.has_archive_permission,canDeleteScene:(k==null?void 0:k.has_delete_permission)??!1}}),u=Z(()=>({project:To({type:"project",config:l.value}).url,take_review:To({type:"review_take",config:l.value}).url,review:To({type:"review_scene",config:l.value}).url,review_scene:To({type:"review_scene",config:l.value}).url,woohoo:To({type:"woohoo",config:l.value}).url,update:To({type:"update",config:l.value}).url,scene_hub:To({type:"scene_hub",config:l.value}).url})),d=(k,A)=>{const I=k.metaKey||k.ctrlKey,D=u.value[A]||"";if(D){if(A==="scene_hub"){if(I){window.open(D,"_blank");return}if(!s){console.error("Switch instance not found.",{openSceneHub:s,windowFunc:globalThis.window.$switchInstance});return}s(l.value.scene_id||"");return}I?window.open(D,"_blank"):window.location.href=D}},h=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete rendition.")}catch(D){console.error("Error deleting rendition",D)}finally{o()}},f=async(k,A)=>{var I;try{await((I=e.value.axiosService.value)==null?void 0:I.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{o()}},p=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to archive scene."),A&&A("archived")}catch(D){console.error("Error archiving item",D)}finally{o()}},g=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete scene."),A&&A("deleted")}catch(D){console.error("Error deleting item",D)}finally{o()}},v=k=>{const A=u.value.scene_hub||"";A&&(E.value="Copied",navigator.clipboard.writeText(A),setTimeout(()=>{E.value="Copy link"},5e3))},y=async(k,A)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to unarchive scene."),A&&A("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{o()}},b=k=>p(k,t),S=k=>y(k,t),C=k=>g(k,t),E=$("Copy link"),R=k=>d(k,"review"),T=Z(()=>{let k=[];if(!l.value.scene_id&&e.value.optionBlock&&k.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const A=()=>Math.random().toString(36).substring(2,9);return[{id:A(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:R,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:A(),label:E.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:A(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:b,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:S,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:C,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:y,options:T}};function ms(e){const t=$(!1),n=$(!1),s=Z(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),o=()=>{t.value=!0,Et(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},i=()=>{t.value=!1},r=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",o),c.addEventListener("blur",i)),u&&(u.addEventListener("mouseenter",r),u.addEventListener("mouseleave",a))}),as(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",o),c.removeEventListener("blur",i)),u&&(u.removeEventListener("mouseenter",r),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:s,handleFocus:o}}const Ru=e=>{const t=$(!1),n=Z(()=>t.value);return qt(()=>{var a,l,c,u;const s=(a=e.params)==null?void 0:a.api,o=(l=e.params)==null?void 0:l.node,i=o==null?void 0:o.rowIndex,r=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},kA=St(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=So,{triggerRef:n,popupRef:s}=us({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),o=Z(()=>{switch(i.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),i=e;return(r,a)=>(K(),ie("div",{class:J(r.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${i.size}px`,"--badge-color":o.value})},[xt(r.$slots,"default"),We(ye("div",{class:J(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ei,i.showBadge],[U(t),{isLoading:i.loading,fullwidth:!0}]]),ye("div",{ref_key:"popupRef",ref:s,class:J(r.$style["badge-tooltip"])},yt(i.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),qh=Zl("switchStore",()=>{const e=$(null),t=Sn("switchInstance");return{openSceneHub:(o,i)=>{if(o){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:o,commentId:i},{showLoading:!1})}},openPeopleInsight:o=>{const i=t||e.value;if(!i)throw console.error("Switch instance not found"),new Error("Switch instance not found");o||console.trace("No people_id provided, defaulting to empty string"),i("people_insight",{tab:"home",id:o||""},{showLoading:!1})},switchInstanceFunc:e}}),Yq=it({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:om()},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=Yt,s=So,o=e,i=t,r={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=$(o.status),l=$(o.timezone),c=$(!0),u=$(null),d=Z(()=>r[a.value]),h=Z(()=>{var x;return(x=o.user)==null?void 0:x.name}),f=$(!1),p=$(new Date);let g;qt(async()=>{g=setInterval(()=>{p.value=new Date},6e4)}),Rl(()=>{g&&clearInterval(g)});const v=Z(()=>{if(!l.value)return"";try{return p.value.toLocaleTimeString("en-US",{timeZone:l.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",l.value),""}}),y=async()=>{var x,O,z;if(o.apiUpdateFunction)try{const V=await o.apiUpdateFunction(o.user.id);if(!V){f.value=!0,console.error("No data returned from API");return}(x=V==null?void 0:V.private_info)!=null&&x.is_offline?a.value="offline":(O=V.private_info)!=null&&O.last_active?a.value="active":a.value="away",(z=V.private_info)!=null&&z.timezone&&(l.value=V.private_info.timezone),i("dataUpdated",V)}catch(V){f.value=!0,console.error("Failed to fetch user data:",V)}finally{c.value=!1}},b=()=>{!o.apiUpdateFunction||!o.enableAutoRefresh||(u.value!==null&&clearInterval(u.value),u.value=setInterval(y,o.refreshInterval))},S=()=>{u.value!==null&&(clearInterval(u.value),u.value=null)},C=Z(()=>{const x=globalThis.location.origin,O=En.getInstance().getItem("ws.code");return To({type:"people_insight",config:{ws_code:O,baseDomain:x,user_id:o.user.id}}).url}),{copyToClipboard:E,tooltip:R}=FF(C.value,()=>i("copyLink",o.user.id)),T=qh(),{openPeopleInsight:k}=T,A=x=>{if(x.ctrlKey||x.metaKey){window.open(C.value,"_blank");return}try{k(String(o.user.id))}catch{window.open(C.value,"_blank")}},I=x=>{A(x),i("insightClick",o.user.id)};Je([()=>o.enableAutoRefresh,()=>o.refreshInterval,()=>o.apiUpdateFunction],()=>{S(),o.enableAutoRefresh&&o.apiUpdateFunction&&b()}),qt(async()=>{o.apiUpdateFunction&&(await y(),b())}),as(S);const D=Z(()=>({name:o.user.name,initial:o.user.initial,id:o.user.id,profile_image:o.user.profile_image,color:o.user.color,size:72,borderRadius:"20px"}));return(x,O)=>(K(),ie("div",{class:J([x.$style["mini-people-card"],{[x.$style.loading]:c.value},"bg-skeleton"])},[ye("div",{class:J(x.$style["avatar-section"])},[!o.private&&!f.value?(K(),Ke(kA,{key:0,size:12,status:a.value,loading:c.value,"status-tooltip":d.value},{default:me(()=>[he(bh,Zt({readOnly:!0},D.value,{borderRadius:"8px"}),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ke(bh,Zt({key:1,readOnly:!0},D.value,{borderRadius:"8px"}),null,16))],2),ye("div",{class:J(x.$style["user-info"])},[ye("div",{class:J(x.$style["info-column"])},[We((K(),ie("span",{class:J(x.$style["user-name"])},[nt(yt(h.value),1)],2)),[[U(n),{content:h.value,delay:[1e3,0]}]]),l.value&&!f.value?(K(),ie("div",{key:0,class:J([x.$style["info-row"],x.$style["time-row"]])},[We((K(),ie("div",{class:J(x.$style["time-display"])},[he(at,{source:"remote",src:"Globe",class:J(x.$style["clock-icon"]),size:"10"},null,8,["class"]),ye("span",{class:J(x.$style["time-text"])},yt(v.value)+" ("+yt(e.timezone)+")",3)],2)),[[U(s),{isLoading:c.value,fullwidth:!0}]])],2)):Ze("",!0)],2),!e.readOnly&&!o.private&&!f.value?(K(),ie("div",{key:0,class:J([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(K(),Ke(ht,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Pt(I,["prevent","stop"]),disabled:o.disabled},null,8,["disabled"])):Ze("",!0),e.showCopyLinkButton?We((K(),Ke(ht,{key:1,variant:["icon","secondary"],size:"small","aria-label":"Copy link",onClick:Pt(U(E),["prevent","stop"]),disabled:o.disabled},{default:me(()=>[he(at,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[U(n),{content:U(R),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ze("",!0)],2)):Ze("",!0)],2)],2))}}),Zq=St(Yq,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_fq991_1",loading:"_loading_fq991_25","avatar-section":"_avatar-section_fq991_28","user-info":"_user-info_fq991_33","info-column":"_info-column_fq991_42","info-row":"_info-row_fq991_50","time-row":"_time-row_fq991_56","time-display":"_time-display_fq991_62","time-text":"_time-text_fq991_70",actions:"_actions_fq991_79","status-badge":"_status-badge_fq991_83",active:"_active_fq991_96",offline:"_offline_fq991_99",busy:"_busy_fq991_102",away:"_away_fq991_105","user-local-time":"_user-local-time_fq991_108","clock-icon":"_clock-icon_fq991_116",separator:"_separator_fq991_128",timezone:"_timezone_fq991_131","refresh-btn":"_refresh-btn_fq991_134",spinning:"_spinning_fq991_137",spin:"_spin_fq991_137","insight-btn":"_insight-btn_fq991_140","copy-link-btn":"_copy-link-btn_fq991_144","last-update":"_last-update_fq991_147","user-name":"_user-name_fq991_153","loading-overlay":"_loading-overlay_fq991_166","loading-spinner":"_loading-spinner_fq991_178"}}]]),Xq=St(it({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=Gr,s=Yt,o=e,{isEditing:i}=Ru(o),r=()=>{var h,f;const u=(h=o.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(o.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Z(()=>{var d,h;const u=(h=(d=o.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(o.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=o.params)==null?void 0:u.api)==null||d.stopEditing()},c=$();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>We((K(),Ke(ht,{class:J(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:U(i),onClick:Pt(r,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:me(()=>[he(at,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[U(s),"More actions"],[U(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),Jq=["src","width","height","alt"],Rm=St(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=So,{getCachedValue:n,setCachedValue:s}=wh({dbName:"visual-cache-db",storeName:"visuals"}),o=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},i=e,r=Z(()=>({minWidth:o(i.minWidth),maxWidth:o(i.maxWidth),minHeight:o(i.minHeight),maxHeight:o(i.maxHeight),aspectRatio:i.ratio,width:o(i.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await s(h,f)},c=Z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:u,loading:d}=WT(c,"visual",l,a);return(h,f)=>We((K(),ie("div",{class:J([h.$style.visualWrapper,{[h.$style.loading]:U(d)}]),style:cn(r.value)},[ye("img",{src:U(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(r.value)},null,12,Jq)],6)),[[U(t),{isLoading:U(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),Ha=St(it({name:"ListItem",directives:{tooltip:Yt},__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},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(!1),r=$(!1);function a(C){if(!C||typeof C!="object")return!1;const E=C;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const l=Z(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!S.prefix),c=Z(()=>!!S.suffix||s.danger&&i.value),u=Z(()=>{var C;return s.type==="status"&&typeof((C=s.data)==null?void 0:C.color)=="string"?{backgroundColor:s.data.color,border:Pg(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=dg(),h=Z(()=>({[d.active]:s.selected??!1,[d.disabled]:s.disabled??!1,[d.hover]:s.hover??!1,[d.clickable]:(s.clickable??!0)&&!s.disabled,[d.danger]:s.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:c.value,[d.readOnly]:s.readOnly}));Z(()=>({content:"Cancel",...b})),Z(()=>({content:"Confirm",theme:"warning",...b}));function f(C){return{name:C.name,initial:C.initial,id:C.id,profile_image:C.profile_image??null,color:C.color,size:24}}function p(){i.value=!1}function g(C){C?o("click",C):(s.clickable??!0)&&(o("update:selected",!s.selected),o("select",!s.selected))}function v(C){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||g(C);o("handleClick",C)}}const y=()=>{i.value?p():o("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),S=Xp();return Je(()=>s.show,C=>{C===!1&&(i.value=!1)}),t({select:()=>{v(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(C,E)=>{const R=oo("focusable"),T=oo("tooltip");return We((K(),Ke(ht,{variant:["menu-item",e.danger?"danger":"menu-item"],class:J([C.$style["list-item"],h.value]),onHandleClick:v,onMouseenter:E[0]||(E[0]=k=>r.value=!0),onMouseleave:E[1]||(E[1]=k=>r.value=!1),onEscape:y},{default:me(()=>[l.value?(K(),ie("div",{key:0,class:J(C.$style["list-item__prefix"])},[xt(C.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ke(at,{key:0,src:e.icon,source:"remote",class:J(C.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(K(),ie("div",{key:1,class:J(C.$style["status-indicator"]),style:cn(u.value)},null,6)):e.type==="assignee"&&a(e.data)?(K(),Ke(bh,Zt({key:2},f(e.data),{class:C.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ze("",!0)])],2)):Ze("",!0),ye("div",{class:J(C.$style["list-item__label"])},[xt(C.$slots,"label",{selected:e.selected},()=>[nt(yt(e.label),1)])],2),c.value?(K(),ie("div",{key:1,class:J(C.$style["list-item__suffix"])},[xt(C.$slots,"suffix",{item:C.$props,hovered:r.value},()=>[e.danger&&i.value?(K(),ie("div",{key:0,class:J(C.$style["confirm-action"])},[We((K(),Ke(ht,{variant:["tertiary","icon","danger"],size:"small",onClick:Pt(p,["stop","prevent"])},{default:me(()=>[he(at,{src:"Xmark",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.0`],[T,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),We((K(),Ke(ht,{variant:["danger","primary","icon"],size:"small",onClick:Pt(g,["stop","prevent"])},{default:me(()=>[he(at,{src:"Check",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.1`],[T,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ze("",!0)])],2)):Ze("",!0)]),_:3},8,["variant","class"])),[[R,s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_y7vz1_1",disabled:"_disabled_y7vz1_16",danger:"_danger_y7vz1_23","has-prefix":"_has-prefix_y7vz1_26","has-suffix":"_has-suffix_y7vz1_26",clickable:"_clickable_y7vz1_40",readOnly:"_readOnly_y7vz1_43",hover:"_hover_y7vz1_47",active:"_active_y7vz1_53","list-item__prefix":"_list-item__prefix_y7vz1_78","list-item__label":"_list-item__label_y7vz1_86","list-item__suffix":"_list-item__suffix_y7vz1_100","status-indicator":"_status-indicator_y7vz1_107","item-icon":"_item-icon_y7vz1_113","arbo-icon-state":"_arbo-icon-state_y7vz1_118","item-avatar":"_item-avatar_y7vz1_121","confirm-action":"_confirm-action_y7vz1_130"}}]]),Qq=["tabindex"],vs=St(it({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const s=e,o=n;Xp();const i=dg(),r=$(null),a=$("default"),l=Z(()=>{if(typeof s.size=="number")return`${s.size}px`;switch(s.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=Z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=Z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:s.disabled,[i.readOnly]:s.readOnly,[i.error]:s.error,[i.clickable]:s.clickable,[i.active]:s.actived,[i.hovered]:s.hovered,[i.focused]:!s.readOnly&&!s.disabled&&s.focused,[i.bordered]:s.bordered})),d=()=>{var C,E;const g=((C=r.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=r.value)==null?void 0:E.querySelectorAll(":scope > .wrapper-suffix").length)||0,y="var(--icon-size)",S=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${S}))`:!g&&v?`calc(100% - (${v} * ${y} + ${S})) repeat(${v}, ${y})`:g&&v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${v} * ${y} + ${S})) repeat(${v}, ${y})`:"100%"},h=$("100%"),f=()=>{h.value=d()};qd(()=>{f()}),qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:r,updateState:p,componentState:a,focus:()=>{Et(()=>{var g;(g=r.value)==null||g.focus()})},escape:()=>{o("escape")}}),(g,v)=>(K(),ie("div",{ref_key:"rootEl",ref:r,class:J([U(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[xt(g.$slots,"prefix",{hovered:s.hovered,focused:s.focused}),xt(g.$slots,"default",{hovered:s.hovered,focused:s.focused,updateComponentState:p,disabled:s.disabled}),xt(g.$slots,"suffix",{hovered:s.hovered,focused:s.focused})],14,Qq))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_11gbb_1",readOnly:"_readOnly_11gbb_26",bordered:"_bordered_11gbb_29",disabled:"_disabled_11gbb_29",active:"_active_11gbb_29",focused:"_focused_11gbb_29",hovered:"_hovered_11gbb_34",error:"_error_11gbb_38",clickable:"_clickable_11gbb_51",suffix:"_suffix_11gbb_57",prefix:"_prefix_11gbb_58"}}]]),eY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const tY=Object.prototype.toString,nY=e=>tY.call(e)==="[object Object]",Du=()=>{};function sY(e,t){function n(...s){return new Promise((o,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(o).catch(i)})}return n}function oY(e,t={}){let n,s,o=Du;const i=l=>{clearTimeout(l),o(),o=Du};let r;return l=>{const c=Mr(e),u=Mr(t.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(s&&(i(s),s=void 0),Promise.resolve(l())):new Promise((d,h)=>{o=t.rejectOnCancel?h:d,r=l,u&&!s&&(s=setTimeout(()=>{n&&i(n),s=void 0,d(r())},u)),n=setTimeout(()=>{s&&i(s),s=void 0,d(l())},c)})}}function jb(e){return Array.isArray(e)?e:[e]}function iY(e,t=200,n={}){return sY(oY(t,n),e)}function rY(e,t,n){return Je(e,t,{...n,immediate:!0})}const OA=eY?window:void 0;function Yh(e){var t;const n=Mr(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Kb(...e){const t=(s,o,i,r)=>(s.addEventListener(o,i,r),()=>s.removeEventListener(o,i,r)),n=Z(()=>{const s=jb(Mr(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0});return rY(()=>{var s,o;return[(s=(o=n.value)===null||o===void 0?void 0:o.map(i=>Yh(i)))!==null&&s!==void 0?s:[OA].filter(i=>i!=null),jb(Mr(n.value?e[1]:e[0])),jb(U(n.value?e[2]:e[1])),Mr(n.value?e[3]:e[2])]},([s,o,i,r],a,l)=>{if(!(s!=null&&s.length)||!(o!=null&&o.length)||!(i!=null&&i.length))return;const c=nY(r)?{...r}:r,u=s.flatMap(d=>o.flatMap(h=>i.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function qb(e,t,n={}){const{window:s=OA,ignore:o=[],capture:i=!0,detectIframe:r=!1,controls:a=!1}=n;if(!s)return a?{stop:Du,cancel:Du,trigger:Du}:Du;let l=!0;const c=v=>Mr(o).some(y=>{if(typeof y=="string")return Array.from(s.document.querySelectorAll(y)).some(b=>b===v.target||v.composedPath().includes(b));{const b=Yh(y);return b&&(v.target===b||v.composedPath().includes(b))}});function u(v){const y=Mr(v);return y&&y.$.subTree.shapeFlag===16}function d(v,y){const b=Mr(v),S=b.$.subTree&&b.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(C=>C.el===y.target||y.composedPath().includes(C.el))}const h=v=>{const y=Yh(e);if(v.target!=null&&!(!(y instanceof Element)&&u(e)&&d(e,v))&&!(!y||y===v.target||v.composedPath().includes(y))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[Kb(s,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:i}),Kb(s,"pointerdown",v=>{const y=Yh(e);l=!c(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),r&&Kb(s,"blur",v=>{setTimeout(()=>{var y;const b=Yh(e);((y=s.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(b!=null&&b.contains(s.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const aY=["value","placeholder","disabled","readonly","inputmode","maxlength"],Yb=St(it({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const s=Gr,o=Yt,i=e,r=n,a=$(null),l=$(i.modelValue||"");Je(l,()=>{r("onValidation",l.value)});const c=$(!1),u=$(i.modelValue||"");Je(()=>i.modelValue,P=>{l.value=P||"",u.value=P||""});const d=Z(()=>{var P;return((P=l.value)==null?void 0:P.length)>0}),h={text:P=>P.slice(0,i.maxLength||255),number:P=>{let L=P.replace(/[^\d.-]/g,"");const te=L.split(".");te.length>2&&(L=te[0]+"."+te.slice(1).join("")),L=L.replace(/-/g,(X,we)=>we===0?X:"");const Fe=L.startsWith("-")?"-":"",ce=L.replace("-","").split(".");return ce[0].length>17&&(ce[0]=ce[0].substring(0,17)),i.maxDecimalChar!==void 0&&ce.length>1&&(ce[1]=ce[1].substring(0,i.maxDecimalChar)),L=Fe+ce.join("."),L},email:P=>P.replace(/\s/g,"").slice(0,i.maxLength||255),url:P=>P.replace(/\s/g,"").slice(0,i.maxLength||255),tel:P=>P.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},f=P=>{const L=h[i.type];return L?L(P):P},p=iY(P=>{i.autoEmit&&(r("update:modelValue",P),r("input",P))},i.debounceDelay),g=P=>{const L=P;if(i.disabled||i.readOnly){L.preventDefault();return}const te=L.target,de=te.selectionStart||0,Fe=l.value,pe=f(te.value);Fe!==pe&&(l.value=pe,r("input",pe),i.autoEmit&&p(pe),te.value!==pe&&(te.value=pe,Et(()=>{let ce=de;if(pe.length<te.value.length)ce=de;else{const X=pe.length-Fe.length;ce=de+X}ce=Math.max(0,Math.min(ce,pe.length)),te.setSelectionRange(ce,ce)})))},v=P=>{if(i.disabled||i.readOnly){P.preventDefault();return}c.value=!0;const L=l.value;l.value="",r("update:modelValue",""),r("clear"),L!==""&&r("change",""),P.preventDefault(),P.stopImmediatePropagation(),P.stopPropagation(),Et(()=>{var te;(te=a.value)==null||te.focus(),setTimeout(()=>{c.value=!1},100)})},y=P=>{i.disabled||i.readOnly||(r("focus",P),i.selectOnFocus&&Et(()=>{P.target.select()}))},b=P=>{if(c.value)return;const te=P.target.value;i.autoEmit||r("update:modelValue",te),u.value!==te&&(r("change",te),u.value=te),r("blur",te,P)},S=P=>{setTimeout(()=>{Et(()=>{const te=P.target.value;r("enter",te,P),r("enterValue",te),i.submitOnEnter&&(P.preventDefault(),i.autoEmit||r("update:modelValue",te),u.value!==te&&(r("change",te),u.value=te))})},1e3)},C=P=>{const L=P.target,te=L.value;if(r("escape",te,P),P.preventDefault(),P.stopImmediatePropagation(),P.stopPropagation(),i.autoEmit){r("cancel"),i.blurOnEscape&&L.blur();return}l.value=i.modelValue||"",a.value&&(a.value.value=l.value),r("cancel"),i.blurOnEscape&&L.blur()},E=P=>{const te=P.target.value;r("tab",te,P),i.autoEmit||(r("update:modelValue",te),u.value!==te&&(r("change",te),u.value=te))},R=(P,L,te)=>P===""?!0:P==="."?te>0:new RegExp(`^\\d{0,${L}}(\\.\\d{0,${te}})?$`).test(P),T=P=>{if(r("keydown",P),P.key===" "&&P.stopPropagation(),i.type==="number"){if(P.key==="e"||P.key==="E"){P.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(P.key)||P.ctrlKey||P.metaKey||P.altKey)){if(Number.isNaN(Number(P.key))&&P.key!=="."&&P.key!=="-"){P.preventDefault();return}const de=l.value+P.key;if(!R(de,17,i.maxDecimalChar||2)){P.preventDefault(),console.log("BLOCKED",de);return}}}P.key==="Escape"?C(P):P.key==="Enter"?S(P):P.key==="Tab"?E(P):(P.key==="ArrowUp"||P.key==="ArrowDown")&&i.type==="number"&&P.preventDefault()},k=P=>{r("keyup",P)},A=P=>{if(i.disabled||i.readOnly){P.preventDefault();return}r("paste",P)},I=P=>{if(i.disabled||i.readOnly){P.preventDefault();return}r("cut",P)},D=P=>{r("select",P)},x=`input-text-${Math.random().toString(36).substr(2,9)}`,O=$(!1),z=Z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Je(()=>l.value,P=>{i.validatorFnc?O.value=!!P&&!i.validatorFnc(P):O.value=!1});const V=$(null),j=Z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:O.value,inputRef:a,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:V,bordered:!0})),{argsMain:ee,isHover:Q,isFocus:G}=ms(j);t({triggerFocus:()=>{Et(()=>{var P;(P=a.value)==null||P.focus()})},focus:()=>{fe()},blur:()=>{Et(()=>{var P;(P=a.value)==null||P.blur()})},select:()=>{Et(()=>{var P;(P=a.value)==null||P.select()})},setSelectionRange:(P,L)=>{Et(()=>{var te;(te=a.value)==null||te.setSelectionRange(P,L)})},getValue:()=>l.value,setValue:P=>{l.value=f(P),a.value&&(a.value.value=l.value)}});const fe=()=>{!i.disabled&&!i.readOnly&&Et(()=>{var P;(P=a.value)==null||P.focus()})},q=Z(()=>G.value&&d.value);return(P,L)=>(K(),ie("div",{class:J([P.$style["input-wrapper"],"input-editor"]),onClick:fe},[We((K(),Ke(vs,Zt(U(ee),{ref_key:"wrapperRef",ref:V,class:[P.$style["input-box"],{[P.$style["is-hovered"]]:U(Q),[P.$style["is-focused"]]:U(G),[P.$style["has-input"]]:d.value,[P.$style["is-editting"]]:q.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:me(()=>[xt(P.$slots,"prefix")]),suffix:me(()=>[d.value&&!i.disabled&&!i.readOnly?xt(P.$slots,"clear",{key:0},()=>[We((K(),Ke(ht,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Pt(v,["prevent","stop"]),size:18,rounded:!0,class:J(["wrapper-suffix",P.$style["clear-button"]])},{default:me(()=>[he(at,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[U(o),{content:"Clear",contentClass:"extra-padding"}]])]):xt(P.$slots,"suffix",{key:1})]),default:me(()=>[ye("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:J([P.$style["column-config__input"]]),id:x,disabled:e.disabled,readonly:e.readOnly,inputmode:z.value,maxlength:i.maxLength,onInput:g,onFocus:y,onBlur:b,onKeydown:T,onKeyup:k,onPaste:A,onCut:I,onSelect:D},null,42,aY)]),_:3},16,["class","bordered"])),[[U(s),i.focusIndex]]),O.value?xt(P.$slots,"error",{key:0}):Ze("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wqanj_1","is-disabled":"_is-disabled_wqanj_16","is-readonly":"_is-readonly_wqanj_16","is-hovered":"_is-hovered_wqanj_16","is-focused":"_is-focused_wqanj_20","column-config__input":"_column-config__input_wqanj_40","clear-button":"_clear-button_wqanj_55"}}]]),lY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},Zb=it({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(null),r=Ri(c=>{o("update:modelValue",c),o("search",c)},sr),a=()=>{o("update:modelValue",""),o("clear"),Et(()=>{var c;(c=i.value)==null||c.focus()})},l=$(s.modelValue);return t({focus:()=>{var c;(c=i.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(K(),Ke(Yb,{focusIndex:s.focusIndex,ref_key:"searchInput",ref:i,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:U(r),onClear:a,onCancel:u[1]||(u[1]=d=>o("cancel")),"auto-emit":!0},{prefix:me(()=>[ye("div",lY,[he(at,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),cY=["aria-activedescendant"],uY=["innerHTML"],dY=10,Xr=St(it({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const s=Yt,o={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,r=n,a=$(""),l=$(-1),c=$(null),u=$(null),d=$(new Map),h=Z(()=>db(a.value)),f=()=>{const q=h.value;if(!q||q.length<i.minQueryLength)return i.options;if(d.value.has(q))return d.value.get(q);const P=i.options.map(L=>({item:L,score:aK(` ${L.label} `,q)})).filter(({score:L})=>L>0).sort((L,te)=>te.score-L.score).map(({item:L})=>L);return d.value.set(q,P),P},p=$([]);Je(()=>i.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Z(()=>i.hasMore&&!i.loading&&!i.loadingMore),v=Ri(q=>{a.value=q,l.value=-1,r("search",q)},sr),y=async q=>{G.value=0,await v(q||""),G.value=1},b=q=>a.value?lK(q,a.value):q,S=q=>{const L={[o.ARROW_DOWN]:()=>C(q),[o.ARROW_UP]:()=>E(q),[o.ENTER]:()=>k(q),[o.ESCAPE]:()=>A(q),[o.TAB]:()=>I(q)}[q.key];L&&L()},C=q=>{q.preventDefault(),R(1)},E=q=>{q.preventDefault(),R(-1)},R=q=>{const P=p.value.length;if(P===0)return;let L;q>0?L=(l.value+1)%P:l.value>0?L=l.value-1:L=P-1,l.value=L,T()},T=()=>{Et(()=>{var P;const q=(P=u.value)==null?void 0:P.querySelectorAll('[role="menuitem"]')[l.value];q==null||q.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},k=q=>{if(q.preventDefault(),l.value>=0&&l.value<p.value.length){const L=p.value[l.value];D(L,q)}},A=q=>{q.preventDefault(),O()},I=q=>{r("tab",q)},D=(q,P)=>{!q||q.disabled||(r("select",q,P),l.value=-1,O())},x=q=>{q>=0&&q<p.value.length&&(l.value=q)},O=()=>{r("close")},z=()=>{if(!g.value||!u.value)return;const{scrollTop:q,clientHeight:P,scrollHeight:L}=u.value;L-(q+P)<=dY&&r("loadMore")},V=()=>{var q,P,L;(q=u.value)==null||q.addEventListener("scroll",z),(L=(P=Q.value)==null?void 0:P.$el)==null||L.addEventListener("keydown",S)},j=()=>{var q,P,L;(q=u.value)==null||q.removeEventListener("scroll",z),(L=(P=Q.value)==null?void 0:P.$el)==null||L.removeEventListener("keydown",S)};qt(()=>{V()}),as(()=>{j()}),Je(()=>i.loading,q=>{!q&&p.value.length>0&&(l.value=-1)});const ee=q=>q?Array.isArray(i.selectedId)?i.selectedId.includes(String(q.id)):i.selectedId==q.id:!1,Q=$(null);Je(l,()=>{T()}),t({focus:()=>{Et(()=>{var q;(q=Q.value)==null||q.focus()})},reset:()=>{var q;(q=Q.value)==null||q.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:O,clearSearch:()=>{a.value=""},scrollTo:q=>{u.value&&(u.value.scrollTop=q)},selectIndex:q=>{q>=0&&q<p.value.length&&(l.value=q,T())}});const G=$(0);Je([()=>i.loading,()=>a.value,()=>i.options,()=>i.loadingMore],()=>{const q=i.options.length>0&&p.value.length>0,P=!q&&a.value.length>0,L=!q&&a.value.length===0;i.loading?G.value=0:q?G.value=1:P?G.value=2:L&&(G.value=3)},{immediate:!0,deep:!0});const fe=()=>{r("cancel")};return(q,P)=>(K(),ie("datalist",{ref_key:"searchListRef",ref:c,class:J([q.$style["search-list"],G.value===3||G.value===2?q.$style.empty:"",p.value.length>8?q.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.width})},[he(Zb,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":P[0]||(P[0]=L=>a.value=L),class:J(q.$style["search-box"]),disabled:e.loading,onSearch:y,onClear:P[1]||(P[1]=L=>y("")),onCancel:fe},null,8,["modelValue","class","disabled"]),ye("div",{ref_key:"popupRef",ref:u,class:J(q.$style["list-container"]),style:cn({maxHeight:e.maxHeight})},[xt(q.$slots,"extra-item",{query:a.value}),(K(!0),ie(Tt,null,xn(p.value,(L,te)=>We((K(),ie("div",{key:`${L.id}-${te}`,role:"menuitem"},[xt(q.$slots,"item",{item:L,index:te,selectedIndex:l.value,isSelected:ee,handleSelect:D,handleItemHover:x,getHighlightedLabel:b,query:a.value,idx:te},()=>[L.hide?Ze("",!0):(K(),Ke(Ha,Zt({key:0,ref_for:!0},L,{hover:te===l.value,selected:ee(L),type:L.type,id:`item-${te}`,"aria-selected":te===l.value,onClick:de=>D(L,de),onMouseover:de=>x(te),onEscape:O}),{prefix:me(()=>[xt(q.$slots,"prefix-item",{item:L})]),label:me(()=>[a.value?We((K(),ie("span",{key:0,class:J(q.$style.match),innerHTML:b(L.label)},null,10,uY)),[[U(s),{content:L.label,delay:[1e3,0]}]]):We((K(),ie("span",{key:1,class:J(q.$style["item-label"])},[nt(yt(L.label),1)],2)),[[U(s),{content:L.label,delay:[1e3,0]}]])]),suffix:me(({hovered:de})=>[xt(q.$slots,"action",{item:L,isHovered:te===l.value,hovered:de,selected:l.value==te})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[Ei,G.value===1]])),128)),G.value===0?xt(q.$slots,"loading-more",{key:0},()=>[(K(),ie(Tt,null,xn(8,L=>ye("div",{class:J(q.$style["loading-more"]),key:L},[ye("div",{class:J(q.$style["loading-skeleton"])},null,2),ye("div",{class:J(q.$style["loading-skeleton"])},null,2)],2)),64))]):Ze("",!0),G.value===2?(K(),ie("div",{key:1,class:J(q.$style["no-results"])},[xt(q.$slots,"empty",{query:a.value},()=>[ye("div",{class:J(q.$style["no-results-content"])},[...P[2]||(P[2]=[ye("div",null,[nt(" No results. "),ye("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ze("",!0),G.value===3?(K(),ie("div",{key:2,class:J(q.$style["no-results"])},[xt(q.$slots,"empty-list",{},()=>[ye("div",{class:J(q.$style["no-results-content"])},[...P[3]||(P[3]=[ye("div",null,"No items available.",-1)])],2)])],2)):Ze("",!0),xt(q.$slots,"footer")],6)],14,cY))}}),[["__cssModules",{$style:{"search-list":"_search-list_q431s_1",empty:"_empty_q431s_9",scrollable:"_scrollable_q431s_15","list-container":"_list-container_q431s_22","item-label":"_item-label_q431s_41","loading-state":"_loading-state_q431s_49","loading-more":"_loading-more_q431s_50","loading-skeleton":"_loading-skeleton_q431s_61","is-loading":"_is-loading_q431s_68","no-results":"_no-results_q431s_123","no-results-content":"_no-results-content_q431s_130",title:"_title_q431s_133",tips:"_tips_q431s_139",match:"_match_q431s_153","skeleton-loading":"_skeleton-loading_q431s_1"}}]]),Xl=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=qW,n=e,s=$(n.appendTo||void 0),o=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:s.value}),i=$(o());Je(()=>n,()=>{setTimeout(()=>{Et(()=>{s.value=n.appendTo||void 0,i.value=o()})},50)},{immediate:!0,deep:!0});const r=Z(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial}));return(a,l)=>We((K(),Ke(bh,J_(xw(r.value)),null,16)),[[U(t),i.value]])}}),hY={class:"avatar-wrapper"},fY={class:"assignee-label"},pY=St(it({__name:"AssigneeItem",props:{user:{},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Yt,s=e,o=Z(()=>({name:s.user.name,id:s.user.id,profile_image:s.user.profile_image,color:{bgColor:s.user.color.bgColor,textColor:s.user.color.textColor},initial:s.user.initial})),i=Z(()=>s.isMe),r=Xp(),a=Z(()=>{if(!l.value||!r.actions)return 0;let c=0;const u=d=>{d.forEach(h=>{h.type===Tt&&Array.isArray(h.children)?u(h.children):h.type!==Kn&&h.type!==_a&&c++})};return u(r.actions()),c}),l=$(!1);return(c,u)=>(K(),ie("div",{class:J(["assignee-selector-item",{hovered:l.value,disabled:s.disabled,selected:s.selected,single:a.value==0,focused:s.focused}]),style:cn({"--actions-count":a.value}),onMouseenter:u[0]||(u[0]=d=>l.value=!0),onMouseleave:u[1]||(u[1]=d=>l.value=!1)},[ye("div",hY,[he(Xl,{user:o.value,"show-profile":!0,isMe:i.value,"append-to":s.appendTo,"api-update-function":s.apiUpdateFunction},null,8,["user","isMe","append-to","api-update-function"]),s.multipleSelect?(K(),ie("div",{key:0,class:J(["avatar-indicator",[s.selected?"remove":"add"]])},[s.selected?(K(),Ke(at,{key:0,src:"CircleXMark"})):(K(),Ke(at,{key:1,src:"CirclePlus"}))],2)):Ze("",!0)]),We((K(),ie("div",fY,[xt(c.$slots,"name",{},()=>[nt(yt(s.user.name),1)],!0)])),[[U(n),{content:s.user.name,delay:[1e3,0]}]]),l.value?xt(c.$slots,"actions",{key:0},void 0,!0):Ze("",!0)],38))}}),[["__scopeId","data-v-7be8f59d"]]),gY=["innerHTML"],mY=20,MA=St(it({__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","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,{id:i}=Np(o),r=n,a=P=>{var te,de;const L=(de=(te=o.params)==null?void 0:te.api)==null?void 0:de.getRowNode(String(i.value));L==null||L.setDataValue("assignees",Ox(P.assignees)),r("updated",P),r("update-completed")},l=$(!1),c=$(!1),u=$(null),d=$(1),h=$(!0),f=$(0),p=$(""),g=Sn("bulkUpdate",$(!1)),v=Sn("isSelectAll",$(!1)),{unAssignAll:y,replaceAssignees:b,handleSelect:S,assigneeList:C,mergedOptions:E,selectedUserIds:R}=um({...o,entityId:o.entityId,updateRowData:a,value:o.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{r("update-failed")}}),{apiServices:T}=Qn(!g.value,o),k=Sn("workspaceId"),A=async(P=1,L="",te=!1)=>{var de,Fe,pe,ce,X;if(!T.value||!o.id&&!o.ids)throw console.error("API service or item identifiers are undefined",T.value,o.id,o.ids),new Error("API service or item identifiers are undefined");if(te?c.value=!0:l.value=!0,u.value=null,!((de=T.value)!=null&&de.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const we=await((Fe=T.value)==null?void 0:Fe.multipleAssignableUser({workspaceId:String(k),itemIds:(o.ids??(o.id?[o.id]:[])).map(String),page:P,perPage:mY,q:L.trim()})),ae=((pe=mu(we.data))==null?void 0:pe.map(cm))??[];C.value=te?nu(C.value,ae,"id"):ae,f.value=we.meta.total,h.value=(((ce=we==null?void 0:we.meta)==null?void 0:ce.current_page)||0)<(((X=we==null?void 0:we.meta)==null?void 0:X.last_page)||0),d.value=P}catch(we){console.error("Error fetching assignable users:",we),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},I=()=>{!c.value&&h.value&&A(d.value+1,p.value,!0)},D=Ri(async P=>{p.value=P,await A(1,P,!1)},sr),x=()=>A(1,p.value,!1);qt(()=>{var P;(P=z.value)==null||P.focus()}),t({getValue:()=>{var P;return(P=E.value.find(L=>L.selected))==null?void 0:P.value},refresh:x,clearInternal:()=>{R.value=[]},focus:()=>{var P;(P=z.value)==null||P.focus()}});const O=()=>{const P=En.getInstance().getItem("BASE_URL"),L=To({type:"access_setting",config:{baseDomain:P,ws_code:o.workspaceId,entity_id:k}}).url;window.open(L,"_blank")},z=$(null);qt(()=>{Et(()=>{var P;(P=z.value)==null||P.focus()})}),Je([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{A()},{deep:!0,immediate:!0});const V=P=>{var te;const L=En.getInstance().getItem("ws.code");return((te=T.value)==null?void 0:te.getUserInformation(L,P))||Promise.resolve(null)},j=async P=>{try{r("start-update");const L=await S(P);r("update-completed")}catch(L){r("update-failed"),console.error("Error updating assignees:",L)}},ee=async()=>{try{r("start-update");const P=await y();r("update-completed")}catch(P){r("update-failed"),console.error("Error unassigning all assignees:",P)}},Q=async P=>{try{r("start-update");const L=await b(P);r("update-completed")}catch(L){r("update-failed"),console.error("Error replacing assignees:",L)}},G=()=>{var P,L;r("cancel"),(L=(P=o.params)==null?void 0:P.api)==null||L.stopEditing()};Ki("popupAttachRef",z);const fe=$(),q=$(!1);return qt(()=>{Et(()=>{setTimeout(()=>{q.value=!0},50)})}),(P,L)=>(K(),ie("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:fe},[he(Xr,Zt({"selected-id":U(R)},{...o},{options:U(E),loading:l.value,ref_key:"popupRef",ref:z,"loading-more":c.value,"has-more":h.value,onSelect:L[0]||(L[0]=te=>{j(te)}),"data-wrapper":"true",onSearch:U(D),onLoadMore:I,onCancel:G,onClose:G}),Yd({"extra-item":me(()=>[he(ht,{variant:"menu-item",onHandleClick:ee},{prefix:me(()=>[ye("div",{class:J(P.$style["unassign-icon"])},[he(at,{src:"UserXMark",source:"remote"})],2)]),default:me(()=>[L[1]||(L[1]=nt(" Unassign all ",-1))]),_:1})]),item:me(({item:te,selectedIndex:de,isSelected:Fe,handleItemHover:pe,getHighlightedLabel:ce,query:X,idx:we})=>[he(pY,{user:te.data,"multiple-select":!0,"append-to":fe.value,isMe:!1,hover:we===de,selected:Fe(te),onClick:Pt(ae=>j(te),["stop","prevent"]),onMouseover:ae=>pe(we),"api-update-function":V},{name:me(()=>[X?We((K(),ie("span",{key:0,class:J([P.$style["item-label"],P.$style.match]),style:{flex:"1"},innerHTML:ce(te.label)},null,10,gY)),[[U(s),{content:te.label}]]):We((K(),ie("span",{key:1,class:J(P.$style["item-label"]),style:{flex:"1"}},[nt(yt(te.label),1)],2)),[[U(s),{content:te.label}]])]),actions:me(()=>[We((K(),Ke(ht,{variant:"secondary",size:"small",label:"",onClick:Pt(ae=>{var Oe;return Q((Oe=te.data)==null?void 0:Oe.id)},["stop"])},{default:me(()=>[he(at,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[U(s),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),"empty-list":me(()=>[ye("div",{class:J(P.$style["empty-state"])},[L[4]||(L[4]=nt(" No assignee available. ",-1)),L[5]||(L[5]=ye("br",null,null,-1)),he(ht,{onClick:O,variant:["tertiary"],size:"small"},{default:me(()=>[...L[3]||(L[3]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:me(()=>[ye("div",{class:J(P.$style["error-message"])},[nt(yt(u.value)+" ",1),he(ht,{onClick:x,size:"small"},{default:me(()=>[...L[2]||(L[2]=[nt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_zb1un_1","item-assignee":"_item-assignee_zb1un_6","item-action":"_item-action_zb1un_6","item-label":"_item-label_zb1un_16","unassign-icon":"_unassign-icon_zb1un_25","error-message":"_error-message_zb1un_36","empty-state":"_empty-state_zb1un_46","skeleton-avatar":"_skeleton-avatar_zb1un_59"}}]]),vY=it({__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;Ki("bulkUpdate",!0);const s=t,o=$(null),i=f=>{var p;h.value=!1,s("update",f),(p=o.value)==null||p.clearInternal()},{triggerRef:r,popupRef:a,hide:l,isVisible:c}=us({toggleOnClick:!0,zIndex:2}),u=$(null),d=f=>{f.key==="Escape"&&a.value&&l()};qt(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",d)}),as(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",d)}),Je(c,f=>{var p,g;f?(p=o.value)==null||p.focus():(g=o.value)==null||g.clearInternal()});const h=$(!1);return(f,p)=>(K(),ie("div",{ref_key:"mainRef",ref:u},[ye("div",{ref_key:"triggerRef",ref:r},[he(ht,{class:"action-button",variant:n.variant,loading:h.value},{default:me(()=>[he(at,{src:"UserPlus",class:"icon"}),p[3]||(p[3]=nt(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),ye("div",{ref_key:"popupRef",ref:a,style:{display:"none"}},[U(c)?(K(),Ke(MA,Zt({key:0,ref_key:"assigneeGroupEditorRef",ref:o},n,{ids:e.ids,onUpdated:i,onStartUpdate:p[0]||(p[0]=g=>h.value=!0),onUpdateFailed:p[1]||(p[1]=g=>h.value=!1),onUpdateCompleted:p[2]||(p[2]=g=>h.value=!1)}),null,16,["ids"])):Ze("",!0)],512)],512))}}),Zh=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],yY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Ga=(e,t)=>{const n=s=>{var o,i;if(s.key==="Tab"){const r=s.shiftKey||s.metaKey;s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation();const a=document.activeElement,l=(o=a==null?void 0:a.dataset)==null?void 0:o.index;if(l){let c=Zh.indexOf(l);const u=r?-1:1;for(const d of Zh){c=(c+u+Zh.length)%Zh.length;const h=Zh[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(s.key==="Enter")(i=s.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(s.key==="Escape"){s.stopPropagation(),s.stopImmediatePropagation();const r=document.querySelector('[data-index="calendar-wrapper"]');r==null||r.focus()}};if(yY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},wY=["aria-label"],CY=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],bY={style:{flex:"1"}},SY=St(it({__name:"MainCalendar",props:eD({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:eD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const s=Yt,o=$(null),i=e,r=Z(()=>i.startDate&&i.endDate),a=OH(e,"tracingCase"),l=n,c=$(i.year),u=$(i.month);Je(()=>[i.year,i.month],([P,L])=>{c.value=P,u.value=L});const d=Z(()=>mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),h=Z(()=>mt.now().setZone(i.timezone)),f=Z(()=>i.startDate?mt.fromJSDate(i.startDate,{zone:i.timezone}):null),p=Z(()=>i.endDate?mt.fromJSDate(i.endDate,{zone:i.timezone}):null),g=$(f.value),v=$(p.value),y=$(f.value),b=$(p.value);Je([f,p],()=>{i.requireConfirm||(g.value=f.value,v.value=p.value,y.value=f.value,b.value=p.value)},{immediate:!0});const S=Z(()=>i.requireConfirm?g.value:f.value),C=Z(()=>i.requireConfirm?v.value:p.value);Je(()=>i.activeField,P=>{const L=P==="start"?S.value:C.value;L&&(c.value=L.year,u.value=L.month)}),Je(()=>{var P,L;return[(P=S.value)==null?void 0:P.toISODate(),(L=C.value)==null?void 0:L.toISODate(),i.activeField]},()=>{const P=i.activeField==="start"?S.value:C.value;P&&(P.year!==c.value||P.month!==u.value)&&(c.value=P.year,u.value=P.month)});function E(P){return P.setZone("utc")}const R=$("");function T(P){R.value=P.toISODate()||"",Et(()=>{const L=document.querySelector(`.arbo-calendar-day[data-date="${R.value}"]`);L==null||L.focus()})}Je(()=>{var P,L;return[c.value,u.value,i.activeField,(P=S.value)==null?void 0:P.toISODate(),(L=C.value)==null?void 0:L.toISODate()]},()=>{const P=i.activeField==="start"?S.value:C.value;let L;P&&P.year===c.value&&P.month===u.value?L=P:S.value&&S.value.year===c.value&&S.value.month===u.value?L=S.value:L=h.value,T(L)});function k(P){return P.toFormat("d")}const A=Z(()=>{const P=mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}),L=P.weekday,te=i.weekStart===1?(L+6)%7:L%7;let de=P.minus({days:te});const Fe=[],pe=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),ce=dg();for(let we=0;we<42;we++){const ae=[];de.month!==u.value&&ae.push(ce["is-outside"]),de.hasSame(h.value,"day")&&ae.push(ce["is-today"]),S.value&&de.hasSame(S.value,"day")&&ae.push(ce["is-selected-start"]),C.value&&de.hasSame(C.value,"day")&&ae.push(ce["is-selected-end"]),S.value&&C.value&&de>S.value&&de<C.value&&ae.push(ce["is-in-range"]);const Oe=k(de),H=pe[de.weekday-1]||"";Fe.push({dt:de,iso:de.toISODate()||"",label:de.toFormat("d"),displayLabel:Oe,weekdayLabel:H,aria:de.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:ae}),de=de.plus({days:1})}const X=[];for(let we=0;we<6;we++)X.push(Fe.slice(we*7,we*7+7));return X}),I=Z(()=>{const P=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?P:[P[6],...P.slice(0,6)]});function D(P,L,te){const de=P==="start"?L.startOf("day"):L.endOf("day"),Fe=E(de),pe={year:de.year,month:de.month,day:de.day,utc:Fe.toISO()||""};P==="start"?(l("select-start",pe,te??!0),l("select-start-utc",pe.utc)):(l("select-end",pe),l("select-end-utc",pe.utc))}function x(P){let L=c.value,te=u.value+P;for(;te<1;)te+=12,L-=1;for(;te>12;)te-=12,L+=1;c.value=L,u.value=te,l("update:year",L),l("update:month",te)}function O(P){const te=(R.value?mt.fromISO(R.value,{zone:i.timezone}):h.value).plus({days:P});te.month===u.value&&te.year===c.value&&T(te)}function z(P=!1){const te=(R.value?mt.fromISO(R.value,{zone:i.timezone}):h.value).weekday%7,de=P?6-te:-te;O(de)}const V=P=>{j(P)};function j(P){switch(P.preventDefault(),P.stopPropagation(),P.key){case"ArrowLeft":P.preventDefault(),O(-1);break;case"ArrowRight":P.preventDefault(),O(1);break;case"ArrowUp":P.preventDefault(),O(-7);break;case"ArrowDown":P.preventDefault(),O(7);break;case"Home":P.preventDefault(),z(!1);break;case"End":P.preventDefault(),z(!0);break;case"PageUp":P.preventDefault(),x(P.shiftKey?-12:-1);break;case"PageDown":P.preventDefault(),x(P.shiftKey?12:1);break;case"Enter":case" ":{P.preventDefault();const L=R.value?mt.fromISO(R.value,{zone:i.timezone}):h.value,te=A.value.flat().find(de=>de.iso===L.toISODate());te&&Q(te);break}}}const ee=P=>{const L=mt.now().setZone(i.timezone);c.value=L.year,u.value=L.month,l("update:year",L.year),l("update:month",L.month),T(L),l("gotoToday")};function Q(P){var Ce,Me;const L=!!f.value,te=!!p.value,de=i.activeField,Fe=((Ce=f.value)==null?void 0:Ce.toISODate())||"null",pe=((Me=p.value)==null?void 0:Me.toISODate())||"null",ce=P.dt.toISODate()||"",X=(Pe,M)=>{a.value={case:Pe,behavior:M}},we=()=>`Selected start ${ce} > existing end ${pe} -> reset both to ${ce}`,ae=()=>`Selected end ${ce} < existing start ${Fe} -> reset both to ${ce}`,Oe=()=>{D("start",P.dt,!0),D("end",P.dt),l("update:activeField","end")},H=(Pe=!1)=>{D("start",P.dt,Pe),Pe&&l("update:activeField","end")},oe=(Pe=!1)=>{D("end",P.dt),Pe&&l("close")};if(L&&te){de==="start"?p.value&&P.dt>p.value?(Oe(),X("INVERT_RANGE_FROM_START",we())):(H(!1),X("UPDATE_START_IN_RANGE",`Updated start from ${Fe} to ${ce}; end remains ${pe}`)):f.value&&P.dt<f.value?(Oe(),X("INVERT_RANGE_FROM_END",ae())):(oe(!1),X("UPDATE_END_IN_RANGE",`Updated end from ${pe} to ${ce}; start remains ${Fe}`));return}if(!L&&te&&de==="start"&&p.value&&P.dt>p.value){Oe(),X("CREATE_RANGE_FROM_LATE_START",we());return}if(L&&!te&&de==="end"&&f.value&&P.dt<f.value){Oe(),X("CREATE_RANGE_FROM_EARLY_END",ae());return}if(!L&&!te){if(de==="start"){H(!0),X("INIT_START",`Picked start ${ce}; awaiting end selection`);return}oe(i.immediatelyUpdate),X("INIT_END",`Picked end ${ce}; awaiting start selection`);return}if(!L&&te){if(de==="start"){H(!0),X("FILL_MISSING_START",`Inserted start ${ce}; existing end ${pe}`);return}oe(!1),X("STRICT_UPDATE_END_ONLY",`Updated end to ${ce}; start still null`);return}if(L&&!te){if(de==="start"){H(!0),X("RESELECT_START_BEFORE_END",`Replaced start with ${ce}; end still null, switching to end`);return}oe(i.immediatelyUpdate),X("FILL_MISSING_END",`Picked end ${ce}; start ${Fe}`);return}}function G(){y.value=g.value,b.value=v.value,l("confirm")}function fe(){g.value=y.value,v.value=b.value,l("cancel")}function q(){Et(()=>{var P;(P=o.value)==null||P.focus()})}return qt(()=>{q()}),t({focus:q}),(P,L)=>(K(),ie("div",{ref_key:"calendarRef",ref:o,class:J([P.$style["arbo-calendar"],{[P.$style["arbo-date-range-picker"]]:r.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[ye("div",{class:J([P.$style["arbo-calendar-header"],P.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ie(Tt,null,xn(I.value,te=>(K(),ie("div",{key:te,class:J(P.$style["arbo-calendar-weekday"]),role:"columnheader"},yt(te),3))),128))],2),ye("div",{class:J(P.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:L[0]||(L[0]=Pt(te=>U(Ga)(te,V),["prevent","stop"]))},[(K(!0),ie(Tt,null,xn(A.value,(te,de)=>(K(),ie("div",{key:de,class:J(P.$style["arbo-calendar-week"])},[(K(!0),ie(Tt,null,xn(te,Fe=>(K(),ie("div",{key:Fe.iso,class:J([P.$style["arbo-calendar-day"],Fe.classes,{[P.$style["is-focused"]]:Fe.iso===R.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":Fe.aria,"data-date":Fe.iso,"data-weekday":Fe.weekdayLabel,tabindex:Fe.iso===R.value?0:-1,onClick:pe=>Q(Fe)},yt(Fe.displayLabel),11,CY))),128))],2))),128))],34),i.readOnly?Ze("",!0):(K(),ie("div",{key:0,class:J(P.$style["arbo-calendar-actions"])},[ye("div",bY,[We((K(),Ke(ht,{variant:"secondary",size:"medium",onClick:L[1]||(L[1]=te=>ee()),onKeydown:U(Ga),"data-index":"today-btn"},{prefix:me(()=>[he(at,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[U(s),"Today"]])]),he(ht,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:U(Ga),variant:"secondary",size:"medium",onClick:fe,"data-index":"cancel-btn"},{default:me(()=>[nt(yt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),he(ht,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:U(Ga),onClick:G},{default:me(()=>[nt(yt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,wY))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_1a7wo_1","arbo-calendar-day":"_arbo-calendar-day_1a7wo_2","arbo-calendar-week":"_arbo-calendar-week_1a7wo_3","arbo-calendar":"_arbo-calendar_1a7wo_2","arbo-calendar-nav":"_arbo-calendar-nav_1a7wo_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_1a7wo_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_1a7wo_53","arbo-calendar-weekday":"_arbo-calendar-weekday_1a7wo_58","arbo-calendar-weeks":"_arbo-calendar-weeks_1a7wo_63","is-today":"_is-today_1a7wo_92","is-selected-start":"_is-selected-start_1a7wo_97","is-selected-end":"_is-selected-end_1a7wo_105","is-outside":"_is-outside_1a7wo_125","is-focused":"_is-focused_1a7wo_128","is-in-range":"_is-in-range_1a7wo_133","arbo-calendar-actions":"_arbo-calendar-actions_1a7wo_139","arbo-calendar-btn":"_arbo-calendar-btn_1a7wo_147",cancel:"_cancel_1a7wo_156",confirm:"_confirm_1a7wo_161"}}]]),EY=["onClick"],_Y=["variant","onClick"],RY=St(it({__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 s=e,o=Z(()=>{if(s.monthLabels&&s.monthLabels.length===12)return s.monthLabels;const O=s.locale||"en-US",z=s.monthLabelStyle||"short",V=new Intl.DateTimeFormat(O,{month:z,timeZone:"UTC"});return Array.from({length:12},(ee,Q)=>V.format(new Date(Date.UTC(2020,Q,1))))}),i=n,r=$(s.year),a=$(s.month),l=$(s.year);Je(()=>s.year,O=>{O!==r.value&&(r.value=O,l.value=O)}),Je(()=>s.month,O=>{O!==a.value&&(a.value=O)});const c=$("days");function u(O){c.value!==O&&(c.value=O,i("mode-change",O))}const d=Z(()=>s.minYear),h=Z(()=>s.maxYear),f=Z(()=>{const O=s.yearSpan;return l.value-l.value%O}),p=Z(()=>f.value+s.yearSpan-1);function g(){const O=s.yearSpan,z=f.value-O;z>=d.value&&(l.value=z)}function v(){const O=s.yearSpan,z=f.value+O;z<=h.value&&(l.value=z)}const y=Z(()=>f.value-s.yearSpan<d.value),b=Z(()=>p.value+s.yearSpan>h.value),S=Z(()=>{const O=s.yearSpan;return Math.ceil(O/3)});function C(O){const V=f.value+(O-1)*3;return Array.from({length:3},(j,ee)=>V+ee).filter(j=>j<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function R(){c.value==="years"?u("days"):u("years")}function T(O){r.value=O,l.value=O,i("update:year",O),i("year-selected",O),u("months")}function k(O){a.value=O,i("update:month",O),i("month-selected",O),u("days")}function A(){if(c.value==="days"){let O=r.value,z=a.value-1;if(z<1&&(z=12,O--),O<d.value)return;r.value=O,a.value=z,i("update:year",O),i("update:month",z)}else if(c.value==="months"){if(r.value-1<d.value)return;r.value--,i("update:year",r.value)}else c.value==="years"&&g()}function I(){if(c.value==="days"){let O=r.value,z=a.value+1;if(z>12&&(z=1,O++),O>h.value)return;r.value=O,a.value=z,i("update:year",O),i("update:month",z)}else if(c.value==="months"){if(r.value+1>h.value)return;r.value++,i("update:year",r.value)}else c.value==="years"&&v()}const D=Z(()=>c.value==="days"?r.value===d.value&&a.value===1:c.value==="months"?r.value-1<d.value:y.value),x=Z(()=>c.value==="days"?r.value===h.value&&a.value===12:c.value==="months"?r.value+1>h.value:b.value);return t({setNavigation:(O,z)=>{r.value=O,a.value=z}}),(O,z)=>(K(),ie("div",{class:J([O.$style["cal-nav-wrapper"]])},[xt(O.$slots,"selection"),c.value==="days"?(K(),ie("div",{key:0,class:J(O.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[he(ht,{variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:A,"data-index":"prev-btn",onKeydownCapture:Un(Pt(A,["prevent","stop"]),["enter"]),onKeydown:U(Ga)},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),ye("div",{class:J(O.$style["cal-nav-center"])},[he(ht,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:U(Ga)},{default:me(()=>[nt(yt(o.value[a.value-1]),1)]),_:1},8,["onKeydown"]),he(ht,{variant:"secondary",onClick:R,"data-index":"year-btn",onKeydown:U(Ga)},{default:me(()=>[nt(yt(r.value),1)]),_:1},8,["onKeydown"])],2),he(ht,{"data-index":"next-btn",variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:x.value,label:"",onClick:I,onKeydownCapture:Un(Pt(I,["prevent","stop"]),["enter"]),onKeydown:U(Ga)},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ze("",!0),c.value==="years"?(K(),ie("div",{key:1,class:J(O.$style["year-grid"])},[ye("div",{class:J(O.$style["year-grid-header"])},[he(ht,{variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Next",disabled:y.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),ye("div",{class:J(O.$style["range-label"])},yt(f.value)+" - "+yt(p.value),3),he(ht,{variant:"tertiary",class:J([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:b.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:me(({hovered:V})=>[he(at,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),ye("div",{class:J(O.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ie(Tt,null,xn(S.value,V=>(K(),ie("div",{key:"yr-row-"+V,class:J(O.$style["year-grid-row"])},[(K(!0),ie(Tt,null,xn(C(V),j=>(K(),ie("a",{key:j,tabindex:"0",class:J([O.$style["year-cell"],{[O.$style.selected]:j===r.value}]),onClick:ee=>T(j)},yt(j),11,EY))),128))],2))),128))],2)],2)):c.value==="months"?(K(),ie("div",{key:2,class:J(O.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[ye("div",{class:J(O.$style.months)},[(K(!0),ie(Tt,null,xn(o.value,(V,j)=>(K(),ie("a",{tabindex:"0",key:V,variant:j+1===a.value?"primary":"text",class:J([O.$style["month-cell"],{[O.$style.selected]:j+1===a.value}]),onClick:ee=>k(j+1)},yt(V),11,_Y))),128))],2)],2)):(K(),ie("div",{key:3,class:J(O.$style["days-slot"])},[xt(O.$slots,"default",{year:r.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_unh71_1","cal-nav-bar":"_cal-nav-bar_unh71_12","cal-nav-btn":"_cal-nav-btn_unh71_20",prev:"_prev_unh71_33","year-grid-header":"_year-grid-header_unh71_37","cal-nav-center":"_cal-nav-center_unh71_46","cal-nav-label":"_cal-nav-label_unh71_52","month-grid":"_month-grid_unh71_66","year-grid":"_year-grid_unh71_37",months:"_months_unh71_75","month-cell":"_month-cell_unh71_82","year-cell":"_year-cell_unh71_83","pg-btn":"_pg-btn_unh71_105","year-grid-body":"_year-grid-body_unh71_118","year-grid-row":"_year-grid-row_unh71_125",selected:"_selected_unh71_131","days-slot":"_days-slot_unh71_137","range-label":"_range-label_unh71_141"}}]]);function DY(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:s,maxDate:o}=e,i=$(""),r=Z(()=>{const g=mt.fromFormat(i.value,t,{zone:n});return g.isValid?g:null}),a=Z(()=>{if(!s||!r.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const y=new Date(g.year,g.month-1,g.day),b=new Date(v.year,v.month-1,v.day);return y<b?-1:y>b?1:0},c=Z(()=>{if(!o||!r.value)return!0;const g={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<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),u=Z(()=>i.value.length==0||i.value.length>0&&r.value!==null&&a.value&&c.value),d=Z(()=>i.value.length===t.length&&u.value);return{inputValue:i,isValid:u,isComplete:d,clear:()=>{i.value=""},setDate:g=>{let v;g instanceof Date?v=mt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?i.value=v.toFormat(t):i.value=""},getDate:()=>u.value?r.value:null}}const TY={key:0,style:{marginLeft:"8px"}},xY=["disabled","readonly","placeholder"],NA=St(it({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=$(null),a=$(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=DY({format:o.format,allowPastDates:o.allowPastDates,allowFutureDates:o.allowFutureDates,timezone:o.timezone,minDate:o.minDate,maxDate:o.maxDate}),p=Z(()=>o.active),g=Z(()=>({disabled:o.disabled,error:!l.value&&u.value.length>0,readOnly:o.readOnly,isEmpty:u.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:y,isFocus:b}=ms(g),S=k=>{var I;const A=(I=k.clipboardData)==null?void 0:I.getData("text/plain");A&&(u.value=A.trim())},C=k=>{if(k.key==="Escape"){i("blur"),k.target.blur(),k.preventDefault(),k.stopPropagation(),k.stopImmediatePropagation();return}else k.key==="Tab"&&T(k)},E=()=>{d(),i("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var k;return(k=r.value)==null?void 0:k.focus()}}),Je(()=>o.modelValue,k=>{k?h(k):d()},{immediate:!0}),Je([()=>c.value,()=>u.value],()=>{if(u.value.length===0)i("complete",null);else if(l.value&&!o.readOnly&&!o.disabled&&c.value){const k=f();(k||u.value.length===0)&&i("complete",k)}}),Je(()=>l.value,k=>{k||i("invalid","")});const R=Z(()=>!!o.isMultipleDate),T=k=>{k.preventDefault(),k.stopImmediatePropagation(),k.stopPropagation(),i("tab",k)};return(k,A)=>(K(),Ke(vs,Zt(U(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:me(()=>[ye("div",{class:J([k.$style["date-input-wrapper"]])},[R.value?(K(),ie("span",TY," Multiple ")):We((K(),ie("input",{key:1,disabled:o.disabled,readonly:o.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":A[0]||(A[0]=I=>pn(u)?u.value=I:null),onPaste:Pt(S,["prevent"]),placeholder:o.placeholder,class:J([k.$style["date-input"]]),onKeydown:C},null,42,xY)),[[m1,U(u)]]),xt(k.$slots,"clear",{handleClear:E},()=>[(U(u).length>0||R.value)&&!o.readOnly&&!o.disabled&&(U(y)||U(b))?We((K(),Ke(ht,{key:0,variant:["icon","primary"],onClick:Pt(E,["stop"]),size:16,rounded:!0},{default:me(()=>[he(at,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[U(s),"Clear"]]):(K(),Ke(at,{key:1,src:"Calendar",source:"remote",class:J(k.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_1yset_1","icon-calendar":"_icon-calendar_1yset_9",focus:"_focus_1yset_12",hover:"_hover_1yset_12",active:"_active_1yset_12","date-input":"_date-input_1yset_1",invalid:"_invalid_1yset_38"}}]]),IY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:pb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const s=$({case:"",behavior:""}),o=e,i=$(null),r=n,a=async(X,we)=>{r("start-update"),await X(),r("finish-update"),Et(()=>{var ae,Oe;we(),(Oe=(ae=o.params)==null?void 0:ae.api)==null||Oe.stopEditing()})},l=(X,we)=>{X(),Et(()=>{var ae,Oe;we(),(Oe=(ae=o.params)==null?void 0:ae.api)==null||Oe.stopEditing()})},c=()=>{var we;const X=mt.now().setZone(o.timezone);L.value=X.year,te.value=X.month,(we=P.value)==null||we.setNavigation(X.year,X.month)},u=wo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:y,beginInteraction:b,clearStart:S,clearDue:C}=fK(o,r),E=Z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Je(()=>o.multipleStartDates,X=>{h.value=!!X},{immediate:!0}),Je(()=>o.multipleDueDates,X=>{f.value=!!X},{immediate:!0});const R=$(null),T=$(null),k=X=>{X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),G()},A=()=>{var X;(X=T.value)==null||X.focus()},I=X=>{if(!X){u.start=!1,S();return}const we=d.endDate?mt.fromJSDate(d.endDate,{zone:o.timezone}):null;if(we&&D(X,we)>0){const Oe={year:X.year,month:X.month,day:X.day};u.start=!1,y(Oe,!1),p(Oe),Et(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const ae={year:X.year,month:X.month,day:X.day};u.start=!1,y(ae,!0)},D=(X,we)=>{const ae=X.startOf("day"),Oe=we.startOf("day");return ae<Oe?-1:ae>Oe?1:0},x=X=>{var we;X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),(we=document.querySelector('[data-index="prev-btn"]'))==null||we.focus()},O=X=>{if(!X){u.end=!1,C();return}const we=d.startDate?mt.fromJSDate(d.startDate,{zone:o.timezone}):null;if(we&&D(X,we)<0){const Oe={year:X.year,month:X.month,day:X.day};u.end=!1,y(Oe),p(Oe),Et(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const ae={year:X.year,month:X.month,day:X.day};u.end=!1,p(ae)},z=()=>{h.value=!1,S()},V=()=>{f.value=!1,C()},j=()=>{fe()},ee=Z(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){o.disabled||o.readOnly||(b(),d.isSelectingStart=!0,d.isSelectingEnd=!1,Et(()=>{var X;(X=i.value)==null||X.focus()}))}function G(){o.disabled||o.readOnly||(b(),d.isSelectingEnd=!0,d.isSelectingStart=!1,Et(()=>{var X;(X=R.value)==null||X.focus()}))}function fe(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function q(X){X.key==="Escape"?(X.stopPropagation(),fe()):X.key=="Tab"&&r("tab",X)}const P=$(null),L=$(new Date().getFullYear()),te=$(new Date().getMonth()+1);Je(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(L.value=d.startDate.getFullYear(),te.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(L.value=d.endDate.getFullYear(),te.value=d.endDate.getMonth()+1)},{immediate:!0});const de=$(null);function Fe(){if(Array.isArray(o.value)){const[we,ae]=o.value;d.startDate=we||null,d.endDate=ae||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const X=d.startDate||d.endDate||new Date;L.value=X.getFullYear(),te.value=X.getMonth()+1}Je(()=>{var X,we,ae,Oe,H,oe,Ce,Me;return[((ae=(we=(X=o.value)==null?void 0:X[0])==null?void 0:we.getTime)==null?void 0:ae.call(we))||((Oe=o.value)==null?void 0:Oe[0]),((Ce=(oe=(H=o.value)==null?void 0:H[1])==null?void 0:oe.getTime)==null?void 0:Ce.call(oe))||((Me=o.value)==null?void 0:Me[1]),o.timezone,o.format,o.placeholder,o.enableRangeFeedback]},()=>{Fe()},{immediate:!0,deep:!0}),t({resetCalendarLogic:Fe,openStart:Q,openEnd:G,closePicker:fe,clearAll:j,isOpen:ee,drpRef:de,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():G():Q()}});const ce=$(null);return Je(()=>ee.value,X=>{if(o.disabled||o.readOnly)return;const we=ce.value;we&&(X?we.show():we.hide())},{immediate:!0}),(X,we)=>(K(),ie("div",{class:J(X.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:T,onKeydown:q,tabindex:"1","data-index":"calendar-wrapper"},[he(RY,{year:L.value,"onUpdate:year":we[6]||(we[6]=ae=>L.value=ae),month:te.value,"onUpdate:month":we[7]||(we[7]=ae=>te.value=ae),locale:o.locale,disabled:o.disabled,readOnly:o.readOnly,ref_key:"navigationRef",ref:P},{selection:me(()=>[ye("div",{class:J(X.$style["calendar-input-section"])},[he(NA,{ref_key:"starDateRef",ref:i,"model-value":U(d).startDate,placeholder:o.startPlaceholder,timezone:o.timezone,active:U(d).isSelectingStart,onClick:Q,onClear:z,onComplete:I,onInvalid:we[0]||(we[0]=ae=>u.start=!0),disabled:o.disabled,readOnly:o.readOnly,onBlur:A,onTab:k},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),he(NA,{ref_key:"endDateRef",ref:R,"model-value":U(d).endDate,placeholder:o.duePlaceholder,timezone:o.timezone,active:U(d).isSelectingEnd,onClick:G,onClear:V,disabled:o.disabled,onComplete:O,onInvalid:we[1]||(we[1]=ae=>u.end=!0),readOnly:o.readOnly,isMultipleDate:U(f),onTab:x},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:me(({year:ae,month:Oe})=>[he(SY,{disabled:o.disabled,disableConfirm:u.end||u.start,readOnly:o.readOnly,ref_key:"drpRef",ref:de,"tracing-case":s.value,"onUpdate:tracingCase":we[2]||(we[2]=H=>s.value=H),year:ae,month:Oe,"start-date":U(d).startDate,"end-date":U(d).endDate,"active-field":E.value,timezone:o.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:U(y),onSelectEnd:U(p),onGotoToday:c,onConfirm:we[3]||(we[3]=()=>{a(U(v),fe)}),onCancel:we[4]||(we[4]=H=>l(U(g),fe)),onClose:we[5]||(we[5]=H=>a(U(v),fe))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Dm=St(IY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_1wull_1","calendar-input-section":"_calendar-input-section_1wull_11","display-wrapper":"_display-wrapper_1wull_19","calendar-actions":"_calendar-actions_1wull_23","clear-all-btn":"_clear-all-btn_1wull_29"}}]]),FY={ref:"mainRef"},PY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated"],setup(e,{emit:t}){const n=t,s=e,o=Sn("isSelectAll",$(!1)),i=Sn("bulkUpdate",$(!1)),r=Z(()=>!!s.entityId&&i.value&&o.value),{apiServices:a}=Qn(!i.value,s),l=Sn("filterParams",null),c=async k=>{var I,D,x;T.value=!0;let A={workspaceId:s.workspaceId,entityId:s.entityId,itemIds:s.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in k&&(A.startDate=k.start?lm(k.start):null),"end"in k&&(A.dueDate=k.end?lm(k.end):null),r.value?(A.itemIds=void 0,A.entityId=s.entityId):A.entityId=void 0,await((D=(I=a.value)==null?void 0:I.changeDate)==null?void 0:D.call(I,A)),n("updated",{workspaceId:s.workspaceId,itemIds:s.ids,data:A}),(x=y.value)==null||x.resetCalendarLogic()},u=()=>{if(!s.rowSelected||s.rowSelected.length===0){d();return}s.rowSelected.length===1?h():f()},d=()=>{v.value=!1,g.value=!1,R.value=[null,null]},h=()=>{const A=s.rowSelected[0].dateRange;R.value=[(A==null?void 0:A[0])??null,(A==null?void 0:A[1])??null],v.value=!1,g.value=!1},f=()=>{var A,I;if(s.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=p(0),x=p(1);if(g.value=D,v.value=x,D)R.value[0]=null;else{const O=((A=s.rowSelected[0].dateRange)==null?void 0:A[0])??null;R.value[0]=O}if(x)R.value[1]=null;else{const O=((I=s.rowSelected[0].dateRange)==null?void 0:I[1])??null;R.value[1]=O}}else g.value=!1,v.value=!1,R.value=[null,null]},p=k=>{const A=s.rowSelected.map(D=>{var x;return(x=D.dateRange)==null?void 0:x[k]});return A.length===0?!1:new Set(A.map(D=>{var x;return(x=D==null?void 0:D.getTime)==null?void 0:x.call(D)})).size>1},g=$(!1),v=$(!1),y=$(null),{triggerRef:b,popupRef:S,hide:C,isVisible:E}=us({toggleOnClick:!0}),R=$([null,null]);Je([()=>s.ids,()=>s.rowSelected,E],k=>{u(),Et(()=>{var A;(A=y.value)==null||A.focus()})},{immediate:!0,deep:!0});const T=$(!1);return(k,A)=>(K(),ie("div",FY,[ye("div",{ref_key:"triggerRef",ref:b},[he(ht,{variant:s.variant,loading:T.value},{default:me(()=>[he(at,{src:"Calendar"}),A[2]||(A[2]=nt(" Date ",-1))]),_:1},8,["variant","loading"])],512),ye("div",{ref_key:"popupRef",ref:S,style:{display:"none"}},[U(E)?(K(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:R.value,onConfirmed:c,ref_key:"calendarRef",ref:y,onClosed:U(C),onStartUpdate:A[0]||(A[0]=I=>T.value=!0),onFinishUpdate:A[1]||(A[1]=I=>T.value=!1),multipleDueDates:v.value,multipleStartDates:g.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ze("",!0)],512)],512))}}),AY=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"},LA=Zl("metricStore",()=>{const e=$();return{metricList:e,setMetricList:s=>{e.value=s},checkEditType:s=>{var o;if(((o=s==null?void 0:s.auth_permission)==null?void 0:o.permission)==2)return AY(s)}}}),kY=["onKeydown"],OY=["width","height","viewBox"],MY=["d"],NY="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",VA=it({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(s.modelValue??0),r=$(null),a=Z(()=>{var D;return((D=s.params)==null?void 0:D.size)??24}),l=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconPath)??NY}),u=Z(()=>{var D;return((D=s.params)==null?void 0:D.wrapperTag)??"span"}),d=Z(()=>{var D;return s.disabled||((D=s.params)==null?void 0:D.disabled)||!1}),h=Z(()=>{var D;return s.readOnly||((D=s.params)==null?void 0:D.readOnly)||!1}),f=Z(()=>!d.value&&!h.value),p=Z(()=>d.value?"not-allowed":h.value?"default":"pointer");Je(()=>s.modelValue,D=>{typeof D=="number"&&D!==i.value&&(i.value=D)});const g=D=>{var x;return((x=s.params)==null?void 0:x.maxRating)-D+1<=i.value&&!v.value},v=$(!1),y=()=>{v.value=!0},b=()=>{v.value=!1},S=D=>{f.value&&C(D)},C=D=>{var O,z;if(!f.value)return;let x=((O=s.params)==null?void 0:O.maxRating)-D+1;x===i.value&&(x=0),i.value=x,o("update:modelValue",x),o("update",x),o("change",x),(z=s.params)!=null&&z.onUpdate&&s.params.onUpdate(x)},E=D=>{var x;D!==i.value&&(i.value=D,o("update:modelValue",D),o("update",D),o("change",D),(x=s.params)!=null&&x.onUpdate&&s.params.onUpdate(D),R.value=D)},R=$(i.value),T=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),i.value=R.value,o("cancel")},k=D=>{D.preventDefault(),E(i.value),o("handleEnter",i.value)},A=()=>{f.value&&(i.value=Math.min(i.value+1%(s.params.maxRating+1),s.params.maxRating),E(i.value))},I=()=>{f.value&&(i.value=Math.max(i.value-1,0),E(i.value))};return t({focus:()=>{var D;(D=r.value)==null||D.focus()}}),(D,x)=>(K(),ie("div",{class:J(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:r,tabindex:"1",onKeydown:[Un(Pt(I,["prevent"]),["left"]),Un(Pt(A,["prevent"]),["right"]),Un(Pt(I,["prevent"]),["down"]),Un(Pt(A,["prevent"]),["up"]),Un(Pt(k,["prevent"]),["enter"]),Un(Pt(k,["prevent"]),["tab"]),Un(Pt(T,["prevent"]),["escape"])]},[(K(!0),ie(Tt,null,xn(e.params.maxRating,O=>(K(),Ke(ZR(u.value),{key:O,class:J(["rating-item",{filled:g(O),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-O,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(O),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-O+1,tabindex:-1,onClick:Pt(z=>S(O),["prevent","stop"]),onMouseenter:y,onMouseleave:b},{default:me(()=>[xt(D.$slots,"icon",{index:O,filled:g(O),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:O},()=>[(K(),ie("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[ye("path",{d:c.value},null,8,MY)],8,OY))]),xt(D.$slots,"overlay",{index:O,filled:g(O),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,kY))}}),LY={style:{maxWidth:"180px",lineHeight:"15px"}},VY=["innerHTML"],BA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=()=>{i("handleCancel")},a=()=>{i("close")},l=v=>{var y;if(v.format_type==="dropdown"&&v.format_value)try{const b=JSON.parse(v.format_value);if(Array.isArray(b)){const S=b.map(C=>({label:C.name,value:C.name,id:C.name}));return S.unshift({label:"-",value:void 0,id:"-"}),S}}catch(b){console.error("Failed to parse dropdown options",b)}if(v.format_type=="number"&&v.restricted_type=="exact"){const b=((y=v.restricted_value)==null?void 0:y.split(",").map(S=>({label:v.mapping[`!${S}`]||S,value:S,id:S})))||[];return b.unshift({label:"-",value:void 0,id:"-"}),b}return[]},c=Z(()=>l(o.config)),u=$(o.modelValue),d=v=>{u.value=v,i("update:modelValue",v),i("change",v||null)},h=$(c.value),f=$(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(y=>y.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=$(null);return qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,y)=>(K(),Ke(Xr,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:y[0]||(y[0]=b=>d(b.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:r},{item:me(({item:b,getHighlightedLabel:S,selectedIndex:C,index:E})=>[he(Ha,{hover:C==E,selected:b.value===e.modelValue,label:b.label,onSelect:R=>d(b.value||null),onClick:R=>d(b.value||null)},{label:me(()=>[ye("div",LY,[We(ye("span",{innerHTML:S(b.label)},null,8,VY),[[U(s),{content:b.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":me(()=>[...y[1]||(y[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),BY={class:"metric-input-wrapper"},$Y={key:0,class:"error-text input-2"},$A=it({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=$(o.modelValue),r=$(o.modelValue),a=$(!1),l=$(!0),c=$(""),u=Z(()=>{var V;const z=Number.parseInt(String((V=o.config)==null?void 0:V.format_value)||"2",10);return Number.isFinite(z)&&z>=0?z:2}),d=z=>{if(!z)return z;const V=String(z).split(".");return V.length>1&&V[1].length>u.value?u.value===0?V[0]:`${V[0]}.${V[1].slice(0,u.value)}`:String(z)},h=z=>{const V=d(z);V!==z&&S.value?i.value=V:i.value=z},f=z=>{const V=z.target;if(!V)return;const j=V.value||"",ee=j.indexOf(".");if(z.key==="."&&u.value===0){z.preventDefault();return}ee!==-1&&/[0-9]/.test(z.key)&&j.slice(ee+1).length>=u.value&&z.preventDefault()},p=Z(()=>l.value||o.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var q;const z=o.config.restricted_type.trim(),V=((q=o.config.restricted_value)==null?void 0:q.split(",").map(Number))||[],[j,ee]=V,G={range:`Enter a value between ${j} and ${ee}`,not:`These values are not allowed: ${V.join(", ")}`,exact:"Value is not allowed"}[z];return l.value?"":G},v=Z(()=>{var V;let z="";return Number((V=o.config)==null?void 0:V.format_value)&&(z+="."+Array.from({length:Number(o.config.format_value)}).map(()=>"0").join("")),`0${z}`});Je(()=>o.modelValue,z=>{i.value=z,r.value=z});const y=z=>im(o.config,z),b=n,S=$(null),C=z=>{const V=z===""?null:z,j=r.value===""?null:r.value;return V!==j},E=z=>{const V=d(z);if(!C(V))return!1;const j=V===""?null:V;return i.value=j,r.value=j,b("update:modelValue",j),b("handleChange",j),!0},R=()=>{i.value=r.value,b("update:modelValue",r.value)},T=(z,V)=>{E(z),b("enter")},k=(z,V)=>{if(a.value){a.value=!1;return}o.saveOnBlur?E(z):R()},A=z=>{if(z===null||z===""){l.value=!0;return}l.value=im(o.config,Number(z)),c.value=l.value?"":g()},I=(z,V)=>{a.value=!0,o.saveOnEscape?E(z):R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},D=z=>{A(z),b("onValidation",z)},x=()=>{a.value=!0,R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},O=()=>{var z;i.value=null,r.value=null,b("update:modelValue",null),b("handleChange",null),(z=S.value)==null||z.focus()};return t({focus:()=>{var z;return(z=S.value)==null?void 0:z.focus()},blur:()=>{var z;return(z=S.value)==null?void 0:z.blur()},getValue:()=>i.value,getCachedValue:()=>r.value,save:()=>E(i.value),revert:R}),qt(()=>{var z;(z=S.value)==null||z.focus()}),(z,V)=>We((K(),ie("div",BY,[he(Yb,{maxDecimalChar:u.value,modelValue:i.value,"onUpdate:modelValue":V[0]||(V[0]=j=>i.value=j),placeholder:v.value,validatorFnc:y,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:T,onBlur:k,onClear:O,onEscape:I,onCancel:x,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:S},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ie("span",$Y,yt(c.value),1)):Ze("",!0)])),[[U(s),p.value]])}}),HY={key:2},GY={class:"wrapper-suffix"},UY={key:3},WY=St(it({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=$(null),r=$(0),a=$(null),l=$(null),c=Z(()=>xF(o.config)),u=$(!1),d=Z(()=>!!de.value),h=n,f=()=>{u.value=!1,te(),h("cancel")},p=$(!0),g=ce=>{if(ce===null||ce===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=im(o.config,Number(ce)),y.value=b()},v=()=>{u.value=!0,ee()},y=$(""),b=()=>{var Ce;const ce=o.config.restricted_type.trim(),X=((Ce=o.config.restricted_value)==null?void 0:Ce.split(",").map(Number))||[],[we,ae]=X,H={range:`Enter a value between ${we} and ${ae}`,not:`These values are not allowed: ${X.join(", ")}`,exact:"Value is not allowed"}[ce];return p.value?"":H},S=Z(()=>{var X;const ce=Number.parseInt(String((X=o.config)==null?void 0:X.format_value)||"2",10);return Number.isFinite(ce)&&ce>=0?ce:2}),C=ce=>{u.value=!0,i.value=ce},E=()=>{u.value=!0,te(),ee()},R=ce=>{r.value=ce,u.value=!0,ee()},T=()=>(o.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(X=>X.charAt(0).toUpperCase()+X.slice(1)).join("").replace(/Outline|Solid/g,""),k=$(null),A=$(!0),I=Z(()=>{var ce;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((ce=i.value)==null?void 0:ce.length)===0,wrapperRef:P,active:d,focus:o.focus,bordered:!0}}),D=$(null),x=Z(()=>A.value),O=Z(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:r.value===0,wrapperRef:D,active:x,focus:A.value,bordered:!0})),{argsMain:z}=ms(O),{argsMain:V}=ms(I),j=$(null),ee=()=>{Et(()=>{var ce;(ce=j.value)==null||ce.focus()})},Q=ce=>{var X;if(ce.format_type==="dropdown"&&ce.format_value)try{const we=JSON.parse(ce.format_value);if(Array.isArray(we))return we.map(ae=>({label:ae.name,value:ae.name,id:ae.name}))}catch(we){console.error("Failed to parse dropdown options",we)}return ce.format_type=="number"&&ce.restricted_type=="exact"?((X=ce.restricted_value)==null?void 0:X.split(",").map(ae=>({label:ce.mapping[`!${ae}`]||ae,value:ae,id:ae})))||[]:[]},G=Z(()=>Q(o.config)),fe=Z(()=>{var ce;return((ce=G.value.find(X=>X.value===i.value))==null?void 0:ce.label)||i.value||"-"}),q=()=>{var ce;if(c.value=="rating")h("updateMetric",r.value==0?null:r.value);else if(c.value=="number"){const X=(ce=l.value)==null?void 0:ce.getValue();h("updateMetric",X||null)}else h("updateMetric",i.value||null);u.value=!1,te()},{triggerRef:P,popupRef:L,hide:te,isVisible:de,show:Fe}=us({toggleOnClick:!0,appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),pe=()=>{switch(c.value){case"number":Et(()=>{var ce;(ce=l.value)==null||ce.focus()});break;case"dropdown":Fe(),Et(()=>{var ce;(ce=k.value)==null||ce.focus()});break;case"rating":A.value=!0,Et(()=>{var ce;(ce=a.value)==null||ce.focus()});break}};return t({resetState:()=>{i.value=null,r.value=0,u.value=!1},focus:pe,hasChanges:()=>u.value}),qt(()=>{Et(()=>{setTimeout(()=>{pe()},300)})}),(ce,X)=>(K(),ie("div",{class:J(ce.$style["metric-editor"])},[c.value=="number"?(K(),Ke($A,{key:0,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[0]||(X[0]=we=>i.value=we),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:S.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(K(),Ke(vs,Zt({key:1,"tab-index":1},U(z),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:me(()=>[he(VA,{params:{maxRating:o.config.range},modelValue:r.value,"onUpdate:modelValue":X[1]||(X[1]=we=>r.value=we),onHandleEnter:R,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:me(()=>[he(at,{source:"rating",src:T()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(K(),ie("div",HY,[he(vs,Zt(U(V),{ref_key:"triggerRef",ref:P,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:me(({})=>[ye("div",GY,[he(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:me(()=>[We((K(),ie("span",null,[nt(yt(fe.value||""),1)])),[[U(s),{content:fe.value}]])]),_:1},16),ye("div",{ref_key:"popupRef",ref:L},[U(de)?(K(),Ke(BA,{key:0,ref_key:"metricEditorDropdownRef",ref:k,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[2]||(X[2]=we=>i.value=we),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ze("",!0)],512)])):(K(),ie("span",UY,"Formular")),We((K(),Ke(ht,{ref_key:"confirmButtonRef",ref:j,onHandleClick:q,"tab-index":"1",onKeypress:[Un(Pt(pe,["shift","prevent"]),["tab"]),Un(Pt(f,["prevent"]),["escape"])],disabled:!p.value},{default:me(()=>[he(at,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[U(s),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),zY=St(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=$(!1),a=$(null),l=$(null),c=()=>{r.value=!r.value},u=()=>{var g;r.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;r.value=!0,await Et(),(g=l.value)==null||g.focus()},h=g=>{i("handleUpdate",{id:o.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),i("loseFocus")},p=g=>{const y={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),i("focusOnSearch",g)},Tab:()=>{r.value&&u()},Enter:()=>{r.value||d()},ArrowDown:()=>{i("openSibling","down")},ArrowUp:()=>{i("openSibling","up")}}[g.key];y&&y()};return Je(r,g=>{g&&i("open")}),t({hide:u,show:d}),(g,v)=>(K(),ie("div",{class:J([g.$style["metric-item"],r.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[ye("div",{class:J(g.$style["metric-label"]),onClick:Pt(c,["stop"])},[xt(g.$slots,"default",{open:r.value},()=>[We((K(),ie("span",{class:J(g.$style["metric-name"])},[nt(yt(e.label),1)],2)),[[U(s),{content:e.label}]]),e.morpheme&&r.value?(K(),ie("small",{key:0,class:J(g.$style["metric-morpheme"])}," ("+yt(e.morpheme)+") ",3)):Ze("",!0)])],2),he(zD,{mode:"out-in",name:"slide"},{default:me(()=>[r.value?(K(),Ke(WY,{key:`editor-${e.config.id}`,"read-only":!1,focus:r.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Ze("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var Tu=(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))(Tu||{});function HA(e,t){return function(){return e.apply(t,arguments)}}const{toString:jY}=Object.prototype,{getPrototypeOf:Xb}=Object,{iterator:Tm,toStringTag:GA}=Symbol,xm=(e=>t=>{const n=jY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Pi=e=>(e=e.toLowerCase(),t=>xm(t)===e),Im=e=>t=>typeof t===e,{isArray:xu}=Array,Iu=Im("undefined");function Xh(e){return e!==null&&!Iu(e)&&e.constructor!==null&&!Iu(e.constructor)&&lo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const UA=Pi("ArrayBuffer");function KY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&UA(e.buffer),t}const qY=Im("string"),lo=Im("function"),WA=Im("number"),Jh=e=>e!==null&&typeof e=="object",YY=e=>e===!0||e===!1,Fm=e=>{if(xm(e)!=="object")return!1;const t=Xb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(GA in e)&&!(Tm in e)},ZY=e=>{if(!Jh(e)||Xh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},XY=Pi("Date"),JY=Pi("File"),QY=Pi("Blob"),eZ=Pi("FileList"),tZ=e=>Jh(e)&&lo(e.pipe),nZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||lo(e.append)&&((t=xm(e))==="formdata"||t==="object"&&lo(e.toString)&&e.toString()==="[object FormData]"))},sZ=Pi("URLSearchParams"),[oZ,iZ,rZ,aZ]=["ReadableStream","Request","Response","Headers"].map(Pi),lZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,o;if(typeof e!="object"&&(e=[e]),xu(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{if(Xh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),r=i.length;let a;for(s=0;s<r;s++)a=i[s],t.call(null,e[a],a,e)}}function zA(e,t){if(Xh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,o;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const Jl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jA=e=>!Iu(e)&&e!==Jl;function Jb(){const{caseless:e,skipUndefined:t}=jA(this)&&this||{},n={},s=(o,i)=>{const r=e&&zA(n,i)||i;Fm(n[r])&&Fm(o)?n[r]=Jb(n[r],o):Fm(o)?n[r]=Jb({},o):xu(o)?n[r]=o.slice():(!t||!Iu(o))&&(n[r]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Qh(arguments[o],s);return n}const cZ=(e,t,n,{allOwnKeys:s}={})=>(Qh(t,(o,i)=>{n&&lo(o)?e[i]=HA(o,n):e[i]=o},{allOwnKeys:s}),e),uZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dZ=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hZ=(e,t,n,s)=>{let o,i,r;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)r=o[i],(!s||s(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&Xb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},fZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},pZ=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!WA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},gZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xb(Uint8Array)),mZ=(e,t)=>{const s=(e&&e[Tm]).call(e);let o;for(;(o=s.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},vZ=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},yZ=Pi("HTMLFormElement"),wZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,o){return s.toUpperCase()+o}),KA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),CZ=Pi("RegExp"),qA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Qh(n,(o,i)=>{let r;(r=t(o,i,e))!==!1&&(s[i]=r||o)}),Object.defineProperties(e,s)},bZ=e=>{qA(e,(t,n)=>{if(lo(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(lo(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},SZ=(e,t)=>{const n={},s=o=>{o.forEach(i=>{n[i]=!0})};return xu(e)?s(e):s(String(e).split(t)),n},EZ=()=>{},_Z=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function RZ(e){return!!(e&&lo(e.append)&&e[GA]==="FormData"&&e[Tm])}const DZ=e=>{const t=new Array(10),n=(s,o)=>{if(Jh(s)){if(t.indexOf(s)>=0)return;if(Xh(s))return s;if(!("toJSON"in s)){t[o]=s;const i=xu(s)?[]:{};return Qh(s,(r,a)=>{const l=n(r,o+1);!Iu(l)&&(i[a]=l)}),t[o]=void 0,i}}return s};return n(e,0)},TZ=Pi("AsyncFunction"),xZ=e=>e&&(Jh(e)||lo(e))&&lo(e.then)&&lo(e.catch),YA=((e,t)=>e?setImmediate:t?((n,s)=>(Jl.addEventListener("message",({source:o,data:i})=>{o===Jl&&i===n&&s.length&&s.shift()()},!1),o=>{s.push(o),Jl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",lo(Jl.postMessage)),IZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Jl):typeof Y<"u"&&Y.nextTick||YA,Be={isArray:xu,isArrayBuffer:UA,isBuffer:Xh,isFormData:nZ,isArrayBufferView:KY,isString:qY,isNumber:WA,isBoolean:YY,isObject:Jh,isPlainObject:Fm,isEmptyObject:ZY,isReadableStream:oZ,isRequest:iZ,isResponse:rZ,isHeaders:aZ,isUndefined:Iu,isDate:XY,isFile:JY,isBlob:QY,isRegExp:CZ,isFunction:lo,isStream:tZ,isURLSearchParams:sZ,isTypedArray:gZ,isFileList:eZ,forEach:Qh,merge:Jb,extend:cZ,trim:lZ,stripBOM:uZ,inherits:dZ,toFlatObject:hZ,kindOf:xm,kindOfTest:Pi,endsWith:fZ,toArray:pZ,forEachEntry:mZ,matchAll:vZ,isHTMLForm:yZ,hasOwnProperty:KA,hasOwnProp:KA,reduceDescriptors:qA,freezeMethods:bZ,toObjectSet:SZ,toCamelCase:wZ,noop:EZ,toFiniteNumber:_Z,findKey:zA,global:Jl,isContextDefined:jA,isSpecCompliantForm:RZ,toJSONObject:DZ,isAsyncFn:TZ,isThenable:xZ,setImmediate:YA,asap:IZ,isIterable:e=>e!=null&&lo(e[Tm])};function zt(e,t,n,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}Be.inherits(zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const ZA=zt.prototype,XA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{XA[e]={value:e}}),Object.defineProperties(zt,XA),Object.defineProperty(ZA,"isAxiosError",{value:!0}),zt.from=(e,t,n,s,o,i)=>{const r=Object.create(ZA);Be.toFlatObject(e,r,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return zt.call(r,a,l,n,s,o),e&&r.cause==null&&Object.defineProperty(r,"cause",{value:e,configurable:!0}),r.name=e&&e.name||"Error",i&&Object.assign(r,i),r};const FZ=null;function Qb(e){return Be.isPlainObject(e)||Be.isArray(e)}function JA(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function QA(e,t,n){return e?e.concat(t).map(function(o,i){return o=JA(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function PZ(e){return Be.isArray(e)&&!e.some(Qb)}const AZ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Pm(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const s=n.metaTokens,o=n.visitor||u,i=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new zt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,v){let y=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&PZ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(y=Be.toArray(p)))return g=JA(g),y.forEach(function(S,C){!(Be.isUndefined(S)||S===null)&&t.append(r===!0?QA([g],C,i):r===null?g:g+"[]",c(S))}),!1}return Qb(p)?!0:(t.append(QA(v,g,i),c(p)),!1)}const d=[],h=Object.assign(AZ,{defaultVisitor:u,convertValue:c,isVisitable:Qb});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(y,b){(!(Be.isUndefined(y)||y===null)&&o.call(t,y,Be.isString(b)?b.trim():b,g,h))===!0&&f(y,g?g.concat(b):[b])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function ek(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function eS(e,t){this._pairs=[],e&&Pm(e,this,t)}const tk=eS.prototype;tk.append=function(t,n){this._pairs.push([t,n])},tk.toString=function(t){const n=t?function(s){return t.call(this,s,ek)}:ek;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function kZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nk(e,t,n){if(!t)return e;const s=n&&n.encode||kZ;Be.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=Be.isURLSearchParams(t)?t.toString():new eS(t,n).toString(s),i){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class sk{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(s){s!==null&&t(s)})}}const ok={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},OZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:eS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tS=typeof window<"u"&&typeof document<"u",nS=typeof navigator=="object"&&navigator||void 0,MZ=tS&&(!nS||["ReactNative","NativeScript","NS"].indexOf(nS.product)<0),NZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LZ=tS&&window.location.href||"http://localhost",Bs={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tS,hasStandardBrowserEnv:MZ,hasStandardBrowserWebWorkerEnv:NZ,navigator:nS,origin:LZ},Symbol.toStringTag,{value:"Module"})),...OZ};function VZ(e,t){return Pm(e,new Bs.classes.URLSearchParams,{visitor:function(n,s,o,i){return Bs.isNode&&Be.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function BZ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $Z(e){const t={},n=Object.keys(e);let s;const o=n.length;let i;for(s=0;s<o;s++)i=n[s],t[i]=e[i];return t}function ik(e){function t(n,s,o,i){let r=n[i++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=i>=n.length;return r=!r&&Be.isArray(o)?o.length:r,l?(Be.hasOwnProp(o,r)?o[r]=[o[r],s]:o[r]=s,!a):((!o[r]||!Be.isObject(o[r]))&&(o[r]=[]),t(n,s,o[r],i)&&Be.isArray(o[r])&&(o[r]=$Z(o[r])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(s,o)=>{t(BZ(s),o,n,0)}),n}return null}function HZ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const ef={transitional:ok,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",o=s.indexOf("application/json")>-1,i=Be.isObject(t);if(i&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return o?JSON.stringify(ik(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return VZ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Pm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),HZ(t)):t}],transformResponse:[function(t){const n=this.transitional||ef.transitional,s=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(s&&!this.responseType||o)){const r=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(r)throw a.name==="SyntaxError"?zt.from(a,zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bs.classes.FormData,Blob:Bs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{ef.headers[e]={}});const GZ=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UZ=e=>{const t={};let n,s,o;return e&&e.split(`
140
142
  `).forEach(function(r){o=r.indexOf(":"),n=r.substring(0,o).trim().toLowerCase(),s=r.substring(o+1).trim(),!(!n||t[n]&&GZ[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},rk=Symbol("internals");function tf(e){return e&&String(e).trim().toLowerCase()}function Am(e){return e===!1||e==null?e:Be.isArray(e)?e.map(Am):String(e)}function WZ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const zZ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sS(e,t,n,s,o){if(Be.isFunction(s))return s.call(this,t,n);if(o&&(t=n),!!Be.isString(t)){if(Be.isString(s))return t.indexOf(s)!==-1;if(Be.isRegExp(s))return s.test(t)}}function jZ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function KZ(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(o,i,r){return this[s].call(this,t,o,i,r)},configurable:!0})})}let co=class{constructor(t){t&&this.set(t)}set(t,n,s){const o=this;function i(a,l,c){const u=tf(l);if(!u)throw new Error("header name must be a non-empty string");const d=Be.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=Am(a))}const r=(a,l)=>Be.forEach(a,(c,u)=>i(c,u,l));if(Be.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(Be.isString(t)&&(t=t.trim())&&!zZ(t))r(UZ(t),n);else if(Be.isObject(t)&&Be.isIterable(t)){let a={},l,c;for(const u of t){if(!Be.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?Be.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}r(a,n)}else t!=null&&i(n,t,s);return this}get(t,n){if(t=tf(t),t){const s=Be.findKey(this,t);if(s){const o=this[s];if(!n)return o;if(n===!0)return WZ(o);if(Be.isFunction(n))return n.call(this,o,s);if(Be.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=tf(t),t){const s=Be.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||sS(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let o=!1;function i(r){if(r=tf(r),r){const a=Be.findKey(s,r);a&&(!n||sS(s,s[a],a,n))&&(delete s[a],o=!0)}}return Be.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let s=n.length,o=!1;for(;s--;){const i=n[s];(!t||sS(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,s={};return Be.forEach(this,(o,i)=>{const r=Be.findKey(s,i);if(r){n[r]=Am(o),delete n[i];return}const a=t?jZ(i):String(i).trim();a!==i&&delete n[i],n[a]=Am(o),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(s,o)=>{s!=null&&s!==!1&&(n[o]=t&&Be.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
141
143
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[rk]=this[rk]={accessors:{}}).accessors,o=this.prototype;function i(r){const a=tf(r);s[a]||(KZ(o,r),s[a]=!0)}return Be.isArray(t)?t.forEach(i):i(t),this}};co.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(co.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),Be.freezeMethods(co);function oS(e,t){const n=this||ef,s=t||n,o=co.from(s.headers);let i=s.data;return Be.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ak(e){return!!(e&&e.__CANCEL__)}function Fu(e,t,n){zt.call(this,e??"canceled",zt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Fu,zt,{__CANCEL__:!0});function lk(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new zt("Request failed with status code "+n.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function qZ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function YZ(e,t){e=e||10;const n=new Array(e),s=new Array(e);let o=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=s[i];r||(r=c),n[o]=l,s[o]=c;let d=i,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-r<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function ZZ(e,t){let n=0,s=1e3/t,o,i;const r=(c,u=Date.now())=>{n=u,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=s?r(c,u):(o=c,i||(i=setTimeout(()=>{i=null,r(o)},s-d)))},()=>o&&r(o)]}const km=(e,t,n=3)=>{let s=0;const o=YZ(50,250);return ZZ(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-s,c=o(l),u=r<=a;s=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-r)/c:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},ck=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},uk=e=>(...t)=>Be.asap(()=>e(...t)),XZ=Bs.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Bs.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Bs.origin),Bs.navigator&&/(msie|trident)/i.test(Bs.navigator.userAgent)):()=>!0,JZ=Bs.hasStandardBrowserEnv?{write(e,t,n,s,o,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(s)&&a.push(`path=${s}`),Be.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),Be.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function QZ(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dk(e,t,n){let s=!QZ(t);return e&&(s||n==!1)?eX(e,t):t}const hk=e=>e instanceof co?{...e}:e;function Ql(e,t){t=t||{};const n={};function s(c,u,d,h){return Be.isPlainObject(c)&&Be.isPlainObject(u)?Be.merge.call({caseless:h},c,u):Be.isPlainObject(u)?Be.merge({},u):Be.isArray(u)?u.slice():u}function o(c,u,d,h){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return s(void 0,c,d,h)}else return s(c,u,d,h)}function i(c,u){if(!Be.isUndefined(u))return s(void 0,u)}function r(c,u){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return s(void 0,c)}else return s(void 0,u)}function a(c,u,d){if(d in t)return s(c,u);if(d in e)return s(void 0,c)}const l={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,u,d)=>o(hk(c),hk(u),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||o,h=d(e[u],t[u],u);Be.isUndefined(h)&&d!==a||(n[u]=h)}),n}const fk=e=>{const t=Ql({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=co.from(r),t.url=nk(dk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(Bs.hasStandardBrowserEnv||Bs.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&r.set(u,d)})}}if(Bs.hasStandardBrowserEnv&&(s&&Be.isFunction(s)&&(s=s(t)),s||s!==!1&&XZ(t.url))){const l=o&&i&&JZ.read(i);l&&r.set(o,l)}return t},tX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const o=fk(e);let i=o.data;const r=co.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,f,p;function g(){f&&f(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function y(){if(!v)return;const S=co.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};lk(function(T){n(T),g()},function(T){s(T),g()},E),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(y)},v.onabort=function(){v&&(s(new zt("Request aborted",zt.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const E=C&&C.message?C.message:"Network Error",R=new zt(E,zt.ERR_NETWORK,e,v);R.event=C||null,s(R),v=null},v.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const E=o.transitional||ok;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),s(new zt(C,E.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Be.forEach(r.toJSON(),function(C,E){v.setRequestHeader(E,C)}),Be.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),c&&([h,p]=km(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=km(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(o.cancelToken||o.signal)&&(u=S=>{v&&(s(!S||S.type?new Fu(null,e,v):S),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const b=qZ(o.url);if(b&&Bs.protocols.indexOf(b)===-1){s(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,e));return}v.send(i||null)})},nX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,o;const i=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;s.abort(u instanceof zt?u:new Fu(u instanceof Error?u.message:u))}};let r=t&&setTimeout(()=>{r=null,i(new zt(`timeout ${t} of ms exceeded`,zt.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>Be.asap(a),l}},sX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,o;for(;s<n;)o=s+t,yield e.slice(s,o),s=o},oX=async function*(e,t){for await(const n of iX(e))yield*sX(n,t)},iX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},pk=(e,t,n,s)=>{const o=oX(e,t);let i=0,r,a=l=>{r||(r=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},gk=64*1024,{isFunction:Om}=Be,rX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:mk,TextEncoder:vk}=Be.global,yk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aX=e=>{e=Be.merge.call({skipUndefined:!0},rX,e);const{fetch:t,Request:n,Response:s}=e,o=t?Om(t):typeof fetch=="function",i=Om(n),r=Om(s);if(!o)return!1;const a=o&&Om(mk),l=o&&(typeof vk=="function"?(p=>g=>p.encode(g))(new vk):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=i&&a&&yk(()=>{let p=!1;const g=new n(Bs.origin,{body:new mk,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=r&&a&&yk(()=>Be.isReadableStream(new s("").body)),d={stream:u&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let y=g&&g[p];if(y)return y.call(g);throw new zt(`Response type '${p}' is not supported`,zt.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Be.isBlob(p))return p.size;if(Be.isSpecCompliantForm(p))return(await new n(Bs.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Be.isArrayBufferView(p)||Be.isArrayBuffer(p))return p.byteLength;if(Be.isURLSearchParams(p)&&(p=p+""),Be.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Be.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:y,signal:b,cancelToken:S,timeout:C,onDownloadProgress:E,onUploadProgress:R,responseType:T,headers:k,withCredentials:A="same-origin",fetchOptions:I}=fk(p),D=t||fetch;T=T?(T+"").toLowerCase():"text";let x=nX([b,S&&S.toAbortSignal()],C),O=null;const z=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let V;try{if(R&&c&&v!=="get"&&v!=="head"&&(V=await f(k,y))!==0){let q=new n(g,{method:"POST",body:y,duplex:"half"}),P;if(Be.isFormData(y)&&(P=q.headers.get("content-type"))&&k.setContentType(P),q.body){const[L,te]=ck(V,km(uk(R)));y=pk(q.body,gk,L,te)}}Be.isString(A)||(A=A?"include":"omit");const j=i&&"credentials"in n.prototype,ee={...I,signal:x,method:v.toUpperCase(),headers:k.normalize().toJSON(),body:y,duplex:"half",credentials:j?A:void 0};O=i&&new n(g,ee);let Q=await(i?D(O,I):D(g,ee));const G=u&&(T==="stream"||T==="response");if(u&&(E||G&&z)){const q={};["status","statusText","headers"].forEach(de=>{q[de]=Q[de]});const P=Be.toFiniteNumber(Q.headers.get("content-length")),[L,te]=E&&ck(P,km(uk(E),!0))||[];Q=new s(pk(Q.body,gk,L,()=>{te&&te(),z&&z()}),q)}T=T||"text";let fe=await d[Be.findKey(d,T)||"text"](Q,p);return!G&&z&&z(),await new Promise((q,P)=>{lk(q,P,{data:fe,headers:co.from(Q.headers),status:Q.status,statusText:Q.statusText,config:p,request:O})})}catch(j){throw z&&z(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new zt("Network Error",zt.ERR_NETWORK,p,O),{cause:j.cause||j}):zt.from(j,j&&j.code,p,O)}}},lX=new Map,wk=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:o}=t,i=[s,o,n];let r=i.length,a=r,l,c,u=lX;for(;a--;)l=i[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:aX(t)),u=c;return c};wk();const iS={http:FZ,xhr:tX,fetch:{get:wk}};Be.forEach(iS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ck=e=>`- ${e}`,cX=e=>Be.isFunction(e)||e===null||e===!1;function uX(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let s,o;const i={};for(let r=0;r<n;r++){s=e[r];let a;if(o=s,!cX(s)&&(o=iS[(a=String(s)).toLowerCase()],o===void 0))throw new zt(`Unknown adapter '${a}'`);if(o&&(Be.isFunction(o)||(o=o.get(t))))break;i[a||"#"+r]=o}if(!o){const r=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
142
144
  `+r.map(Ck).join(`
@@ -247,4 +249,4 @@ See ${RN(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var Mpe={1:"Charting A
247
249
  If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),Bf(u)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);Bf(`to see all the valid ${s} properties please check: ${l}`)}}};function nge(e,t,n){const s={},o=e.filter(i=>!t.some(r=>r===i));if(o.length>0)for(const i of o)s[i]=Z0({inputValue:i,allSuggestions:n}).values;return s}var sge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),oge={moduleName:"Validation",version:lt,beans:[tge]};function _2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var ige=class extends Ge{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,_2(s)};if(this.doingTreeDataFiltering()){const s=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(i.childrenAfterGroup[a],c):n(l,c)}n(i,r)},o=i=>s(i,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},rge=class extends DE{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const i=jf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return It(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=li("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new fd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();Ju(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Hn(t)===this.eGui)return;const o=yc(t,this.eGui,null,e.shiftKey);if(o){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case ke.UP:case ke.DOWN:case ke.LEFT:case ke.RIGHT:if(t)return;bc(e);case ke.ENTER:t&&vc(this.eGui)&&e.preventDefault();break;case ke.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&uc(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,i=!!(o&&o.key===ke.TAB);if(o&&i){const r=o.shiftKey;vc(this.eGui,r)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new RE(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!No(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(s.get("enableFilterHandlers")){const u=i;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(i==null?void 0:i.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,i=this.comp.getFloatingFilterComp();!i||!o?this.updateCompDetails(e,o,n):i.then(r=>{!r||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var i;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:_s(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function age(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function lge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var cge={moduleName:"SharedMenu",version:lt,beans:[Cle],apiFunctions:{showColumnMenu:age,hidePopupMenu:lge}},uge=class extends Hre{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-i.top,0),c=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${c}px`,r=!0);const d=i.right-i.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-i.left-2}function p(){return o.left-i.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ha(e)}},gy={moduleName:"Popup",version:lt,beans:[uge]},dge=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function hge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function fge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function pge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function gge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function mge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function vge(e,t,n){const{gos:s,colModel:o,colFilter:i}=e;n&&!s.get("enableFilterHandlers")&&(qe(288),n=!1);const r=o.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function yge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function wge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Cge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function bge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function Sge(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){qe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(s==null||s.updateModel(a,r))}else s==null||s.updateAllModels(r)}var Ege={filterHandler:()=>({doesFilterPass:()=>!0})},_ge=class extends Ge{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...ML},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:i}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];r.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=s.getColDefCol(c)||s.getCol(c);if(!u){qe(62,{colId:c});return}if(!u.isFilterAllowed()){qe(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){qe(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});zn.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;xf(h,f)||c.push(u.column)}),c.length>0?i==null||i.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var i;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);ut(l)&&(t[a]=l)}),!e)for(const r of Object.keys(s)){const a=s[r];ut(a)&&!n.has(r)&&((i=o.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:_s(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const i=s.state;i!=null&&(n=!0,t[o]=i)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return _s(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(qe(66),null):s.getModel():_s(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(qe(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!F0(n),o=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:s},i=[],r=[],a=(c,u,d)=>{u&&(o(c)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(zn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=rl(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),zn.all(l).then(()=>{this.activeAggregateFilters=i,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)n.push(zn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=rl(o);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),zn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?o:s,a=this.model;for(let l=0;l<i.length;l++){const c=i[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:r,model:_s(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){bn(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,c;const{column:i,isHandler:r}=o;s!==i.getColId()&&(r&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(c=rl(o,r))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var i,r;const s=n.isHandler;s&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const o=rl(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),zn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,i)=>{const r=i?s.getCol(i):e;return r?n.getValue(r,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():_s(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ut(_s(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?rl(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=rl(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Eoe(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":dae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,i){const r=()=>{const c=this.createFilterCompParams(e,o,i),u=s(c,o);return Die(this.beans.userCompFactory,t,u,n)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||qe(281,{colId:e.getColId()})),{compDetails:c,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return It(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),i=this.createBaseFilterParams(e,s);if(i.filterChangedCallback=o,i.filterModifiedCallback=s?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=_s(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{o({...u,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=n}return i}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...o,source:"init",model:_s(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(tL(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:Qre.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:y}=rL(o,t);g?p=g:v==null&&y==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(ts(s)&&qe(277,{colId:e.getColId()}),Ege):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=N0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(It(this.gos,{column:e,colDef:s})),i=this.createHandlerParams(e,n);return{handler:o,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return It(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:i=>{var r;return((r=this.beans.filterManager)==null?void 0:r.doesRowPassOtherFilters(s,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(s,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{o({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const o=s&&e.every(i=>s.isGroupFilter(i));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(qf(p))})},r=e.getColDef(),a=o!=null&&o.isSelectable(r)?o.getFilterDef(e,r):r,l=mae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=N0(n,a,this.createFilterCompParams(e,c,"init",!0)),d=It(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=_s(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Pie(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var i;o&&this.isAlive()&&((i=this.beans.filterManager)==null||i.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:i}=e,r=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(i){if(i.created)return i.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return zn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,y,b,S,C,E;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,i=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,c=l!=null&&l.isSelectable(i)?l.getFilterDef(o,i):i,u=r?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(o,c,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??N0(s.userCompFactory,c,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),T=_s(this.model,e);if(n.handlerGenerator!=R){const k=n.handler,{handler:A,handlerParams:I}=this.createHandlerFromFunc(o,u.filterHandler,g);n.handler=A,n.handlerParams=I,n.handlerGenerator=R,delete this.model[e],(v=A.init)==null||v.call(A,{...I,source:"init",model:null}),this.destroyBean(k),T!=null&&((y=this.beans.filterManager)==null||y.onFilterChanged({columns:[o],source:t}))}else{const k=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=k,(S=(b=n.handler).refresh)==null||S.call(b,{...k,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(E=rl(n,h))==null||E.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const i=this.cachedFilter(e);if(!i)return s&&this.getOrCreateFilterWrapper(e,!0),zn.resolve();if(!i.isHandler)return zn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return eae(()=>{if(r){const{created:c,filterParams:u}=r;if(c)return r.promise.then(d=>d?{filter:d,filterParams:u}:void 0);r.refreshed=!0}return zn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(qf(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,i=e.getColId(),r=s.get(i);return r?r.model??null:_s(o,i)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(i=>{s=i});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:_s(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):zn.resolve()}setColDefPropsForDataType(e,t,n){var u;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:i,filterValueGetter:r}=lae(o,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new zn(s=>{if(e.isHandler){const i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){s();return}this.refreshHandlerAndUi(i,t,"api").then(()=>s());return}const o=rl(e);if(o){o.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){qe(65),s();return}(i.setModel(t)||zn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){ut(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var r;const s=e.getColId(),o=this.cachedFilter(e),i=()=>o==null?void 0:o.filterUi;VL(t,i,()=>_s(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=i())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var r;const i=this.beans.colModel.getColDefCol(o);i&&VL(e,()=>s.filterUi,()=>_s(this.model,o),()=>this.state.get(o),a=>this.updateState(i,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}),n.length&&zn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();LL(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>_s(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const i=e.get(o);if(i.valid===!1)return!1;(i.model??null)!==_s(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==_s(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function Rge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Dge(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Tge=class extends Ge{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){F0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):zn.resolve()).then(()=>{var i;const o={source:t,type:"filterChanged",columns:s};n&&Qs(o,n),this.eventSvc.dispatchEvent(o),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!F0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){qe(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},xge=class extends Ge{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var i;(i=this.popupSvc)==null||i.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,No(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,i="left";const r=No(this.gos);!r&&this.gos.get("enableRtl")&&(o=1,i="right");const a=r?void 0:4*o,l=r?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:i,keepWithinBounds:!0,position:"under",column:e})},n,t,r,s)}showPopup(e,t,n,s,o,i){var g;const r=e?this.createBean(new rae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){bn(57);return}const a=ss({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const c=()=>r==null?void 0:r.afterGuiDetached(),u=_oe(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{lV(e,!1,"contextMenu");const y=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),y&&s&&gr(s)){const b=fL(s);b==null||b.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:n,hidePopup:l})}),lV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==ke.TAB||e.defaultPrevented||yc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),vc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Ige=class extends Ge{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:i}=this.beans,r=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,s):i.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:i,valueSvc:r}=this.beans,a=It(this.gos,{data:t,node:s,column:n,colDef:o,getValue:r.getValueCallback.bind(r,s)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},Fge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Pge=class extends yn{constructor(){super(Fge,[Gv]),this.eFloatingFilterText=ct}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},s_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(i=>t[i]!=null)?!0:(qe(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;qe(73)}else qe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function ap(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function my(e){return e==null||typeof e=="string"&&e.trim().length===0}function Age(e){return e==="AND"||e==="OR"?e:"AND"}function kge(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function Oge(e,t){let n=e.length;return n>t&&(e.splice(t),qe(78),n=t),n}function lp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var o_=class extends gae{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new s_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Age(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&nl(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return i}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),zn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],qe(77));const i=Oge(o,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),zn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(qe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(qe(80),n=1),n>t&&(qe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new tE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=ss({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new jie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const i=this.isConditionDisabled(o,e);s.setDisabled(i||this.filterListOptions.length<=1),o===1&&(Af(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((s,o)=>{Vn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,i,r)=>{this.setElementDisplayed(s,o<r),this.setElementDisabled(s,this.isConditionDisabled(i,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:i,eJoinOrs:r}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const s=ap(e,t,n);for(const o of s)Ni(o)}removeComponents(e,t,n){const s=ap(e,t,n);for(const o of s)Ni(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof wc&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),s=!0,c&&n--)}let i=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),i=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),i=!0),i&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof wc))return;const i=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof wc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){QN(e)&&Vn(e.getGui(),t)}setElementDisabled(e,t){QN(e)&&Af(e.getGui(),t)}attachElementOnChange(e,t){e instanceof wc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=lp(t,this.optionsFactory),o=this.getInputs(e);for(let i=0;i<o.length;i++){const r=o[i];r!=null&&n(r,i,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return lp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,i)=>{i===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},R2=class{constructor(e,t,n,s,o,i){this.alive=!0,this.context=e,this.eParent=o;const r=Tie(t,n,s);r&&r.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),i==null||i(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Vn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},i_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function D2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&po(n,void 0,!0)||null,s&&po(s,void 0,!0)||null].slice(0,lp(o,t))}var T2=1e3,x2=1/0,Mge=class extends o_{constructor(){super("dateFilter",D2,i_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=T2,this.maxValidYear=x2,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))qe(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",T2),s=t("maxValidYear",x2);this.minValidYear=n,this.maxValidYear=s,n>s&&qe(83);const{minValidDate:o,maxValidDate:i}=e,r=o instanceof Date?o:po(o);this.minValidDate=r;const a=i instanceof Date?i:po(i);this.maxValidDate=a,r&&a&&r>a&&qe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,i=new R2(n,t,o.colDef,It(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=ss({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,s){const o=ss({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),ap(this.eConditionPanelsFrom,e,t),ap(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=ap(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,i)=>{o!==e||!t||s>=i||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Lo(s[0],!0,o)),s.length>1&&(n.dateTo=Lo(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},I2=class extends Ge{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new s_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const r=t;s.push(...r.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return s[o](r=>this.individualConditionPasses(e,r,i))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let i=WL(t)?t.conditions:[t];const r=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!i||i.every(u=>r.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((i&&!i.every(u=>u.filterType===c)||t.filterType!==c)&&(i=i.map(u=>({...u,filterType:c})),l=!0),typeof s=="number"&&i&&i.length>s&&(i=i.slice(0,s),l=!0),l){const u=i.length>1?{...t,filterType:c,conditions:i}:{...i[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),i=s.getCustomOption(t.type),r=kge(i,o,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},F2=class extends I2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:i}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(i)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),i=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=o(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return my(t);case"notBlank":return!my(t);default:return qe(76,{filterModelType:s}),!0}}},P2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Nge={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},r_=class extends Ge{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?al(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(c=>this.getModelAsString(c,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${al(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?al(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const i=e,r=this.optionsFactory.getCustomOption(i.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?n(a,l):this.conditionToString(i,s,i.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,i){let r;const a=this.getTypeKey(e);return a&&(r=al(this,a)),o&&i&&(r=this.getLocaleTextFunc()(o,i)),r!=null?t?`${r} ${al(this,"filterSummaryInRangeValues",[n(),s()])}`:`${r} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},A2=class extends r_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,i=t.column,r=s==null?void 0:s.getDateFormatterFunction(i),a=r?r(n??void 0):n;return o.formatValue(i,null,a)}),this.filterTypeKeys=P2}conditionToString(e,t,n,s,o){const{type:i}=e,r=po(e.dateFrom),a=po(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Y0(h,l),u=()=>r!==null?c(r):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(i,n,u,d,s,o);if(h!=null)return h}return n?`${u()}-${d()}`:r!=null?c(r):`${i}`}};function Lge(e,t){const n=t;return n<e?-1:n>e?1:0}var Vge=class extends F2{constructor(){super(D2,i_),this.filterType="date",this.FilterModelFormatterClass=A2}comparator(){return this.params.filterParams.comparator??Lge}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},k2=class extends yn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new s_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Bge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},$ge=class extends k2{constructor(){super(Bge,[Gv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=A2,this.filterType="date",this.defaultOptions=i_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?po(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Vn(this.eDateWrapper,e),Vn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Lo(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=uE(e,this.defaultDebounceMs);return It(this.gos,{onDateChanged:Fs(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new R2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Hge={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Gge=class extends yn{constructor(){super(Hge,[Gv]),this.eDateInput=ct,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&sl();const{minValidYear:s,maxValidYear:o,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&s&&qe(85),r&&o&&qe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:po(g));f&&p&&f.getTime()>p.getTime()&&qe(87)}i?i instanceof Date?t.min=Y0(i):t.min=i:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=Y0(r):t.max=r:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return po(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Lo(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},a_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function l_(e){const{allowedCharPattern:t}=e??{};return t??null}function c_(e){return e==null||isNaN(e)?null:e}function O2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[c_(n),c_(s)].slice(0,lp(o,t))}var Uge=class extends o_{constructor(){super("numberFilter",O2,a_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=l_(this.params),t=ss({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new Cc({allowedCharPattern:s}):new eE);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(c_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=sa(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},M2=class extends r_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=P2}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),s,o);if(c!=null)return c}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},Wge=class extends F2{constructor(){super(O2,a_),this.filterType="number",this.FilterModelFormatterClass=M2}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},N2=class extends Ge{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new Cc((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function u_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function L2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,lp(o,t))}var zge={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},V2=class extends k2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(zge)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Kv(e.filterParams),!o){const i=uE(e.filterParams,s),r=Fs(this,this.syncUpWithParentFilter.bind(this),i);n.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();Is(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===ke.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:i}=this;let r=s.getValue();if(o.filterParams.trimInput&&(r=u_(r),s.setValue(r,!0)),n){const a=o,l=a.model,c=this.convertValue(r),u=c==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},jge=class extends Ge{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new eE),this.eTextInput=this.createManagedBean(new Cc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},Kge=class extends V2{constructor(){super(...arguments),this.FilterModelFormatterClass=M2,this.filterType="number",this.defaultOptions=a_}updateParams(e){l_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=l_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new N2({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new jge)}convertValue(e){return e?Number(e):null}},d_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],qge=class extends o_{constructor(){super("textFilter",L2,d_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(sa(n.getValue()))}),t}createEValue(){const e=ss({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new Cc);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},B2=class extends r_{constructor(){super(...arguments),this.filterTypeKeys=Nge}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e;if(t){const l=u=>()=>al(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(i),l(r),s,o);if(c!=null)return c}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},Yge=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},Zge=e=>e,Xge=e=>e==null?null:e.toString().toLowerCase(),Jge=class extends I2{constructor(){super(L2,d_),this.filterType="text",this.FilterModelFormatterClass=B2}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Yge,this.formatter=t.textFormatter??(t.caseSensitive?Zge:Xge)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return my(t);if(n.type==="notBlank")return!my(t);const d={api:r,colDef:a,column:l,context:c,node:s.node,data:s.data,filterOption:n.type,value:i,textFormatter:u};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:i}=n;return o&&(s.filter=u_(o)??null),i&&(s.filterTo=u_(i)??null),s};return WL(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Qge=class extends V2{constructor(){super(...arguments),this.FilterModelFormatterClass=B2,this.filterType="text",this.defaultOptions=d_}createFloatingFilterInputService(){return this.createManagedBean(new N2)}};function eme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function tme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function nme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var sme=class extends Ge{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ut(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){qe(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return ut(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=It(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return ut(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);ut(s)&&t.push(s)}return t.join(`
248
250
  `)}},ome={moduleName:"ClientSideRowModelFilter",version:lt,rowModels:["clientSide"],beans:[ige]},h_={moduleName:"FilterCore",version:lt,beans:[Tge],apiFunctions:{isAnyFilterPresent:Rge,onFilterChanged:Dge},css:[dge],dependsOn:[ome]},$2={moduleName:"FilterValue",version:lt,beans:[Ige]},vy={moduleName:"ColumnFilter",version:lt,beans:[_ge,xge],dynamicBeans:{headerFilterCellCtrl:rge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:hge,getColumnFilterInstance:fge,destroyFilter:pge,setFilterModel:gge,getFilterModel:mge,getColumnFilterModel:vge,setColumnFilterModel:yge,showColumnFilter:wge,hideColumnFilter:Cge,getColumnFilterHandler:bge,doFilterAction:Sge},dependsOn:[h_,gy,$2,cge]},ime={moduleName:"CustomFilter",version:lt,userComponents:{agReadOnlyFloatingFilter:Pge},dependsOn:[vy]},rme={moduleName:"TextFilter",version:lt,dependsOn:[vy],userComponents:{agTextColumnFilter:{classImp:qge,params:{useForm:!0}},agTextColumnFloatingFilter:Qge},dynamicBeans:{agTextColumnFilterHandler:Jge}},ame={moduleName:"NumberFilter",version:lt,dependsOn:[vy],userComponents:{agNumberColumnFilter:{classImp:Uge,params:{useForm:!0}},agNumberColumnFloatingFilter:Kge},dynamicBeans:{agNumberColumnFilterHandler:Wge}},lme={moduleName:"DateFilter",version:lt,dependsOn:[vy],userComponents:{agDateColumnFilter:{classImp:Mge,params:{useForm:!0}},agDateInput:Gge,agDateColumnFloatingFilter:$ge},dynamicBeans:{agDateColumnFilterHandler:Vge}},cme={moduleName:"QuickFilterCore",version:lt,rowModels:["clientSide"],beans:[sme],dependsOn:[h_,$2]},ume={moduleName:"QuickFilter",version:lt,apiFunctions:{isQuickFilterPresent:eme,getQuickFilter:tme,resetQuickFilter:nme},dependsOn:[cme]},dme={moduleName:"ExternalFilter",version:lt,dependsOn:[h_]},hme=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",f_=(e,t,n)=>{var a,l,c;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(c=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,r=o||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},fme=class extends Ge{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=n_(o),{column:r,eGui:a}=t,l=r.getColDef();!s&&i&&!l.headerComponent&&(s=Sv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,It(o,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=n_(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!s&&i&&!(l!=null&&l.headerGroupComponent)&&(s=Sv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,It(o,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:r};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:i}=s,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(i!=null&&i.isEditing(e))&&f_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&ut(g))return sp(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(It(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=n_(o);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&f_(s,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=Sv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(i!=null&&i.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(o,i);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const i={getGui:()=>o,getTooltipValue:()=>f_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},r=this.createTooltipFeature(i,n);if(r)return e.createBean(r,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ut(t.tooltipField)||ut(t.tooltipValueGetter)||ut(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},pme=class extends Vre{createTooltipComp(e,t){const n=Fie(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},H2={moduleName:"Tooltip",version:lt,beans:[fme],dynamicBeans:{tooltipFeature:TL,highlightTooltipFeature:Bre,tooltipStateManager:pme},userComponents:{agTooltipComponent:Gre},dependsOn:[gy],css:[hme]},bd=class{constructor(e){this.cellValueChanges=e}},p_=class extends bd{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},gme=10,G2=class{constructor(e){this.actionStack=[],this.maxStackSize=e||gme,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},mme=class extends Ge{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&_V(this.activeCellEdit,t),s=this.activeRowEdit!==null&&Bce(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:c}=e,u={rowPinned:i,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new G2(n),this.redoStack=new G2(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[s],o),i instanceof p_?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:i,columnId:r}=s,a={rowIndex:o,rowPinned:i},l=fa(this.beans,a);l.displayed&&l.setDataValue(r,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const i=s.startRow,r=s.endRow;o===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},i=fa(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:i,rangeSvc:r}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:s};i.setFocusedCell({...c,forceBrowserFocus:!0}),r==null||r.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new bd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new p_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&ia(n)?e=new p_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new bd(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new bd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},vme=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",yme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},wme=class extends oy{constructor(){super(yme,[Q0]),this.eEditor=ct}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=yv(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},yy=class extends oy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ct}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;s?(this.focusAfterAttached=!0,o===ke.BACKSPACE||o===ke.DELETE?r="":o&&o.length===1?i?a=!1:r=o:(r=t.getStartValue(),o!==ke.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===ke.PAGE_UP||c===ke.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;sl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Cme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},bme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Cme}getAgComponents(){return[gL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:i}=n;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),i?i({value:t,cellEditorParams:n,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ut(n)&&!ut(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Lo(e,this.includeTime??!1)}},Sme=class extends yy{constructor(){super(new bme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Eme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},_me=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Eme}getAgComponents(){return[gL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:i,getValidationErrors:r}=t;let a=[];if(s){const l=new Date(s),c=this.getLocaleTextFunc();if(o){const u=new Date(o);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const u=new Date(i);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ut(n)&&!ut(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Lo(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):po(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Lo(e??null,this.includeTime??!1)??void 0}},Rme=class extends yy{constructor(){super(new _me(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Dme={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Tme=class extends oy{constructor(){super(Dme,[qie]),this.eEditor=ct}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(i||60).setRows(r||10);let a;n?(this.focusAfterAttached=!0,s===ke.BACKSPACE||s===ke.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==ke.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===ke.LEFT||t===ke.UP||t===ke.RIGHT||t===ke.DOWN||e.shiftKey&&t===ke.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!ut(s)&&!ut(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let i=[];return typeof o=="string"&&t!=null&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,internalErrors:i,cellEditorParams:e}):i}},xme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Ime=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return xme}getAgComponents(){return[Yie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:i}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:i,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===ke.UP||e.key===ke.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ut(n)&&!ut(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){sl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Fme=class extends yy{constructor(){super(new Ime(()=>this.getLocaleTextFunc()))}},Pme={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Ame=class extends oy{constructor(){super(Pme,[rre]),this.eEditor=ct,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:i,eventKey:r}=e;if(Ln(o)){qe(58);return}this.startedByEnter=r!=null?r===ke.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||i===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const i=this.getLocaleTextFunc();o.push(i("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},kme={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Ome=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return kme}getAgComponents(){return[Gv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getValue(),o=this.getLocaleTextFunc();let i=[];return t!=null&&typeof s=="string"&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ut(n)&&!ut(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){sl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ut(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},U2=class extends yy{constructor(){super(new Ome(()=>this.getLocaleTextFunc()))}};function Mme(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Nme(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function W2(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function z2(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Lme(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Vme(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Bme(e){var t;(t=e.undoRedo)==null||t.redo("api")}function $me(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Hme(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,i)=>{const{rowIndex:r,rowPinned:a}=i;o.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=pa(l);let g=u??d;g===ui&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Gme(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else Rc(e,{persist:!0});yd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Ume(e,t){var s;const n=Gn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Wme(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(s);if(!l){qe(12,{colKey:s});return}const u=fa(e,{rowIndex:o,rowPinned:i||null});if(!u){qe(290,{rowIndex:o,rowPinned:i});return}if(!l.isCellEditable(u))return;i==null&&z2(e,o),W2(e,s),r==null||r.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function zme(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function jme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function Kme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var qme={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Yme=class extends L0{constructor(e){super(qme),this.params=e}postConstruct(){pc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{yE(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Zme(e,{column:t},n,s,o="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===ke.TAB||n.key===ke.ENTER||n.key===ke.F2||n.key===ke.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=Xme(e.gos,r),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function Xme(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function g_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,o)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Jme(e,t,n="ui"){const s=g_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(i=>g_(e,{rowNode:t.rowNode,column:i},n))}var wy=(e,t=!1)=>{if(e!==void 0)return pa(e)||t&&e.state==="editing"};function j2(e,t,n=!1){var s;return wy((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var K2=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const i=e[s];if(i.data&&(wy(t==null?void 0:t.getEdit({rowNode:i,column:n}))||wy(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||K2(i.childrenAfterGroup,t,n))return!0}};function q2(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:K2(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function Y2(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return wy((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var Qme=class extends Ge{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const i=j2(n,e)||q2(n,e)||Y2(n,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},eve=class extends Ge{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const i=(r=this.editModelSvc)==null?void 0:r.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const c={rowNode:s,column:l};return j2(n,c,!0)||q2(n,c)||Y2(n,c)});this.applyStyle(i,a);return}this.applyStyle(i)}applyStyle(e=!1,t=!1){var o,i;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",s&&t),r.toggleCss("ag-row-batch-edit",s&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},tve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("top",i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("bottom",i=>s.has(i)&&o.add(i));for(const i of s)o.has(i)||n.removeEdits({rowNode:i});return o},nve=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:o,column:r}))},sve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());nve(e,tve(e,s),t)},ove=new Set(["undo","redo","paste","bulk","rangeSvc"]),ive=new Set(["ui","api"]),Z2={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},rve=new Set(Object.keys(Z2)),ave=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Cy={cancel:!0,source:"api"},lve={cancel:!1,source:"api"},Sd={checkSiblings:!0},cp={force:!0,suppressFlash:!0},cve=class extends Ge{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:s})=>{this.stopEditing(void 0,Cy),this.createStrategy(s)});const t=sve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Cy):this.isEditing()&&(this.isBatchEditing()?yd(e,this.model.getEditPositions()):this.stopEditing(void 0,lve)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Cy)):(this.stopEditing(void 0,Cy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=X2(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=Zme(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return _fe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Sd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:i=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Gn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,y,b;const{event:n,cancel:s,source:o="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(rve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?Z2[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Sd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Gn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(r??!1),g=s&&!!this.shouldCancelEditing(e,n,c)||(i??!1);if(p||g){Rc(a,{persist:!0,isCancelling:g||s,isStopping:p});const S=l.getEditMap(),C=this.processEdits(S,s,o);(v=this.strategy)==null||v.stop(s,n);for(const E of C)l.clearEditValue(E);this.bulkRefresh(void 0,h);for(const E of l.getEditPositions(S)){const R=Gn(a,E),T=pa(E);R==null||R.refreshCell({force:!0,suppressFlash:!T})}h=S,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((y=this.strategy)!=null&&y.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:S}=n,C=S===ke.ENTER,E=S===ke.ESCAPE,R=S===ke.TAB;(C||R||E)&&(C||R?Rc(a,{persist:!0}):E&&this.revertSingleCellEdit(d),this.isBatchEditing()?(b=this.strategy)==null||b.cleanupEditors():yd(a,l.getEditPositions(),{event:n,cancel:E}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Rc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),qE(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==ke.ENTER||!a)return;const l=r?ke.UP:ke.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const r of s){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),u={rowNode:r,column:l},d=pa(c);!t&&d&&!o&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,n)||i.push(u))}}return i}setNodeDataValue(e,t,n,s,o="edit"){const{beans:i}=this,r=Gn(i,{rowNode:e,column:t}),a=ive.has(o)?"edit":o;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),s&&(r==null||r.refreshCell(cp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=cp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...uve(e),...cp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:i,rowModel:r}=s;ts(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:i}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!u.parent&&u.sibling&&i.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(h=Gn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Gn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const i=X2(s)==="fullRow"?Jme(o,e,t):g_(o,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,i,r;if(this.hasValidationErrors(e)){const a=Gn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(r=(i=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,i,r;const n=Gn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(yd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),vd(this.beans,e,{silent:!0}),Dc(this.beans),n==null||n.refreshCell(cp),t&&(n==null||n.focusCell(),(r=(i=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var s;Dc(this.beans);const t=Gn(this.beans,e);t&&(t.refreshCell(cp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof wd&&i&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,r)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!r&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const r=this.model.getEdit({rowNode:o,column:t});r&&(s=r)}const i=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return i===ui||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){yfe(this,this.beans,e)}createPopupEditorWrapper(e){return new Yme(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!ave.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||ove.has(n))return dy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return dy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return dy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){bfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Sd))return;const{rowNode:s,column:o}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(s,Sd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,Sd);if(r!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return It(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:i}=this;Rc(s,{persist:!0});const r=this.model.getEditMap(!0),a=(u=(c=r.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=fa(s,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let y=i.parseValue(g,f??null,a,v);Number.isNaN(y)&&(y=null),p.set(g,{editorValue:void 0,pendingValue:y,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&r.set(f,p)}),this.setEditMap(r),this.batch){this.cleanupEditors(),qE(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Gn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Qme(e,t)}createRowStyleFeature(e,t){return new eve(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=r?s.getCol(r):l?s.getCol(l):a;if(!f)continue;const p=fa(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!pa({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=ui),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(i,t)}onCellFocused(e){var i;const t=Gn(this.beans,e);if(!t||!this.isEditing(t,Sd))return;const n=this.model.getEdit(t);if(!n||!pa(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Gn(this.beans,e)}};function uve(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function X2(e,t){return t??e.get("editType")??"singleCell"}var J2=class extends Ge{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:s,beans:o}=this,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Gn(o,n));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:fa(o,{rowIndex:u,rowPinned:d})},f=r.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:i}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,i;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of n){s.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(r);continue}s.pass.push(r)}if(e)for(const r of n)hy(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(s);if(r.destroy.length>0)for(const a of r.destroy)hy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Gn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){Rc(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);yd(this.beans,s),qE(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,i;return(i=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:i.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;Cfe(this.beans,i,o,r,t,s)}dispatchCellEvent(e,t,n,s){const o=Gn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=jE(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===ke.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===ke.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,i)=>{o.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),i=o.pendingValue===ui?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Gn(this.beans,o);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},dve=class extends J2{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!jE(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(r)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const u of c){const d={rowNode:r,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:i})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(pa(a)){s.push(r);break}}}),Dc(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of s)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Gn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),c=r.isCellEditable(),u=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!o?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||vd(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(c&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!u&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var i;if(n!=="editing")return;const o=Gn(this.beans,{rowNode:t,column:s});o&&!((i=o.comp)!=null&&i.getCellEditor())&&vd(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},hve=class extends J2{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:i}=e||{};return(!this.rowNode||!this.column)&&o&&i?null:this.rowNode!==o||this.column!==i}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:i}=e,r=fa(this.beans,{rowIndex:s,rowPinned:i}),a=KE(o),l=t.getCol(a),c=e.previousParams;if(c){const u=KE(c.column);if((c==null?void 0:c.rowIndex)===s&&u===a&&(c==null?void 0:c.rowPinned)===i)return}n!=null&&n.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,y,b,S;const i=this.beans.focusSvc.getFocusedCell();i&&(e=gd(this.beans,i)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((y=a.comp)!=null&&y.getCellEditor())){const C=(b=this.editSvc)==null?void 0:b.isEditing(a,{withOpenEditor:!0});vd(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(S=e.rowCtrl)==null||S.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},dl={moduleName:"EditCore",version:lt,beans:[vfe,cve],apiFunctions:{getEditingCells:Hme,getEditRowValues:$me,getCellEditorInstances:wfe,startEditingCell:Wme,stopEditing:Gme,isEditing:Ume,validateEdit:zme},dynamicBeans:{singleCell:hve,fullRow:dve},dependsOn:[gy,H2],css:[vme]},fve={moduleName:"UndoRedoEdit",version:lt,beans:[mme],apiFunctions:{undoCellEditing:Vme,redoCellEditing:Bme,getCurrentUndoSize:jme,getCurrentRedoSize:Kme},dependsOn:[dl]},pve={moduleName:"TextEditor",version:lt,userComponents:{agCellEditor:U2,agTextCellEditor:U2},dependsOn:[dl]},gve={moduleName:"NumberEditor",version:lt,userComponents:{agNumberCellEditor:{classImp:Fme}},dependsOn:[dl]},mve={moduleName:"DateEditor",version:lt,userComponents:{agDateCellEditor:Sme,agDateStringCellEditor:Rme},dependsOn:[dl]},vve={moduleName:"CheckboxEditor",version:lt,userComponents:{agCheckboxCellEditor:wme},dependsOn:[dl]},yve={moduleName:"SelectEditor",version:lt,userComponents:{agSelectCellEditor:Ame},dependsOn:[dl]},wve={moduleName:"LargeTextEditor",version:lt,userComponents:{agLargeTextCellEditor:Tme},dependsOn:[dl]},Cve={moduleName:"CustomEditor",version:lt,dependsOn:[dl]},bve=class extends Ge{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,rd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Aoe(e))}createColumns(e,t){var h,f;const n=()=>{var p;Mv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,r=this.generateSelectionCols();if(Poe(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(r,c))??[];this.columns={list:r,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!aa(v));return[...r,...g]})}updateColumns(e){var n;const t=rd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Vi(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>zf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var r,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!hc(e))return!1;const s=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!id(n),i=Iv(n);return o||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:$N,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new gc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?id(t):void 0,o=e&&typeof e!="string"?id(e):void 0,i=s!==o,r=t&&typeof t!="string"?Iv(t):void 0,a=e&&typeof e!="string"?Iv(e):void 0,l=r!==a,c=Fv(e),u=Fv(t);(i||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Mv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const i=()=>{let u;switch(o.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Li(u,o)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(HN))?2:1)===s&&i()}};function Sve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!ep(a)?(qe(59),!1):a.id===void 0?(qe(60),!1):!0))return;const{nodes:s,source:o,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:s,source:o??"api",newValue:i})}function Eve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function _ve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function Rve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Dve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function Tve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function xve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Ive(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Fve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Pve=class extends Wle{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=Pv(e),this.groupSelectsDescendants=Uf(e),this.groupSelectsFiltered=Av(e)==="filteredDescendants",this.masterSelectsDetail=MN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Uf(e),n=Pv(e),s=Av(e)==="filteredDescendants";this.masterSelectsDetail=MN(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?eB(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:i,keepDescendants:r=!1}){var c;if(s.length===0)return 0;const{gos:a}=this;if(!hc(a)&&e)return qe(132),0;if(s.length>1&&!this.isMultiSelect())return qe(130),0;let l=0;for(let u=0;u<s.length;u++){const d=s[u],h=Ed(d);if(h.rowPinned&&!ep(h)){qe(59);continue}if(h.id===void 0){qe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,i))}return n||(s.length===1&&i==="api"&&this.selectionCtx.setRoot(Ed(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ed(s[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const i=Ed(o);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!ts(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new np(!0,o),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==o){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!kve(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&s.set(i.parent.id,i.parent)}}),s.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new il(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!ts(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ts(this.gos);let s=!1;const o=i=>{const r=this.selectRowNode(Ed(i),!1,void 0,e);s||(s=r)};if(t==="currentPage"||t==="filtered"){if(!n){bn(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);s||(s=i)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return Q2(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let i=s;i<=o;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!hc(t)){qe(132);return}if(yoe(t)&&!Gf(t)){qe(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let i=!1;if(this.getNodesToSelect(o).forEach(r=>{const a=this.selectRowNode(Ed(r),!0,void 0,s);i||(i=a)}),n.selectAll=!0,ts(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(s);i||(i=r)}i&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){bn(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(i=>{s.has(i.id)&&o.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return ts(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!hc(t))return;const s="selectableChanged",o=e!==void 0,i=ts(t)&&this.groupSelectsDescendants,r=[],a=c=>{var d;if(o&&!c.group)return;if(i&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&r.push(c)};if(i){if(e===void 0){const c=n.rootNode;e=c?new np(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:s}),!o&&i&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const s=Ave(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Gf(t)){qe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const i of s){const r=n.getRowNode(i);r&&o.push(r)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ed(e){return ep(e)?e.pinnedSibling:e.footer?e.sibling:e}function Ave(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),Q2(t,n)}function Q2(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function kve(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function eB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(eB))??!1;return t||n}var Ove={moduleName:"SharedRowSelection",version:lt,beans:[bve],apiFunctions:{setNodesSelected:Sve,selectAll:Eve,deselectAll:_ve,selectAllFiltered:Rve,deselectAllFiltered:Dve,selectAllOnCurrentPage:Tve,deselectAllOnCurrentPage:xve,getSelectedNodes:Ive,getSelectedRows:Fve}},Mve={moduleName:"RowSelection",version:lt,rowModels:["clientSide","infinite","viewport"],beans:[Pve],dependsOn:[Ove]};function Nve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function Lve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function tB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function nB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){qe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function Vve(e,t,n){var o,i;const s=Bpe(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){bn(238);return}s.setRowCount(t,n);return}bn(28);return}(i=py(e))==null||i.setRowCount(t,n)}function Bve(e){var t;return nd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function $ve(e){return e.rowModel.isLastRowIndexKnown()}var Hve={moduleName:"CsrmSsrmSharedApi",version:lt,apiFunctions:{expandAll:Nve,collapseAll:Lve}},Gve={moduleName:"RowModelSharedApi",version:lt,apiFunctions:{onRowHeightChanged:tB,resetRowHeights:nB}},Uve={moduleName:"SsrmInfiniteSharedApi",version:lt,apiFunctions:{setRowCount:Vve,getCacheBlockState:Bve,isLastRowIndexKnown:$ve}},Wve=class extends Ge{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var i;if(!s){bn(18),t||bn(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(i=o.current)==null?void 0:i.api:(o.api||bn(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":qe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:i,colModel:r}=s;if(t&&(n=r.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Vi(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Vi(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Vi(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=i.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},zve={moduleName:"AlignedGrids",version:lt,beans:[Wve],dependsOn:[$V]},jve=class extends Ge{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},sB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=sB(this.rootNode),i=new Array(e.length);o._leafs=i;let r=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=r,i[r++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const y=a(g);y&&c(v,y)}}};c(o,e),i.length=r}setImmutableRowData(e,t){var y;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=od(s),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,c=[],u=(y=this.beans.groupStage)==null?void 0:y.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(b,S)=>{if(!d&&d!==void 0){const C=b.sourceRowIndex;d=C<=h,h=C}b.data!==S&&(b.updateData(S),r.has(b)||a.add(b),!b.selectable&&b.isSelected()&&c.push(b))},g=(b,S,C)=>{for(let E=0,R=S.length;E<R;++E){const T=S[E];if(!T)continue;let k=this.getRowNode(o({data:T,level:C}));if(k?(p(k,T),f||(f=!!u&&k.treeParent!==b)):(k=this.createRowNode(T,C),r.add(k)),!u||l.has(k)){l.add(k);continue}l.add(k),k.treeParent=b;const A=u(T);A&&g(k,A,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,c)||d||r.size>0;if(v){const b=n._leafs??(n._leafs=[]);d===void 0?Xve(b,l,i):Zve(b,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,i=s.length;o<i;o++){const r=s[o];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return qe(268),{remove:[],update:[],add:[]};const n=[],s=od(this.gos),o=this.executeRemove(s,e,t,n),i=this.executeUpdate(s,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},i){const r=this.rootNode._leafs,a=r==null?void 0:r.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&i.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[c++]=g}return f.length=c,c&&Yve(r,u,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&o.push(u),r[a++]=u,n.has(u)||s.add(u))}return r.length=a,r}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=o+r;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const c=new Array(r),u=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);u.add(h),h.sourceRowIndex=l,s[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new il(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&qe(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return qve(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(bn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=Kve(e,t)),t}},Kve=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},sB=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=s,i.childrenAfterFilter=o,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},qve=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return bn(5,{data:t}),null},Yve=(e,t,n,s,o)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Zve=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===s?i||(i=o):(a>=0?i=!0:o=!0,r.sourceRowIndex=s,e[s]=r),++s}return i},Xve=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let i=0;for(let r=0;r<o;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of s)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},oB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const i=t[s],r=s===0,a=s===o;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==s&&(i.childIndex=s,i.dispatchRowEvent("childIndexChanged"))}},Jve=class extends Ge{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=o.get("groupMaintainOrder"),d=i.getCols().some(b=>b.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const y=b=>{var R,T;const S=f&&b.leafGroup;let C=u&&d&&!b.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let E=null;if(C){let k=!1;if(h){const A=b.level+1;A<h.length&&(k=h[A].getSort()===null)}k||(E=tye(b))}else!e.length||S||(t&&n?E=Qve(a,b,n,s,e):E=a.doFullSort(b.childrenAfterAggFilter,e));if(E||(E=((R=b.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=b.childrenAfterSort)==null?void 0:T[0])!==E[0]),b.childrenAfterSort=E,oB(b),p){const k={nodes:b.childrenAfterSort};p(k)}};if(s==null||s.forEachChangedNodeDepthFirst(y),g&&o.get("groupHideOpenParents")){const b=c==null?void 0:c.getShowRowGroupCols();b!=null&&b.length&&l.refreshCells({columns:b,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(wr(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Qve=(e,t,n,s,o)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,o);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];c.has(p)||u.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),eye(e,o,l,d)},eye=(e,t,n,s)=>{let o=0,i=0;const r=n.length,a=s.length,l=new Array(r+a);let c=0;for(;o<r&&i<a;){const u=n[o],d=s[i];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++o):(l[c++]=d.rowNode,++i)}for(;o<r;)l[c++]=n[o++].rowNode;for(;i<a;)l[c++]=s[i++].rowNode;return l},tye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const i=new Array(o),r=new Set;for(let l=0;l<o;++l)r.add(n[l]);let a=0;for(let l=0;l<s;++l){const c=t[l];r.delete(c)&&(i[a++]=c)}if(r.size===0&&a===s)return t;for(const l of r)i[a++]=l;return i.length=a,i},nye=class extends Ge{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Fs(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new il(e);this.rootNode=t,this.nodeManager=this.createBean(new jve(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var i;const o=(i=s.changeSet)==null?void 0:i.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,i=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),c=Math.min(a,s);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=el(this.beans,d);d.setRowHeight(h.height),o=!0,i=!0}}o&&this.setRowTopAndRowIndex()}while(o);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const i=new Set(e),r=o==null?void 0:o.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,qe(1));const l={step:"nothing",changedProps:i};a&&(!r&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new ry,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let i=0,r=e.length;i<r&&o;++i)o=Math.min(o,n.get(e[i])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const i=Ps(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=el(t,l,i,s);l.setRowHeight(u.height,u.estimated)}l.setRowTop(o),l.setRowIndex(r),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{s(r),s(r.detailNode),s(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let u=0,d=a.length;u<d;++u)o(a[u])},i=this.rootNode;i&&o(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,i;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let c=i[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,i,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let i=o.parent;for(;i&&i!==t;)o=i,i=o.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return r>=0?r:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:sd(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:sd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:sd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new np(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(o&&r&&s.dispatchEvent({type:"rowDataUpdated"}),!o||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),r&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],i=Uf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(n&&(r===t||r===e)&&(s=!0,i&&r.group)){iB(o,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(s=!0)}(!r.group||!i)&&o.push(r)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let r=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?s=l+1:c.rowTop>e&&(o=l-1),r===s&&a===o))return l;r=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,s=this.rootNode,o=0){let i=o;if(!s)return i;const r=s===this.rootNode;if(r||e(s,i++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,s,e,t,r,"top"))??i;for(const c of a)i=this.depthFirstSearchRowNodes(e,t,n,c,i);return(l==null?void 0:l.addTotalRows(i,s,e,t,r,"bottom"))??i}}return i}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),oB(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,_2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(aE)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],i=[],r=new ry;for(const{rowDataTransaction:l,callback:c}of s??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,r);o.push(u),c&&i.push(c.bind(null,u))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,c=i.length;l<c;l++)i[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new ry,s=t.updateRowData(e,n);return this.commitTransactions(n),s}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const s=t.sibling;s==null||s.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},iB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const i=n[s];i.data&&e.push(i),i.group&&iB(e,i)}};function sye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function oye(e,t){const n=ul(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function iye(e){var t;return((t=ul(e))==null?void 0:t.isEmpty())??!0}function rye(e,t){var n;(n=ul(e))==null||n.forEachLeafNode(t)}function aye(e,t){var n;(n=ul(e))==null||n.forEachNodeAfterFilter(t)}function lye(e,t){var n;(n=ul(e))==null||n.forEachNodeAfterFilterAndSort(t)}function cye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=ul(e))==null?void 0:n.updateRowData(t)})}function uye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=ul(e))==null?void 0:s.batchUpdateRowData(t,n)})}function dye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=ul(e))==null?void 0:t.flushAsyncTransactions()})}function hye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var rB={moduleName:"ClientSideRowModel",version:lt,rowModels:["clientSide"],beans:[nye,Jve],dependsOn:[g2]},fye={moduleName:"ClientSideRowModelApi",version:lt,apiFunctions:{onGroupExpandedOrCollapsed:sye,refreshClientSideRowModel:oye,isRowDataEmpty:iye,forEachLeafNode:rye,forEachNodeAfterFilter:aye,forEachNodeAfterFilterAndSort:lye,applyTransaction:cye,applyTransactionAsync:uye,flushAsyncTransactions:dye,getBestCostNodeSelection:hye,resetRowHeights:nB,onRowHeightChanged:tB},dependsOn:[Hve,Gve]},pye=class extends Ge{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&moe(this.gos,s);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!c||o(It(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(It(this.gos,{node:s}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const s=new JN,{colGroupSvc:o}=this.beans,i=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,i)=>{s.onColumn(o,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var c;const s=this.rowModel,o=ts(this.gos),i=nd(this.gos),r=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>s.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?s.forEachNode(a):o||i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):o(i.parent,r.parent):i.level>r.level?o(i.parent,r):o(i,r.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),c=h=>aa(h)?!1:!la(h)||s;if(o!=null&&o.length)return i.getColsForKeys(o).filter(c);const u=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!k0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const i=o;if(i.getChildren)for(const r of i.getChildren()??[])s.push(r)}e.length>0&&ns(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const i of t){const r=i;let a;n?a=n(It(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Rn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,c)}}},gye={moduleName:"SharedExport",version:lt,beans:[pye]},aB=`\r
249
251
  `,mye=class extends zpe{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,aB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(qe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=aB),this.isFirstLine=!1}},vye=class extends Wpe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){qe(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(It(this.gos,{})):t.fileName;jpe(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new mye({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function yye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function wye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Cye={moduleName:"CsvExport",version:lt,beans:[vye],apiFunctions:{getDataAsCsv:yye,exportDataAsCsv:wye},dependsOn:[gye]},bye=class extends Ge{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let i=0;i<e;i++){const r=n+i,a=new il(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){ut(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Ln(this.params.datasource.getRows)){qe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:It(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,i)=>{const r=e.rowData?e.rowData[i]:void 0;!o.id&&o.alreadyRendered&&r&&(t[i]=new il(n),t[i].setRowIndex(o.rowIndex),t[i].setRowTop(o.rowTop),t[i].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},Sye=2,Eye=class extends Ge{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new bye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Qa(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,i=Sye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,i=(e.id+1)*n+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,ut(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,s)=>n.id-s.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let s=-1,o=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&s+1!==l.id){r=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},_ye=class extends Ge{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new il(e);this.rootNode=t,t.level=-1,this.rowHeight=fc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=fc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!xf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;od(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:fc(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Eye(this.cacheParams)),o.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function Rye(e){var t;(t=py(e))==null||t.refreshCache()}function Dye(e){var t;(t=py(e))==null||t.purgeCache()}function Tye(e){var t;return(t=py(e))==null?void 0:t.getRowCount()}var xye=class extends Ge{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=voe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Fs(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Li(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Qa(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){Qa(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Iye={moduleName:"InfiniteRowModelCore",version:lt,rowModels:["infinite"],beans:[_ye,xye]},Fye={moduleName:"InfiniteRowModel",version:lt,apiFunctions:{refreshInfiniteCache:Rye,purgeInfiniteCache:Dye,getInfiniteRowCount:Tye},dependsOn:[Iye,Uve]},Pye="↑",Aye="↓",kye={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Oye=class extends yn{constructor(){super(kye),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=ut(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=Pye+o:r.textContent=Aye+o,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Is(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(ut(s)?o.textContent=s:ut(n)?o.textContent=n:Is(o),(c=r.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return i&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Mye=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",Nye={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Lye=class extends yn{constructor(){super(Nye),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(Mye)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=ss({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Ln(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return ut(e.valueFormatted)?s.textContent=e.valueFormatted:ut(e.value)?s.textContent=n:Is(s),!0}},Vye=class extends Ge{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const i=Date.now(),r=i+n,a=i+n+s,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,i=`${o}-animation`;for(const[r,a]of s){if(!r.isAlive()||!r.comp){s.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=r;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(i,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Lce(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Bye(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var $ye={moduleName:"HighlightChanges",version:lt,beans:[Vye],userComponents:{agAnimateShowChangeCellRenderer:Oye,agAnimateSlideCellRenderer:Lye},apiFunctions:{flashCells:Bye}};function Hye(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Gye(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function lB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Uye(e)),e.version=lt,e}function Uye(e){return e.cellSelection=Wye(e,"rangeSelection"),e}function Wye(e,t){if(e&&typeof e=="object")return e[t]}var zye=class extends Ge{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Fs(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Fs(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Fs(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=ts(e);const s=lB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=lB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:s,rowGroupExpansion:o,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(i,o,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Hpe(Lv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,x)=>{const O=!(s!=null&&s.has(D))&&!!(x||t==="api");return h||(h=O),O},p={},g=D=>{let x=p[D];return x||(x={colId:D},p[D]=x,x)},v={},y=f("sort",o);y&&(o==null||o.sortModel.forEach(({colId:D,sort:x},O)=>{const z=g(D);z.sort=x,z.sortIndex=O})),(y||!n)&&(v.sort=null,v.sortIndex=null);const b=f("rowGroup",i);b&&(i==null||i.groupColIds.forEach((D,x)=>{const O=g(D);O.rowGroup=!0,O.rowGroupIndex=x})),(b||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=f("aggregation",r);S&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:x})=>{g(D).aggFunc=x})),(S||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,x)=>{const O=g(D);O.pivot=!0,O.pivotIndex=x}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(E||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:D,flex:x,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const z=g(D);z.flex=x??null,z.width=O}(T||!n)&&(v.flex=null);const k=d==null?void 0:d.orderedColIds,A=!!(k!=null&&k.length)&&!(s!=null&&s.has("columnOrder")),I=A?k.map(D=>g(D)):Object.values(p);(I.length||h)&&(this.columnStates=I,Vi(this.beans,{state:I,applyOrder:A,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:i,colGroupSvc:r}=o;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Vi(o,{state:a,applyOrder:e},t)}s&&(r==null||r.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Gpe(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),s.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:i,endRow:r,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!ia(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of r.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:i,ctrlsSvc:r}=this.beans;s.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),i==null||i.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:i}=e??{page:0,pageSize:s.get("paginationPageSize")},r=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const i=t[o];xf(i,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),xf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},jye={moduleName:"GridState",version:lt,beans:[zye],apiFunctions:{getState:Hye,setState:Gye}};function Kye(e){return e.rowModel.isLastRowIndexKnown()}function qye(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Yye(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Zye(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Xye(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Jye(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Qye(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function ewe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function twe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function nwe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var swe=class extends Ge{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(fc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Fs(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},up="paginationPageSizeSelector",owe={tag:"span",cls:"ag-paging-page-size"},iwe=class extends yn{constructor(){super(owe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(up,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Is(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(up)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),i=this.gos.get(up)!==!0;qe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||qe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:up}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(nl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new tE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(up);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},rwe={selector:"AG-PAGE-SIZE-SELECTOR",component:iwe},awe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",lwe=class extends wV{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(awe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[rwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",li(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",li(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",li(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",li(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):sle(this.beans,i),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===ke.ENTER||s.key===ke.SPACE)&&(s.preventDefault(),n())}})}nle(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Upe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){vse(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*o+1,a=r+i-1,e&&a>s&&(a=s));const l=r+i-1,c=!e&&n<l,u=this.formatNumber(r);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,y;if(e)v=this.formatNumber(t),y=this.formatNumber(s);else{const b=h("more","more");v=b,y=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=y,this.announceAriaStatus(u,d,y,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${r} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},cwe={selector:"AG-PAGINATION",component:lwe},uwe=class extends Ge{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return cwe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ut(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ut(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ut(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ut(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,i=n*o;let r=n*(o+1)-1;if(r>s&&(r=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},dwe={moduleName:"Pagination",version:lt,beans:[uwe,swe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Kye,paginationGetPageSize:qye,paginationGetCurrentPage:Yye,paginationGetTotalPages:Zye,paginationGetRowCount:Xye,paginationGoToNextPage:Jye,paginationGoToPreviousPage:Qye,paginationGoToFirstPage:ewe,paginationGoToLastPage:twe,paginationGoToPage:nwe},dependsOn:[gy]};function hwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function cB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&cB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function fwe(e,t){return e.rowModel.getRowNode(t)}function pwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function gwe(e){return e.rowRenderer.getRenderedNodes()}function mwe(e,t,n){e.rowModel.forEachNode(t,n)}function vwe(e){return e.rowRenderer.firstRenderedRow}function ywe(e){return e.rowRenderer.lastRenderedRow}function wwe(e,t){return e.rowModel.getRow(t)}function Cwe(e){return e.rowModel.getRowCount()}var bwe={moduleName:"RowApi",version:lt,apiFunctions:{redrawRows:hwe,setRowNodeExpanded:cB,getRowNode:fwe,addRenderedRowListener:pwe,getRenderedNodes:gwe,forEachNode:mwe,getFirstDisplayedRowIndex:vwe,getLastDisplayedRowIndex:ywe,getDisplayedRowAtIndex:wwe,getDisplayedRowCount:Cwe}},Swe={moduleName:"ScrollApi",version:lt,apiFunctions:{getVerticalPixelRange:Mme,getHorizontalPixelRange:Nme,ensureColumnVisible:W2,ensureIndexVisible:z2,ensureNodeVisible:Lme}};function Ewe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function _we(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function Rwe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Dwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function Twe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function xwe(e){return{rowHeight:fc(e),headerHeight:Xf(e)}}function Iwe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(qf(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=JE(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!QE(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(qf(c))}}return[...s,...n]}var Fwe={moduleName:"RenderApi",version:lt,apiFunctions:{setGridAriaProperty:Ewe,refreshCells:_we,refreshHeader:Rwe,isAnimationFrameQueueEmpty:Dwe,flushAllAnimationFrames:Twe,getSizesForCurrentTheme:xwe,getCellRendererInstances:Iwe}};function Pwe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function uB({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function Awe(e,t){var n;t&&typeof t=="object"?uB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var kwe=class extends Ge{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&ts(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var c;const o=u=>ad(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=dB(this.beans),r=u=>n.leftCols.some(d=>zf(d,u)),a=u=>n.rightCols.some(d=>zf(d,u)),l=e.colKeys.filter(u=>!aa(u)&&!la(u)&&!r(u)&&!a(u));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let y=-1;const b=Object.fromEntries(c.map(({colId:E,...R})=>[E,R])),S=o??this.gos.get("skipHeaderOnAutoSize"),C=i??S;for(;y!==0;){y=0;const E=[];for(const R of s){if(!R||Foe(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const k=p.getPreferredWidthForColumn(T,S);if(k>0){const A=b[T.colId]??{};A.minWidth??(A.minWidth=l),A.maxWidth??(A.maxWidth=a);const I=Owe(T,k,A);T.setActualWidth(I,u),v.add(T),y++}E.push(T)}E.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(s,u,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,i=new Set,r=s.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||i.add(c),c=c.getParent()}let a;for(const l of i){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Ec(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=dB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):qe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...y}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=y;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=ra(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.every(y=>{if(y.colDef.suppressSizeToFit)return!0;const b=o==null?void 0:o[y.getId()],S=(b==null?void 0:b.minWidth)??(s==null?void 0:s.defaultMinWidth),C=(b==null?void 0:b.maxWidth)??(s==null?void 0:s.defaultMaxWidth),E=y.getActualWidth();return(S==null||E>=S)&&(C==null||E<=C)}))return;const l=[],c=[];for(const v of i){const y=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(b=>zf(v,b)))??!0;v.getColDef().suppressSizeToFit||!y?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Li(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const y=o==null?void 0:o[v.getId()],b=(y==null?void 0:y.minWidth)??(s==null?void 0:s.defaultMinWidth),S=(y==null?void 0:y.maxWidth)??(s==null?void 0:s.defaultMaxWidth),C=v.getActualWidth();typeof b=="number"&&C<b?v.setActualWidth(b,t,!0):typeof S=="number"&&C>S&&v.setActualWidth(S,t,!0)}for(;!d;){d=!0;const v=e-ra(c);if(v<=0)for(const y of l){const b=((g=o==null?void 0:o[y.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??y.minWidth;y.setActualWidth(b,t,!0)}else{const y=v/ra(l);let b=v;for(let S=l.length-1;S>=0;S--){const C=l[S],E=o==null?void 0:o[C.getId()],R=(E==null?void 0:E.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(E==null?void 0:E.maxWidth)??(s==null?void 0:s.defaultMaxWidth),k=C.getMinWidth(),A=C.getMaxWidth(),I=typeof R=="number"&&R>k?R:k,D=typeof T=="number"&&T<A?T:A;let x=Math.round(C.getActualWidth()*y);x<I?(x=I,h(C),d=!1):x>D?(x=D,h(C),d=!1):S===0&&(x=b),C.setActualWidth(x,t,!0),b-=x}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&ad(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:i,defaultMaxWidth:r}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function Owe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function dB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return kf(n.eGridBody)-o}var Mwe={moduleName:"ColumnAutoSize",version:lt,beans:[kwe],apiFunctions:{sizeColumnsToFit:Pwe,autoSizeColumns:uB,autoSizeAllColumns:Awe},dependsOn:[NV]},Nwe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function Lwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function Vwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Bwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function $we(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function Hwe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var Gwe={moduleName:"PinnedRow",version:lt,beans:[Ble],css:[Nwe],apiFunctions:{getPinnedTopRowCount:Lwe,getPinnedBottomRowCount:Vwe,getPinnedTopRow:Bwe,getPinnedBottomRow:$we,forEachPinnedRow:Hwe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},Uwe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},Wwe=class extends Ge{constructor(e){super(),this.column=e}buildCache(e){var S;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const y=(C,E)=>{p=C,g=null,v=E},b=C=>{const E=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!E){y(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){y(C,i.getValue(t,C));return}const R=i.getValue(t,C);if(f){const T=It(n,{valueA:v,nodeA:p,valueB:R,nodeB:C,column:t,colDef:a});if(!h(T)){y(C,R);return}}else if(d?!d(v,R):v!==R){y(C,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new Uwe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(S=o.forEachDisplayedNode)==null||S.call(o,C=>{(!r||r.isRowInPage(C.rowIndex))&&b(C)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},zwe=class extends Ge{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Fs(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Fs(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new Wwe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,i=this.spanningColumns.get(s);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(o);break;default:r=n.getRow(o)}if(r)return i.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},jwe=class extends wd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,i,r){this.eWrapper=n,super.setComp(e,t,n,s,o,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||vv(e,t.rowIndex)}setAriaRowSpan(){Sse(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(sy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},Kwe=class extends fy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new jwe(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},qwe=class extends Ge{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(i.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){i.set(u.firstNode,d),n.delete(u.firstNode);return}r=!0;const h=new Kwe(u.firstNode,this.beans,!1,!1,!1);i.set(u.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===s;if(!(!r&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},Ywe={moduleName:"CellSpan",version:lt,beans:[zwe,qwe]},Zwe=class extends Ge{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,s=n.cellClassRules,o=this.getCellClassParams(e,n);ZE(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const i of o)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return It(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},Xwe=class extends Ge{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){ZE(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new Zwe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},Jwe={moduleName:"CellStyle",version:lt,beans:[Xwe]},Qwe={moduleName:"RowStyle",version:lt,beans:[Bfe]};function eCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var tCe=class extends Ge{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:i,columns:r}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},nCe="ag-column-hover",sCe=class extends Ge{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(nCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new tCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},oCe={moduleName:"ColumnHover",version:lt,beans:[sCe],apiFunctions:{isColumnHovered:eCe}},iCe=class extends Ge{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,s=!uy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{uy.has(r)&&t(r,a)},s=(r,a)=>{uy.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:r,asyncListener:a}=s.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function rCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function aCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function lCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function cCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var uCe={moduleName:"EventApi",version:lt,apiFunctions:{addEventListener:rCe,addGlobalListener:lCe,removeEventListener:aCe,removeGlobalListener:cCe},beans:[iCe]},dCe={moduleName:"Locale",version:lt,beans:[$pe]},hCe=class extends Ge{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Fs(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=el(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const y=n==null?void 0:n.getCellSpan(g,d);if(y){if(y.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),i=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",r),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",r),(c=t.forEachDisplayedNode)==null||c.call(t,r),i&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=o.getLeftColsForRow(t);break;case"right":i=o.getRightColsForRow(t);break;case null:i=s.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:i}=e,r=this.beans,a=u=>{var b;if((b=this.beans.editSvc)!=null&&b.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=dc(s),g=d+h+f+p,y=t.offsetHeight+g;if(u<5){const S=Es(r),C=!(S!=null&&S.contains(t)),E=y==0;if(C||E){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,y,i)},l=()=>a(0);l();const c=Xa(r,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,i)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},fCe={moduleName:"RowAutoHeight",version:lt,beans:[hCe]},pCe={moduleName:"AllCommunity",version:lt,dependsOn:[rB,Cye,Fye,oge,pve,gve,mve,vve,yve,wve,Cve,fve,rme,ame,lme,ime,ume,dme,jye,zve,dwe,$V,bwe,Swe,Fwe,Mwe,Qce,Gwe,Mve,bpe,Jwe,oCe,Qwe,uCe,_pe,$ye,H2,dCe,fCe,Jce,fye,Ywe]};let hB=!1;hB||(roe.registerModules([pCe,rB]),hB=!0);class gCe{constructor(t,n){Jn(this,"gridApi",null);Jn(this,"container");Jn(this,"config");Jn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=Npe(this.container,r),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const mCe=jV.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),vCe=it({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$(null);qb(i,()=>{var v;const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=$(null),a=Z(()=>({width:"100%",height:s.height||"500px"})),l=Z(()=>({...s,theme:mCe}));function c(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new gCe(i.value,g),r.value.init(),u()}function u(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var y,b;if(!g)return;(y=r.value)==null||y.updateColumnDefs(g);const v=g.map(S=>S.field&&S.width&&!S.hide?{colId:S.field,width:S.width}:null).filter(S=>S!==null);(b=r.value)==null||b.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.value||null}return Je(()=>s.columnDefs,(g,v)=>{const y=g==null?void 0:g.filter(S=>!S.hide).map(S=>S.field).join(","),b=v==null?void 0:v.filter(S=>!S.hide).map(S=>S.field).join(",");y!==b&&d(g)},{deep:!0}),as(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),qt(()=>{c()}),as(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:i,style:cn(a.value),class:J(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function _d(e){return zM(e)}const yCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:_d(oc),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:_d(oc),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:_d(oc),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>Tf.fromType(n))],by={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},wCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},CCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:by.WIDTH,minWidth:by.WIDTH,maxWidth:by.WIDTH,cellClass:"ag-checkbox-cell",headerClass:by.HEADER_CLASS,headerComponent:mv(jX),suppressMovable:!0}),bCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},SCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=wh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=$([]),a=CCe(),l=async u=>{const d=await i(),h=new Map;d==null||d.forEach(x=>{x.width&&h.set(x.field,x.width)});const f=yCe(),p=Tf.fromType(bCe),v=((u==null?void 0:u.map(x=>{var O;return{headerName:x.name,field:`metric_${x.id}`,editable:((O=x==null?void 0:x.auth_permission)==null?void 0:O.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:mv(oc),headerComponentParams:z=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${x.id}`)}}))||[]).map(x=>Tf.fromType(x)),y=[a,...f,...v,wCe,p],b=y.filter(x=>x.pinned==="left"),S=y.filter(x=>x.pinned==="right"||x.field==="blank"),C=y.filter(x=>!x.pinned&&x.field!=="blank");if(!d||d.length===0){r.value=y;return}const E=new Map(d.map(x=>[x.field,x])),R=new Map(C.map(x=>[x.field,x])),T=[];for(const x of d)if(x.field&&R.has(x.field)){const O=R.get(x.field);T.push({...O,hide:x.hide,width:x.width}),R.delete(x.field)}const k=Array.from(R.values()),A=[...T,...k],I=b.map(x=>{const O=E.get(x.field);return O!=null&&O.width?{...x,width:O.width}:x}),D=S.map(x=>{const O=E.get(x.field);return O!=null&&O.width?{...x,width:O.width}:x});r.value=[...I,...A,...D]};Je(e,u=>l(u),{immediate:!0});const c=Ri((u,d)=>{var y,b;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(y=n==null?void 0:n.value)==null?void 0:y.getColumnDefs(),f=(b=n==null?void 0:n.value)==null?void 0:b.getColumnState().reduce((S,C)=>(S[C.colId]=Number(C.width),S),{}),p=new Map;Object.entries(f||{}).forEach(([S,C])=>{p.set(S,C)}),r.value=h||r.value;const g=h==null?void 0:h.filter(S=>!S.pinned&&S.field!=="blank"),v=(g==null?void 0:g.map(S=>({field:S.field,hide:S.hide,width:p.get(S.field)||S.width,pinned:S.pinned})))||[];d&&o(t,JSON.stringify(v))},sr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:c}},ECe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},_Ce=e=>{var x,O,z;const{showMessage:t,showErrorNetMessage:n}=lf(),s=bs(),o={domainApi:ECe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(z=(O=(x=s==null?void 0:s.appContext)==null?void 0:x.config)==null?void 0:O.globalProperties)==null?void 0:z.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Ik(i,o);r.on("call-api",V=>{V.success?t(V.apiCode,"success"):n(V)});const a=wo({}),l=$([]),c=$(!1),u=$(null),d=$(null),h=$(1),f=$(20);let p=Promise.resolve();const{setCachedUsers:g}=vK(),v=V=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:V}),y=50,b=async(V,j,ee)=>{if(!V.length)return[];const Q=F4(V,j);return(await Promise.all(Q.map(ee))).flat()},S=async V=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:V})).data.map(ee=>[ee==null?void 0:ee.id,ee.permission])}catch(j){return console.error("Failed to fetch item permissions chunk:",j),[]}},C=async(V,j)=>{try{const ee=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:V,per_page:V.length*j.length,metric_ids:j}),Q=ee.data.map(fe=>{const q=new Map(fe.item_metrics.map(L=>[L.metric_id,{value:L.value,auth_permission:L==null?void 0:L.auth_permission}])),P=Object.fromEntries(j.map(L=>[L,q.get(L)??null]));return[fe==null?void 0:fe.id,P]}),G=new Set(ee.data.map(fe=>fe==null?void 0:fe.id));for(const fe of V)if(!G.has(fe)){const q=Object.fromEntries(j.map(P=>[P,{value:null,auth_permission:void 0}]));Q.push([fe,q])}return Q}catch(ee){return console.error("Failed to fetch a chunk of metric values:",ee),V.map(G=>[G,Object.fromEntries(j.map(fe=>[fe,void 0]))])}},E=async V=>{try{const j=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:V,per_page:V.length}),ee=j.data.flatMap(Q=>Q.assignees);return g(ee),j.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch(j){return console.error("Failed to fetch a chunk of assigned users:",j),[]}},R=async V=>{if(!V.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const j=await b(V,y,S);return Object.fromEntries(j)}catch(j){return console.error("Failed to fetch item permissions:",j),{}}},T=async(V,j)=>!V.length||!j.length?{}:(p=p.then(async()=>{try{const G=[];let fe=0;for(let P=0;P<j.length;P+=5){fe++;const L=j.slice(P,P+5),te=[];for(let Fe=0;Fe<L.length;Fe++){const pe=L[Fe],ce=await b(V,y,X=>C(X,[pe]));te.push(ce),await new Promise(X=>setTimeout(X,500))}G.push(...te);const de=P+5>=j.length}const q={};for(const P of G.flat()){const[L,te]=P;q[L]||(q[L]={}),Object.assign(q[L],te)}return q}catch(ee){return console.error("Failed to fetch metric values:",ee),{}}}),p),k=async V=>{if(!V.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const j=await b(V,y,E);return Object.fromEntries(j)}catch(j){return console.error("Failed to fetch assigned users:",j),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async V=>{const{cursor:j,offset:ee,size:Q,searchQuery:G}=V;let fe=[];c.value=!0,u.value=null;try{const q=await r.getAllItem_cursor({...V,cursor:j||void 0,offset:ee||void 0,pageSize:Q||f.value,...v(G),sortBy:V.sort_by});return l.value=q.data,d.value=q.meta,h.value=q.meta.current_page||0,fe=q.data.map(P=>P==null?void 0:P.id),q}catch(q){throw u.value=q,console.error("Failed to fetch items (cursor):",q),q}finally{const q=async()=>{try{const[P,L]=await Promise.all([k(fe),R(fe)]);e.value.updateItemData({assignees:P,permission:L},fe);const te=await T(fe,e.value.metricIds);e.value.setMetricValues(te,new Set(fe),e.value.metricIds)}catch(P){console.error("Post-fetch processing failed:",P)}};c.value=!1,setTimeout(q)}},getAssignableStatus:async V=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:V})}catch(j){throw console.error("Failed to fetch assignable status:",j),j}},getMetricList:async V=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:V})}catch(j){throw console.error("Failed to fetch metric list:",j),j}},getMetricValues:T,getAssignedUsers:k}};function RCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(i.push(u),s.assignees){const h=sK((s.assignees[c]||[]).map(EF));u.data.assignees=h,r.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(c=>[c,new Map(i.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=r.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(c=>`metric_${c}`),force:!0})}}}function DCe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function TCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=$(!0),a=$(!0),l=$(!1),c=()=>{n.value=!n.value},u=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:y,setGridOption:b}=v;if(!i)return console.error("Fetcher function is undefined"),null;const S=DCe(i,e.perPage,()=>s.value,C=>{r.value=C},C=>{a.value=C});return b==null||b("datasource",S),y==null||y("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var y,b;if((y=o.value)==null||y.hideOverlay(),v!==void 0&&(s.value=v),(b=o.value)==null||b.deselectAll(),t.value=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Ri(v=>{d(v)},sr),p=()=>{o.value},g=$(!1);return{isLoading:r,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const xCe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},ICe=e=>{var t;return(t=Object.entries(xCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},FCe={key:1},PCe=St(it({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=$(null),o=e,i=()=>{s.value&&s.value.show()},r=$(""),a=$("idle"),l=$({file:null,format:null}),{apiServices:c}=Qn(!1,{}),u=$(!1),d=async()=>{u.value=!0;const T=o.workspaceId,k=o.entityId;if(!T||!k||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,k))throw new Error("No response from downloadTemplate API")}catch(A){console.error("Error downloading template:",A)}u.value=!1},h=n,f=()=>{h("import-success"),b()},p=async T=>{var I,D,x;const k=new FormData,A=((I=T.name.split(".").pop())==null?void 0:I.toString())||"";if(k.append("file",T),k.append("format",A),k.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,k),g()}catch(O){throw console.error("Error uploading file:",O),v(((x=(D=O.response)==null?void 0:D.data)==null?void 0:x.message)||"An unknown error occurred during file upload."),O}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},y=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var T;R(),(T=s.value)==null||T.hide()};t({close:b,open:i});const S=Z(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=Z(()=>l.value.file?!1:(console.error("No file selected"),!0)),E=$(null),R=()=>{var T;(T=E.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,k)=>(K(),Ke(U(Lk),{"popup-name":S.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},Yd({default:me(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ke(BM,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",FCe,[ye("div",{class:J(T.$style["step-section"])},[ye("span",{class:J(T.$style["step-title"])},"Step 1: Download current data",2),ye("span",{class:J(T.$style["step-description"])},[...k[1]||(k[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),ye("br",null,null,-1),ye("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),he(U(ht),{class:J(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:me(()=>[he(U(at),{src:"Download"})]),default:me(()=>[k[2]||(k[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),ye("div",{class:J(T.$style["step-section"])},[ye("span",{class:J(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),he(U(SO),{modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),ref_key:"filUploaderRef",ref:E},null,8,["modelValue"])],2),ye("div",{class:J(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[he($M)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:me(()=>[he(U(ht),{style:{flex:"1"},variant:"secondary",onClick:b},{default:me(()=>[...k[3]||(k[3]=[nt(" Cancel ",-1)])]),_:1}),he(U(ht),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:y},{default:me(()=>[...k[4]||(k[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:me(()=>[he(U(ht),{style:{flex:"1"},variant:"primary",onClick:f},{default:me(()=>[...k[5]||(k[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:me(()=>[he(U(ht),{style:{flex:"1"},variant:"primary",onClick:R},{default:me(()=>[...k[6]||(k[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),ACe={style:{cursor:"help"}},kCe=St(it({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=So,s=Wb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Xs(s),a=Yt,l=$(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=$(""),d=Z(()=>{var ze;const Ae=((ze=r.value)==null?void 0:ze.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ae},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ae,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ae,id:"overwrite_scenes_option"}]}),h=e;Tf.initialize({wrapVueCellRenderer:mv,wrapVueCellEditor:zM});const f=qh(),{switchInstanceFunc:p}=Xs(f);qt(()=>{const Ae=bs();p.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const ze=new BroadcastChannel("focusable_channel");Et(()=>{setTimeout(()=>{ze.postMessage("Focusable elements updated")},7e3)})});const g=$(null),v=$([]),y=Vm(),{rowCount:b}=Xs(y),S=$(!1),C=$(""),E=$(),R=LA(),{metricList:T}=Xs(R),k=$(""),A=$(!1),I=$(new Set),D=$(new Map),{apiServices:x}=Qn(!1,h),{columnDefs:O,checkboxColumn:z,saveColumnConfig:V}=SCe(T,h.entityId,g),j=$();Je(()=>O,()=>{var Ae;(Ae=j.value)==null||Ae.updateColumnDefs(O.value)},{deep:!0});const ee=(Ae,ze)=>{V(Ae,ze)},{updateRowData:Q,setMetricValues:G}=RCe(g),fe=Z(()=>({isSearching:C.value.length>0,isFiltering:!(Object.keys(Ce.value||{}).length==1&&Object.keys(Ce.value)[0]=="preflight_status")&&Object.keys(Ce.value||{}).length>0})),q=Z(om),P=Z(()=>O.value.filter(Ae=>{var ze;return((ze=Ae.field)==null?void 0:ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var ze;return((ze=Ae.field)==null?void 0:ze.replace("metric_",""))||""}));Ki("timezone",q);const L=Z(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:P.value,updateItemData:Q,setMetricValues:G})),{fetchItems:te,getMetricList:de,cusorMap:Fe,getMetricValues:pe}=_Ce(L),ce=Z(()=>{if(!g.value)return!1;const Ae=g.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),X=Z(()=>{var Ae;return((Ae=l.value)==null?void 0:Ae.name)||"Items"}),we=(Ae,ze)=>{var Qt,Gt,As;b.value.total=Ae.meta.total??0,(Qt=Ae.meta.next)!=null&&Qt.cursor&&(Fe[ze+1]=Ae.meta.next.cursor),k.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?(Gt=g.value)==null||Gt.showNoRowsOverlay():(As=g.value)==null||As.hideOverlay()},ae=bO(),Oe=$(null),{sortingAPIConfiguration:H,isSortingRunning:oe}=Xs(ae),Ce=$({preflight_status:"1"}),Me=Z(()=>({...Ce.value,search:C.value}));Ki("filterParams",Me);const Pe=$([]),M=async({page:Ae,pageSize:ze,filterText:Qt})=>{var Vo;(Vo=g.value)==null||Vo.hideOverlay();const Gt=Fe[Ae],As=!Gt&&Ae>1?(Ae-1)*ze:void 0,ma=H.value;ma.length>0&&(oe.value=!0);try{const va={cursor:Gt,size:ze,searchQuery:Qt,offset:As,sort_by:ma,...Ce.value},eo=await te(va);if(!eo)return{rows:[],total:0};const dp=(jn=>{const Fr=jn.data.map(vo=>RF(vo,q.value));return Fr.forEach(vo=>{I.value.add(String(vo.id)),D.value.set(String(vo.id),{})}),Fr})(eo);return we(eo,Ae),{rows:dp,total:b.value.total}}catch(va){return console.error("Failed to fetch items:",va),{rows:[],total:0}}finally{oe.value=!1}},{isLoading:B,toggleSidebar:ne,onGridReady:Se,handleUnSelect:Ne,handleSelectAll:Ye,onSearch:ge,firstLoad:le}=TCe({selectRowData:$([]),isSidebarOpen:S,quickFilterText:C,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:M}),Ee=$([]),Qe=()=>{var Ae;Ee.value=((Ae=g.value)==null?void 0:Ae.getSelectedRows())||[]},pt=wo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Ft=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:nn,noRowsOverlayComponent:mv(PQ),noRowsOverlayComponentParams:()=>fe.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const ze=["row-highlight"];return Ae.data.id||ze.push("row-inactive"),Ae.data.isDeleted&&ze.push("row-deleted"),Ae.data.disabled&&ze.push("row-deleted"),Ae.data.isArchived&&ze.push("row-archived"),Ae.data.isLocked&&ze.push("row-locked"),ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:x.value,sorting:oe.value},onCellKeyDown:Ae=>{var ze,Qt,Gt;if(Ae.data.isDeleted)return!1;if(((ze=Ae==null?void 0:Ae.event)==null?void 0:ze.key)==="Enter"){const{api:As,node:ma,column:Vo}=Ae,va=As.getCellRendererInstances({rowNodes:[ma],columns:[Vo]});if(va.length>0){const eo=va[0];eo&&typeof((Qt=eo.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Gt=eo.componsenExposed)==null||Gt.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var Gt;if((Gt=Ae.data)!=null&&Gt.isDeleted)return!0;const ze=Ae.event.key,Qt=Ae.editing;return Qt&&ze==="Tab"?!0:Qt&&ze==="Enter"?!1:ze==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):ze==="ArrowUp"||ze==="ArrowDown"||ze==="ArrowLeft"||ze==="ArrowRight"||ze==="Tab"||ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const ze=Ae.api.getFirstDisplayedRowIndex(),Qt=Ae.api.getLastDisplayedRowIndex();pt.rowsDisplay.fromIndex=ze,pt.rowsDisplay.toIndex=Qt,pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Gt=>Gt.getColId())},onViewportChanged:Ae=>{pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(ze=>ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),console.log("Cell editing started:",Ae),Ae.colDef.field=="options"){const ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});ze.length>0&&ze[0].focusUi()}},tabToNextCell:Ae=>{let ze=Ae.nextCellPosition;if(ze&&ze.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=Ae.api.getAllDisplayedColumns(),Gt=Qt.indexOf(ze.column),As=Ae.backwards?-1:1,ma=Qt[Gt+As];if(ma)return{rowIndex:ze.rowIndex,column:ma,rowPinned:ze.rowPinned}}return ze}}));function nn(){if(!g.value)return;let Ae=0;g.value.forEachNode(ze=>{ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}Je(()=>H,()=>{g.value&&(k.value="",I.value.clear(),g.value.deselectAll(),Object.keys(Fe).forEach(Ae=>delete Fe[Number(Ae)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Nt=$(),sn=$(),ln=()=>{var Ae;(Ae=sn.value)==null||Ae.open()},Ve=()=>{var Ae;(Ae=Nt.value)==null||Ae.open()},Ue=async()=>{le.value=!0,g.value&&(k.value="",I.value.clear(),Object.keys(Fe).forEach(Ae=>delete Fe[Number(Ae)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},bt=Z(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),kt=$(),Ut=Z(()=>{var Ae;return(Ae=ICe(bt.value))==null?void 0:Ae.map(ze=>`<div>• ${ze}</div>`).join(`
250
- `)});function tt(Ae){var ze;Ae==="new_scene"?(ze=kt.value)==null||ze.show():Ae==="import_scenes"?Ve():Ae==="overwrite_scenes"&&ln()}const Rs=Ae=>{v.value=Ae.api.getSelectedRows().map(ze=>ze.id)},$i=Ae=>{const ze=Se(Ae);return ze&&(ze.addEventListener("modelUpdated",nn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",Qe),ze.addEventListener("columnMoved",Gt=>ee(Gt,!0)),ze.addEventListener("columnResized",Gt=>ee(Gt,!0)),ze.addEventListener("firstDataRendered",()=>{le.value=!1}),!document.querySelector(".ag-body-viewport")),ze},Tr=()=>{var Ae;u.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};qt(()=>{Et(()=>{Tr()}),window.addEventListener("resize",Tr);function Ae(){requestAnimationFrame(Ae)}Ae()}),as(()=>{window.removeEventListener("resize",Tr)});const di=async({code:Ae,name:ze})=>{await ge(Ae),setTimeout(()=>{var Qt;(Qt=E.value)==null||Qt.setValue(ze)},300)},ga=Ae=>{if(!g.value)return;const ze=g.value.getRowNode(Ae);ze?(g.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),g.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},hl=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await de(h.entityId);T.value=Ae.data.map(ze=>({...ze,sortType:hl(ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},Ir=async()=>{if(x.value)try{const Ae=await x.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},hi=async()=>{if(x.value)try{const Ae=await x.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Hi=rv(),{setUser:Rd}=Hi,An=async()=>{if(x.value)try{const Ae=await x.value.getMe();return Rd(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},fs=async()=>{var Ae;if(x.value)try{const ze=await x.value.getWorkspaces(h.workspaceId),Qt=(Ae=ze.data[0])==null?void 0:Ae.ws_user_role_id;return Qt&&Hi.setUserRoleId(Qt),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Je(()=>[h.entityId,h.workspaceId],async([Ae,ze])=>{!Ae||!ze||(An(),fs(),xr(),Ir(),hi())},{immediate:!0,deep:!0}),Je(P,(Ae,ze)=>{const Qt=Ae.filter(Gt=>!(ze!=null&&ze.includes(Gt)));Qt.length>0&&pe(Array.from(I.value),Qt).then(Gt=>{G(Gt,I.value,Qt)})},{immediate:!0,deep:!0}),Je(k,(Ae,ze)=>{A.value=!!(ze&&Ae&&ze!==Ae)}),t({refreshTable:Ue});const v_=Ae=>{Ce.value=Ae,Ue()},Dd=Ae=>{Pe.value=Ae,Ue()},Td=Ae=>{O.value=Ae||[],ee({},!0)},xd=Z(()=>{var Gt;const Ae=En.getInstance().getItem("ws.terminology"),ze=Ae?JSON.parse(Ae):null;return`New ${((Gt=ze==null?void 0:ze.find(As=>As.code==="scene"))==null?void 0:Gt.name)||"Scene"}`});return(Ae,ze)=>{const Qt=oo("focusable");return K(),Ke(U(HX),{"is-sidebar-open":S.value,onCloseSidebar:U(ne),onSidebarClear:U(ne),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(ne)},{"header-left":me(()=>{var Gt;return[((Gt=U(r))==null?void 0:Gt.has_create_item_permission)==1?(K(),Ke(U(lS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:ze[1]||(ze[1]=As=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[We(he(U(ht),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=As=>tt("new_scene")),label:xd.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0),ye("div",{class:J(Ae.$style["beta-tag"])},"Beta",2),We((K(),ie("span",ACe,[nt(yt(bt.value),1)])),[[U(a),Ut.value||""]])]}),"header-actions":me(()=>[he(U(fee),{"onUpdate:assignees":Dd,onApplyFilter:v_,loading:U(le),entityId:h.entityId},null,8,["loading","entityId"]),We(he(U(Zb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":ze[2]||(ze[2]=Gt=>C.value=Gt),onSearch:U(ge),class:J(Ae.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Gt=>U(ge)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(le),fullwidth:!0}]]),We((K(),Ke(U(kA),{status:U(B)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":A.value},{default:me(()=>[We((K(),Ke(U(ht),{variant:["secondary","icon"],disabled:U(B),onClick:Ue},{default:me(()=>[he(U(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(le),fullwidth:!0}]]),We(he(U(fQ),{"model-value":U(O),onChange:ze[4]||(ze[4]=Gt=>Td(Gt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:j,"checkbox-column":U(z),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(le),fullwidth:!0}]])]),grid:me(({availableHeight:Gt})=>[he(U(vCe),Zt({id:"item_table_main",ref_key:"agGrid",ref:Oe},Ft.value,{height:Gt+"px",isSorting:U(oe),onOnGridReady:$i,onSelectionChanged:Rs}),null,16,["height","isSorting"])]),footer:me(()=>[ye("div",{class:J(Ae.$style.tableFooter),id:"table_footer"},[ye("span",null,[ze[5]||(ze[5]=nt(" Showing ",-1)),ye("b",null,yt(U(b).loaded)+" of "+yt(U(b).total),1)])],2)]),"new-row":me(()=>[he(U(WQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:di,onFocusOnId:ga},null,512)]),"bulk-update-actions":me(()=>[We(he(U(kX),{selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ne),onSelectAll:U(Ye),"take-name":X.value,"selected-all":ce.value,"total-rows":U(b).total,"visible-rows":U(b).loaded,onUpdated:Qe,loading:U(B)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Ei,!S.value&&v.value.length>0]])]),snackbar:me(()=>[he(U(EJ))]),popup:me(()=>[he(Zne,{ref_key:"popupCreateSceneRef",ref:Nt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"]),he(PCe,{ref_key:"popupOverwriteScenesRef",ref:sn,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),fB="0.1.79",OCe={key:0},MCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=wo({id:"",workspaceId:"",apiConfig:{}}),s=lf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=$(null),c=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Yp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",fB);try{if(l.value=bs(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||En.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:En.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ik(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),as(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return Ki("workspaceId",d),Ki("entityId",u),(h,f)=>(K(),ie("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",OCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ke(U(kCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),m_=async(e={},t={})=>{const n=w1(MCe),s=Gq();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${fB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",Gr);const r=await Kne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=m_),kn.default=m_,kn.initDashboard=m_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
252
+ `)});function tt(Ae){var ze;Ae==="new_scene"?(ze=kt.value)==null||ze.show():Ae==="import_scenes"?Ve():Ae==="overwrite_scenes"&&ln()}const Rs=Ae=>{v.value=Ae.api.getSelectedRows().map(ze=>ze.id)},$i=Ae=>{const ze=Se(Ae);return ze&&(ze.addEventListener("modelUpdated",nn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",Qe),ze.addEventListener("columnMoved",Gt=>ee(Gt,!0)),ze.addEventListener("columnResized",Gt=>ee(Gt,!0)),ze.addEventListener("firstDataRendered",()=>{le.value=!1}),!document.querySelector(".ag-body-viewport")),ze},Tr=()=>{var Ae;u.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};qt(()=>{Et(()=>{Tr()}),window.addEventListener("resize",Tr);function Ae(){requestAnimationFrame(Ae)}Ae()}),as(()=>{window.removeEventListener("resize",Tr)});const di=async({code:Ae,name:ze})=>{await ge(Ae),setTimeout(()=>{var Qt;(Qt=E.value)==null||Qt.setValue(ze)},300)},ga=Ae=>{if(!g.value)return;const ze=g.value.getRowNode(Ae);ze?(g.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),g.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},hl=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await de(h.entityId);T.value=Ae.data.map(ze=>({...ze,sortType:hl(ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},Ir=async()=>{if(x.value)try{const Ae=await x.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},hi=async()=>{if(x.value)try{const Ae=await x.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Hi=rv(),{setUser:Rd}=Hi,An=async()=>{if(x.value)try{const Ae=await x.value.getMe();return Rd(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},fs=async()=>{var Ae;if(x.value)try{const ze=await x.value.getWorkspaces(h.workspaceId),Qt=(Ae=ze.data[0])==null?void 0:Ae.ws_user_role_id;return Qt&&Hi.setUserRoleId(Qt),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Je(()=>[h.entityId,h.workspaceId],async([Ae,ze])=>{!Ae||!ze||(An(),fs(),xr(),Ir(),hi())},{immediate:!0,deep:!0}),Je(P,(Ae,ze)=>{const Qt=Ae.filter(Gt=>!(ze!=null&&ze.includes(Gt)));Qt.length>0&&pe(Array.from(I.value),Qt).then(Gt=>{G(Gt,I.value,Qt)})},{immediate:!0,deep:!0}),Je(k,(Ae,ze)=>{A.value=!!(ze&&Ae&&ze!==Ae)}),t({refreshTable:Ue});const v_=Ae=>{Ce.value=Ae,Ue()},Dd=Ae=>{Pe.value=Ae,Ue()},Td=Ae=>{O.value=Ae||[],ee({},!0)},xd=Z(()=>{var Gt;const Ae=En.getInstance().getItem("ws.terminology"),ze=Ae?JSON.parse(Ae):null;return`New ${((Gt=ze==null?void 0:ze.find(As=>As.code==="scene"))==null?void 0:Gt.name)||"Scene"}`});return(Ae,ze)=>{const Qt=oo("focusable");return K(),Ke(U(HX),{"is-sidebar-open":S.value,onCloseSidebar:U(ne),onSidebarClear:U(ne),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(ne)},{"header-left":me(()=>{var Gt;return[((Gt=U(r))==null?void 0:Gt.has_create_item_permission)==1?(K(),Ke(U(lS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:ze[1]||(ze[1]=As=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[We(he(U(ht),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=As=>tt("new_scene")),label:xd.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0),ye("div",{class:J(Ae.$style["beta-tag"])},"Beta",2),We((K(),ie("span",ACe,[nt(yt(bt.value),1)])),[[U(a),Ut.value||""]])]}),"header-actions":me(()=>[he(U(fee),{"onUpdate:assignees":Dd,onApplyFilter:v_,loading:U(le),entityId:h.entityId},null,8,["loading","entityId"]),We(he(U(Zb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":ze[2]||(ze[2]=Gt=>C.value=Gt),onSearch:U(ge),class:J(Ae.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Gt=>U(ge)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(le),fullwidth:!0}]]),We((K(),Ke(U(kA),{status:U(B)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":A.value},{default:me(()=>[We((K(),Ke(U(ht),{variant:["secondary","icon"],disabled:U(B),onClick:Ue},{default:me(()=>[he(U(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(le),fullwidth:!0}]]),We(he(U(fQ),{"model-value":U(O),onChange:ze[4]||(ze[4]=Gt=>Td(Gt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:j,"checkbox-column":U(z),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(le),fullwidth:!0}]])]),grid:me(({availableHeight:Gt})=>[he(U(vCe),Zt({id:"item_table_main",ref_key:"agGrid",ref:Oe},Ft.value,{height:Gt+"px",isSorting:U(oe),onOnGridReady:$i,onSelectionChanged:Rs}),null,16,["height","isSorting"])]),footer:me(()=>[ye("div",{class:J(Ae.$style.tableFooter),id:"table_footer"},[ye("span",null,[ze[5]||(ze[5]=nt(" Showing ",-1)),ye("b",null,yt(U(b).loaded)+" of "+yt(U(b).total),1)])],2)]),"new-row":me(()=>[he(U(WQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:di,onFocusOnId:ga},null,512)]),"bulk-update-actions":me(()=>[We(he(U(kX),{selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ne),onSelectAll:U(Ye),"take-name":X.value,"selected-all":ce.value,"total-rows":U(b).total,"visible-rows":U(b).loaded,onUpdated:Qe,loading:U(B)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Ei,!S.value&&v.value.length>0]])]),snackbar:me(()=>[he(U(EJ))]),popup:me(()=>[he(Zne,{ref_key:"popupCreateSceneRef",ref:Nt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"]),he(PCe,{ref_key:"popupOverwriteScenesRef",ref:sn,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),fB="0.1.80",OCe={key:0},MCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=wo({id:"",workspaceId:"",apiConfig:{}}),s=lf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=$(null),c=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Yp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",fB);try{if(l.value=bs(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||En.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:En.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ik(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),as(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return Ki("workspaceId",d),Ki("entityId",u),(h,f)=>(K(),ie("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",OCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ke(U(kCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),m_=async(e={},t={})=>{const n=w1(MCe),s=Gq();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${fB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",Gr);const r=await Kne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=m_),kn.default=m_,kn.initDashboard=m_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});