@arbocollab/arbo-plugin-item-table 0.1.241 → 0.1.242

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.
@@ -144,7 +144,7 @@ This will fail in production.`);i=du,i._s.has(e)||(s?Fb(e,t,o,i):gA(e,o,i),ee.en
144
144
  transform: translate(-50%, -50%);
145
145
  z-index: ${i};
146
146
  display: block;
147
- `},u=()=>{const p=xv(n),g=e.zIndex?e.zIndex-1:998;if(t.centered&&p){if(r.value=!0,l(p),t.showOverlay){const v=()=>{t.closeOnOverlayClick&&c()};a=AO(t.overlayOpacity,g,v)}}else if(s.value&&(s.value.show(),r.value=!0,t.showOverlay)){const v=()=>{t.closeOnOverlayClick&&c()};a=AO(t.overlayOpacity,g,v)}},c=()=>{const p=xv(n);t.centered&&p?(r.value=!1,p.style.display="none",t.showOverlay&&(uE(a||void 0),a=null)):s.value&&(s.value.hide(),r.value=!1,t.showOverlay&&(uE(a||void 0),a=null))},d=()=>{r.value?c():u()},h=()=>{s.value&&(s.value.destroy(),s.value=null),t.showOverlay&&a&&(uE(a),a=null)},f=()=>{var v;const p=xv(n);if(!p)return;if(p.style.display="none",t.centered){t.showOnInit&&u();return}const g={content:p,placement:t.placement,theme:t.theme,trigger:t.trigger,interactive:t.interactive,appendTo:t.appendTo,arrow:t.showArrow,allowHTML:!0,hideOnClick:!1,popperOptions:{...t.popperOptions,modifiers:[...((v=t.popperOptions)==null?void 0:v.modifiers)||[],{name:"computeStyles",options:{adaptive:!1}}]},onShow(){r.value=!0,p.style.display="block"},onHide(){r.value=!1}};if(t.useTrigger){const w=xv(o);if(!w)return;s.value=tl(w,g)}else{const w=document.createElement("div");w.style.display="none",document.body.appendChild(w),s.value=tl(w,g)}t.showOnInit&&u()};return Xt(()=>{f()}),Vn(()=>{h()}),Qe(()=>t.alwaysShow,p=>{p?u():c()},{immediate:!0}),{popupRef:n,triggerRef:o,instance:s,isVisible:r,show:u,hide:c,toggle:d,destroy:h}}const cE=Ja("permissionStore",()=>{const e=$([]),t=$(),n=$({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),xJ="woohoo_getWoohooUserInterface_read",dE="media_getReviewUserInterface_read",AJ="update_getUpdateUserInterface_read",PO="Unarchive parent folder first to continue",PJ=(e,t,n,o,s,r)=>{const i=cE(),{userPermissions:a}=go(i),l=X(()=>{const T=un.getInstance().getItem("BASE_URL"),F=un.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:L,entity_id:x,scene_id:P}=e.value;return{baseDomain:T||"",ws_code:L||"",entity_id:x||"",scene_id:P||"",reviewDomain:F||"",take_id:x||"",woohoo_id:x||"",parent_id:x||""}}),u=X(()=>{var F;const T=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(dE),canCopyLink:!0,canRename:(T==null?void 0:T.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(dE),canOpenTakeInUpdate:a.value.includes(AJ),canOpenTakeInWoohoo:a.value.includes(xJ),canDeleteRendition:((F=T==null?void 0:T.media)==null?void 0:F.has_delete_rendition_permission)??!1,canDeleteThumbnail:(T==null?void 0:T.has_edit_thumbnail_permission)??!1,canArchiveScene:T==null?void 0:T.has_archive_permission,canUnarchiveScene:T==null?void 0:T.has_archive_permission,canDeleteScene:(T==null?void 0:T.has_delete_permission)??!1,canEditDescription:(T==null?void 0:T.has_edit_permission)??!1}}),c=X(()=>({project:es({type:"project",config:l.value}).url,take_review:es({type:"review_take",config:l.value}).url,review:es({type:"review_scene",config:l.value}).url,review_scene:es({type:"review_scene",config:l.value}).url,woohoo:es({type:"woohoo",config:l.value}).url,update:es({type:"update",config:l.value}).url,scene_hub:es({type:"scene_hub",config:l.value}).url})),d=(T,F)=>{const L=T.metaKey||T.ctrlKey,x=c.value[F]||"";if(x){if(F==="scene_hub"){if(L){window.open(x,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}L?window.open(x,"_blank"):window.location.href=x}},h=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(x==null?void 0:x.message)!="Done"&&console.error("Failed to delete rendition.")}catch(x){console.error("Error deleting rendition",x)}finally{s()}},f=async(T,F)=>{var L;try{await((L=e.value.axiosService.value)==null?void 0:L.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(x){console.error("Error deleting thumbnail",x)}finally{s()}},p=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(x==null?void 0:x.message)!="Done"&&console.error("Failed to archive scene."),F&&F("archived")}catch(x){console.error("Error archiving item",x)}finally{s()}},g=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(x==null?void 0:x.message)!="Done"&&console.error("Failed to delete scene."),F&&F("deleted")}catch(x){console.error("Error deleting item",x)}finally{s()}},v=T=>{const F=c.value.scene_hub||"";F&&(E.value="Copied",navigator.clipboard.writeText(F),setTimeout(()=>{E.value="Copy link"},5e3))},w=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(x==null?void 0:x.message)!="Done"&&console.error("Failed to unarchive scene."),F&&F("unarchived")}catch(x){console.error("Error unarchiving item",x)}finally{s()}},S=T=>p(T,t),b=T=>w(T,t),y=T=>g(T,t),E=$("Copy link"),_=T=>d(T,"review"),I=X(()=>{let T=[];if(!l.value.scene_id&&e.value.optionBlock&&T.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const F=()=>Math.random().toString(36).substring(2,9);return[{id:F(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:_,hide:!u.value.canOpenReview,disabled:!u.value.canOpenReview,description:"",type:"icon"},{id:F(),label:E.value,icon:"Link",action:v,hide:!u.value.canCopyLink,disabled:!u.value.canCopyLink,description:"",type:"icon"}]},{id:F(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:u.value.canArchiveScene==0,disabled:u.value.canArchiveScene!==1,description:u.value.canArchiveScene==-1?PO:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:u.value.canUnarchiveScene==0,disabled:u.value.canUnarchiveScene!==1,description:u.value.canUnarchiveScene===-1?PO:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:y,hide:!u.value.canDeleteScene,type:"icon"}]}]});return{linkMap:c,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:w,options:I}};function xo(e){const t=$(!1),n=$(!1),o=X(()=>{var d;const u=e.value,c=!!u.readOnly;return{readOnly:c,disabled:!!u.disabled,hovered:n.value,focused:t.value,isEmpty:u.empty??!1,error:!!u.error,actived:!!((d=u.active)!=null&&d.value),clickable:c?!1:u.clickable??!1}}),s=()=>{t.value=!0,ht(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return Xt(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",s),u.addEventListener("blur",r)),c&&(c.addEventListener("mouseenter",i),c.addEventListener("mouseleave",a))}),Vn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",s),u.removeEventListener("blur",r)),c&&(c.removeEventListener("mouseenter",i),c.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const ld=e=>{const t=$(!1),n=X(()=>t.value);return Xt(()=>{var a,l,u,c;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(c=(u=e.params)==null?void 0:u.colDef)==null?void 0:c.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),Qe(()=>e,()=>{e.isEditing!==void 0&&(t.value=e.isEditing)}),{isEditing:n}};var fs=(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))(fs||{});const Gf=Ja("bulkUpdate",()=>{const e=$(Ft.UNCHECK),t=Fo({loaded:0,total:0}),n=c=>{t.total=c},o=c=>{t.loaded=c},s=Fo({isBulkUpdating:!1});function r(c){s.isBulkUpdating=c}const i=$({}),a=c=>{i.value=c},l=(c,d)=>{i.value[c]=d},u=c=>{e.value=c};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:u,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{u(Ft.CHECKED)}}}),kJ={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{error:"Deletion failed. Please try again."},delete_thumbnail:{error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{},bulkRename:{},bulkCreate:{}},offline:{error:"You are currently offline. Please check your network connection."}};function kO(e,t,n){return(t=OJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OJ(e){var t=FJ(e,"string");return typeof t=="symbol"?t:t+""}function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var FO=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function OO(e){return Du(e)==="object"&&e!==null&&!Array.isArray(e)}function MO(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function MJ(e){return typeof Blob<"u"&&e instanceof Blob}var NJ=function(t){return OO(t)&&MO(t,["file","fileName"])&&MJ(t.file)&&typeof t.fileName=="string"},LJ=function(t){return OO(t)&&MO(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"};Object.freeze(kO(kO({},FO.TOOLBOX_EXPORT_DATA,NJ),FO.SW_APP_LOADER,LJ));let VJ=class extends Error{},dl=class extends VJ{constructor(){super("Zone is an abstract class")}},NO=class{get type(){throw new dl}get name(){throw new dl}get ianaName(){return this.name}get isUniversal(){throw new dl}offsetName(t,n){throw new dl}formatOffset(t,n){throw new dl}offset(t){throw new dl}equals(t){throw new dl}get isValid(){throw new dl}};const hE=new Map;function BJ(e){let t=hE.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),hE.set(e,t)),t}const $J={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function HJ(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,u,c]=o;return[i,s,r,a,l,u,c]}function GJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=$J[r];r==="era"?o[a]=i:Av(a)||(o[a]=parseInt(i,10))}return o}const fE=new Map;let UJ=class UT extends NO{static create(t){let n=fE.get(t);return n===void 0&&fE.set(t,n=new UT(t)),n}static resetCache(){fE.clear(),hE.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=UT.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return KJ(t,n,o,this.name)}formatOffset(t,n){return kv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=BJ(this.name);let[s,r,i,a,l,u,c]=o.formatToParts?GJ(o,n):HJ(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=jJ({year:s,month:r,day:i,hour:l===24?0:l,minute:u,second:c,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},pE=null,WJ=class bg extends NO{static get utcInstance(){return pE===null&&(pE=new bg(0)),pE}static instance(t){return t===0?bg.utcInstance:new bg(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new bg(VO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${kv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${kv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return kv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function Av(e){return typeof e>"u"}function Pv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function LO(e){if(!(Av(e)||e===null||e===""))return parseInt(e,10)}function zJ(e){if(!(Av(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function jJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function KJ(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function VO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function kv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Pv(n,2)}:${Pv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Pv(n,2)}${Pv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const BO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ud(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function cd(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function $O(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=LO(t[n+s]);return[o,null,n+s]}}const HO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,qJ=`(?:${HO.source}?(?:\\[(${BO.source})\\])?)?`,GO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,UO=RegExp(`${GO.source}${qJ}`),gE=RegExp(`(?:[Tt]${UO.source})?`),YJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,XJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ZJ=/(\d{4})-?(\d{3})/,JJ=$O("weekYear","weekNumber","weekDay"),QJ=$O("year","ordinal"),eQ=/(\d{4})-(\d\d)-(\d\d)/,WO=RegExp(`${GO.source} ?(?:${HO.source}|(${BO.source}))?`),tQ=RegExp(`(?: ${WO.source})?`);function dd(e,t,n){const o=e[t];return Av(o)?n:LO(o)}function nQ(e,t){return[{year:dd(e,t),month:dd(e,t+1,1),day:dd(e,t+2,1)},null,t+3]}function hd(e,t){return[{hours:dd(e,t,0),minutes:dd(e,t+1,0),seconds:dd(e,t+2,0),milliseconds:zJ(e[t+3])},null,t+4]}function Uf(e,t){const n=!e[t]&&!e[t+1],o=VO(e[t+1],e[t+2]),s=n?null:WJ.instance(o);return[{},s,t+3]}function Wf(e,t){const n=e[t]?UJ.create(e[t]):null;return[{},n,t+1]}ud(YJ,gE),ud(XJ,gE),ud(ZJ,gE),ud(UO),cd(nQ,hd,Uf,Wf),cd(JJ,hd,Uf,Wf),cd(QJ,hd,Uf,Wf),cd(hd,Uf,Wf),cd(hd),ud(eQ,tQ),ud(WO),cd(hd,Uf,Wf);var Mo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Mo||{});Mo.review,Mo.review_take,Mo.review_scene,Mo.review_rendition,Mo.review_frame,Mo.review_rendition_comment,Mo.review_comment,Mo.scene_hub,Mo.hub_rendition,Mo.hub_comment,Mo.people_insight,Mo.people_detail,Mo.project,Mo.woohoo,Mo.update,Mo.core,Mo.project_focusMode;var mE=null;function oQ(e){mE=e}function Fv(){if(!mE)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return mE}function Ov(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function zO(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=Fv();return"".concat(Ov(t.t("errorMessages.fallback.unknownError"))," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function sQ(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&Du(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function rQ(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function jO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function KO(e,t){if(!e||Du(e)!=="object")return null;try{var n=Fv();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var u=l.rule,c=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var w,S=t.toUpperCase();v=(w=p[g])===null||w===void 0||(w=w.errorMessages)===null||w===void 0||(w=w[S])===null||w===void 0||(w=w.validation_rules)===null||w===void 0?void 0:w[u]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[u]}if(v&&typeof v=="string")return Ov(sQ(v,a,c,d))}catch(y){console.error("Error in validation rules",y)}}}}catch(y){return console.error("Error in getValidationErrorMessage:",y),null}return null}function qO(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return zO();var n=e.code,o=e.error,s=e.details,r=e.message;if(jO(s)&&s){var i=KO(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=Fv();return Ov(a.t("errorMessages.GEN.validation_error"))}catch{return"Validation error occurred."}}if(o&&Du(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var u,c,d,h="errorMessages.".concat(l,".").concat(o.key),f=Fv(),p=((u=f.messages)===null||u===void 0?void 0:u.value)||f.messages,g=((c=f.locale)===null||c===void 0?void 0:c.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var w=v;return s!=null&&s.context&&(w=rQ(w,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",w)),w=Ov(w),n!==""?"[".concat(n,"] ").concat(w," ").concat(t):"".concat(w," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&Du(o)!=="object"&&jO(s)){var S=KO(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):zO()}const Rs=Ja("toast",()=>{const e=u=>qO(u),t=u=>{var c;if((u==null?void 0:u.apiCode)==="offline")r({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const d=qO((c=u==null?void 0:u.res)==null?void 0:c.data);r({id:u==null?void 0:u.apiCode,type:"error",message:d})}},n=$([]),o=(u,c)=>{const d=kJ[u];if(d){const h=d[c];if(h){r({id:u,type:c,message:h});return}}else r({id:u,type:c,message:u})},s=new Map,r=(u,c=5e3)=>{const d={...u,id:u.id??Date.now()+Math.random()};if(n.value.push(d),c>0){const h=Date.now(),f=setTimeout(()=>{i(d.id),s.delete(d.id)},c);s.set(d.id,{timeoutId:f,remainingTime:c,startTime:h})}};function i(u){n.value=n.value.filter(d=>d.id!==u);const c=s.get(u);c&&(clearTimeout(c.timeoutId),s.delete(u))}function a(u){const c=s.get(u);if(c){clearTimeout(c.timeoutId);const d=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-d)}}function l(u){const c=s.get(u);if(c&&c.remainingTime>0){const d=setTimeout(()=>{i(u),s.delete(u)},c.remainingTime);c.timeoutId=d,c.startTime=Date.now()}}return{notifications:n,addNotification:r,removeNotification:i,showMessage:o,showErrorNetMessage:t,pauseAutoDismiss:a,resumeAutoDismiss:l,getErrorMessageFromResponse:e}}),vE=Ja("sortStore",()=>{const e=$({}),t=$(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}};return{sortingAPIConfiguration:X(()=>{const u=e.value;return Object.values(u).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),sorts:e,setSort:(u,c)=>{e.value={[u]:{colId:u,sort:c}}},clearSorting:()=>{e.value={}},isSortingRunning:$(!1),defaultSortStorePreferences:t,setDefaultSort:u=>{t.value=u}}}),yE=10,wE=5,Ei={number:{first:"000",step:"1"},letter:{first:"A",step:"1"}},YO={up:{first:"Start at",step:"Increase by"},down:{first:"End at",step:"Decrease by"}},iQ=/^[0-9]$/,aQ=/^[A-Za-z]$/,XO=(e,t)=>t==="first"&&e==="letter"?aQ:iQ,ZO=(e,t,n)=>XO(e,t).test(n),lQ=e=>e==="first"?yE:wE,uQ=e=>e&&e[0]===e[0].toLowerCase()?e.toLowerCase():e.toUpperCase(),JO=(e,t,n)=>{const o=XO(e,t),s=Array.from(n).filter(r=>o.test(r)).join("").slice(0,lQ(t));return t==="first"&&e==="letter"?uQ(s):s},Mv=(e,t)=>t!==""&&(e==="first"||Number(t)>0),cQ=e=>Array.from(e.toUpperCase()).reduce((t,n)=>t*26+(n.charCodeAt(0)-64),0),dQ=e=>{let t="",n=e;for(;n>0;){const o=(n-1)%26;t=String.fromCharCode(65+o)+t,n=Math.floor((n-1)/26)}return t},CE=({type:e,direction:t,first:n,step:o,count:s})=>{const r=Number(o)||1,i=u=>(t==="up"?u:s-1-u)*r;if(e==="number"){const u=Number(n);return Array.from({length:s},(c,d)=>String(u+i(d)).padStart(n.length,"0"))}const a=cQ(n),l=n!==""&&n[0]===n[0].toLowerCase();return Array.from({length:s},(u,c)=>{const d=dQ(a+i(c));return l?d.toLowerCase():d})},hQ="Your update is queued. Reload the table later to see the changes.",bE="Update failed.",fQ=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]),pQ=(e,t,n)=>{const o=e.getRowNode(t);o&&o.setData({...o.data,...n})},gQ=(e,{currentName:t,counterValue:n})=>e.map(o=>{switch(o.type){case"text":return o.value;case"current_name":return t;case"counter":return n;default:return""}}).join(""),mQ=(e,t)=>{const n=e.find(o=>o.type==="counter");return n?CE({type:n.format,direction:n.direction==="asc"?"up":"down",first:n.value,step:n.step,count:t}):[]},QO=(e,t,n)=>Rs().addNotification({id:n,type:e,message:t}),vQ=(e,t,n={})=>{const o=Gf(),{selectionStatus:s}=go(o),{sortingAPIConfiguration:r}=go(vE()),i=X(()=>s.value===Ft.CHECKED),a=X(()=>e.selectRowData.map(se=>se.id)),l=X(()=>e.selectRowData.length>0),{apiServices:u}=so(!1,e),c=Dn("filterParams",void 0),d=X(()=>({workspaceId:String(e.workspaceId),itemIds:l.value&&i.value?[]:a.value,entityId:e.entityId,filterParams:c!=null&&c.value?c.value:void 0})),h=$(!0),f=$(!1);let p=null;const g=se=>{var A,j;if(!se.apiCode||!fQ.has(se.apiCode))return;const Z=(A=se.res)==null?void 0:A.data;p={success:se.success,status:(j=se.res)==null?void 0:j.status,data:typeof Z=="object"&&Z!==null?Z:void 0,error:se.error}};Qe(u,(se,Z)=>{Z==null||Z.off("call-api",g),se==null||se.on("call-api",g)},{immediate:!0}),Vn(()=>{var se;return(se=u.value)==null?void 0:se.off("call-api",g)}),Qe(()=>e.selectRowData,()=>{h.value=!1},{deep:!0,immediate:!0});const v=()=>{p=null},w=se=>{var xe,ue;const Z=p,A=Z==null?void 0:Z.data,j=(Z==null?void 0:Z.error)??se,ne=(A==null?void 0:A.message)??((ue=(xe=j==null?void 0:j.response)==null?void 0:xe.data)==null?void 0:ue.message),ge=typeof ne=="string"&&ne.trim()?ne:bE;QO("error",ge,"bulk-update-error")},S=(se,Z,A,j)=>{se.length!==0&&(se.forEach(ne=>{const ge=Z.getRowNode(ne);ge&&ge.setData({...ge.data,...A})}),Z.refreshCells({...j.length>0?{columns:j}:{},force:!0}))},b=se=>{const Z=e.gridApi;if(Z){if(i.value){Z.deselectAll();return}se.forEach(A=>{var j;return(j=Z.getRowNode(A))==null?void 0:j.setSelected(!1)})}},y=({ids:se,apply:Z,columns:A,isDelete:j=!1})=>{var Y;let ne=se;se.length==0&&(ne=e.selectRowData.map(re=>re.id)??[]),console.log("Finishing bulk action for ids:",{ids:ne,columns:A,isDelete:j,selectedRows:e.selectRowData,lastOutcome:p});const ge=p;if((ge==null?void 0:ge.status)!==fs.ACCEPTED){Z(),j&&b(ne);return}QO("white",hQ,"bulk-update-queued");const xe=(Y=ge.data)==null?void 0:Y.bulk_process;let ue;typeof(xe==null?void 0:xe.state)=="number"?ue=xe.state:ue=j?0:1;const K=e.gridApi;K&&(ne.forEach(re=>pQ(K,re,{isProcessing:{state:ue,message:typeof(xe==null?void 0:xe.message)=="string"?xe.message:""}})),K.refreshCells({columns:[...A,"name"],force:!0})),(j||ue==0)&&b(ne)},E=async({request:se,apply:Z,columns:A,isDelete:j=!1})=>{var xe,ue,K;const ne=a.value,ge=e.gridApi;if(!ge){console.error("Grid API is not available for bulk action.");return}v();try{const Y=se();if(!Y)throw new Error("Bulk update service is unavailable.");await Y}catch(Y){console.error("Bulk action failed:",Y),w(Y),(xe=t.value)==null||xe.open();return}if((p==null?void 0:p.success)===!1){const Y=p.error??new Error(bE);console.error("Bulk action failed:",Y),w(Y),(ue=t.value)==null||ue.open();return}y({ids:ne,columns:A,isDelete:j,apply:()=>Z(ne,ge)}),(K=t.value)==null||K.hide()},_=({itemIds:se,data:Z,isUpdateAll:A})=>{let j=se;A&&(console.log("Bulk update for all items with data:",Z),j=a.value),console.log("Handling bulk update for status with itemIds:",j,"and data:",Z);const ne=e.gridApi;if(!ne){console.error("Grid API is undefined");return}y({ids:j,columns:["status"],apply:()=>{S(j,ne,{status:Z},["status"])}})},I=({itemIds:se,data:Z})=>{var j;const A=e.gridApi;if(!A){console.error("Grid API is undefined");return}y({ids:se,columns:["dateRange","name"],apply:()=>{let ne=se;console.log("Applying bulk date update for itemIds:",se,"with data:",Z),(!se||se.length===0)&&(console.warn("No itemIds provided for bulk date update."),ne=e.selectRowData.map(ge=>ge.id)),ne.forEach(ge=>{const xe=A.getRowNode(ge);if(xe){const ue=[...xe.data.dateRange||[null,null]];"startDate"in Z&&Z.startDate!==void 0&&(ue[0]=Z.startDate?new Date(Z.startDate):null),"dueDate"in Z&&Z.dueDate!==void 0&&(ue[1]=Z.dueDate?new Date(Z.dueDate):null),xe.setData({...xe.data,dateRange:ue})}})}}),(j=n.onUpdated)==null||j.call(n)},T=se=>{var ne;const Z=e.gridApi,{id:A,value:j}=se;if(!Z){console.error("Grid API is undefined");return}y({ids:a.value,columns:[`metric_${A}`,"name"],apply:()=>{S(a.value,Z,{[`metric_${A}`]:j},[`metric_${A}`])}}),(ne=n.onUpdated)==null||ne.call(n)},F=se=>{const{assignees:Z,type:A}=se,j=e.gridApi;if(!j){console.error("Grid API is not available for bulk update.");return}const ne=new Set(Z.map(xe=>xe.id)),ge=xe=>{const ue=j.getRowNode(xe);if(!ue)return;const K=ue.data.assignees||[];let Y=[];switch(A){case"add":{const re=new Set(K.map(R=>R.id));Y=[...K,...Z.filter(R=>!re.has(R.id))];break}case"overwrite":Y=Z;break;case"remove":Y=K.filter(re=>!ne.has(re.id));break;case"removeAll":Y=[];break}ue.setData({...ue.data,assignees:Y})};y({ids:a.value,columns:["assignees","name"],apply:()=>a.value.forEach(ge)})},L=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.bulkDeleteItems(d.value)},isDelete:!0,columns:["name"],apply:(se,Z)=>S(se,Z,{isDeleted:!0,disabled:!0,isProcessing:{state:0,message:""}},[])}),x=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.bulkUnarchiveItems(d.value)},columns:["name"],apply:(se,Z)=>S(se,Z,{isArchived:!1},["name"])}),P=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.bulkArchiveItems(d.value)},columns:["name"],apply:(se,Z)=>S(se,Z,{isArchived:!0},["name"])}),k=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.deleteThumbnail(d.value)},columns:["thumbnail"],apply:(se,Z)=>S(se,Z,{thumbnail:null},["thumbnail"])}),M=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.deleteRendition(d.value)},columns:["name"],apply:(se,Z)=>S(se,Z,{},["name"])}),N=()=>{v(),h.value=!0},B=se=>{console.trace("Bulk update response:",se),ht(()=>{h.value=!1})},z=()=>{w(),B({})},oe=(se,Z)=>{const A=new Map(e.selectRowData.map(ne=>[ne.id,ne.name||""])),j=mQ(se,Z.length);return Z.map((ne,ge)=>{const xe=A.get(ne)??"",ue=gQ(se,{currentName:xe,counterValue:j[ge]??""});return{id:ne,from:xe,to:ue}})},ie=()=>{const se=e.gridApi;return se==null?[]:e.selectRowData.map((Z,A)=>{var j;return{id:Z.id,rowIndex:((j=se.getRowNode(Z.id))==null?void 0:j.rowIndex)??A}}).sort((Z,A)=>Z.rowIndex-A.rowIndex).map(({id:Z})=>Z)};return{apiServices:u,selectionStatus:s,isSelectAll:i,selectedIds:a,isBulkUpdate:l,isUpdating:h,isLoading:f,handleUpdateStart:N,handleUpdatePostUpdate:B,handleUpdateFailed:z,handleUpdateBulkStatus:_,handleUpdateBulkDate:I,handleBulkUpdateMetric:T,handleUpdateNewAssignee:F,handleDelete:L,handleArchive:P,handleUnarchive:x,deleteThumbnail:k,deleteRendition:M,handleBulkUpdateName:async se=>{var xe;if(!e.workspaceId||!e.entityId)return;const Z=ie(),A={item_ids:Z,segments:se},j=r.value;i.value&&(delete A.item_ids,A.entity_id=e.entityId),A.sort_by=j;const ne={workspaceId:e.workspaceId,entityId:e.entityId,payload:A,filter:c!=null&&c.value?c.value:void 0},ge=oe(se,Z);v(),h.value=!0,f.value=!0;try{const ue=(xe=u.value)==null?void 0:xe.bulkRename(ne);if(!ue)throw new Error("Bulk update service is unavailable.");if(await ue,(p==null?void 0:p.success)===!1){w(p.error??new Error(bE));return}}catch(ue){w(ue);return}finally{h.value=!1,f.value=!1}y({ids:Z,columns:["name"],apply:()=>{var K;const ue=e.gridApi;ue&&(ge.forEach(({id:Y,to:re})=>{var R;return(R=ue.getRowNode(Y))==null?void 0:R.setDataValue("name",re)}),(K=n.onRefreshSelectedRow)==null||K.call(n))}})}}},eM=_t(ot({__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=$s,{triggerRef:n,popupRef:o}=vo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=X(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(q(),de("div",{class:le(i.$style["status-badge-wrapper"]),style:hn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[kt(i.$slots,"default"),ze(Se("div",{class:le(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[dr,r.showBadge],[V(t),{isLoading:r.loading,fullwidth:!0}]]),Se("div",{ref_key:"popupRef",ref:o,class:le(i.$style["badge-tooltip"])},at(r.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),fd=Ja("switchStore",()=>{const e=$(null),t=Dn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),yQ=ot({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:Cv()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Kt,o=$s,s=e,r=t,i={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=$(new Date),l=$(!0),u=$(!1),c=$(!1),d=$(null);let h=null,f=null;const p=fd(),{openPeopleInsight:g}=p,v=X(()=>!s.private&&!u.value),w=X(()=>{var B,z;return((B=d.value)==null?void 0:B.display_name)??((z=s.user)==null?void 0:z.name)}),S=X(()=>{var B,z;return!v.value||!d.value?s.status:(B=d.value.private_info)!=null&&B.is_offline?"offline":(z=d.value.private_info)!=null&&z.last_active?"active":"away"}),b=X(()=>{var B;return!!((B=d.value)!=null&&B.private_info)}),y=X(()=>{const B=S.value;return B?i[B]:""}),E=X(()=>{var B,z;return((z=(B=d.value)==null?void 0:B.private_info)==null?void 0:z.timezone)??s.timezone}),_=X(()=>{if(!E.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:E.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",E.value),""}}),I=X(()=>{var B,z,oe;return{id:s.user.id,name:w.value,initial:((B=d.value)==null?void 0:B.initial)??s.user.initial,profile_image:((z=d.value)==null?void 0:z.profile_image)??s.user.profile_image,color:((oe=d.value)==null?void 0:oe.color)??s.user.color,size:72,borderRadius:"8px"}}),T=X(()=>{const B=un.getInstance().getItem("BASE_URL"),z=un.getInstance().getItem("ws.code")||"";return es({type:"people_insight",config:{ws_code:z,baseDomain:B,user_id:s.user.id}}).url}),{copyToClipboard:F,tooltip:L}=IO(T.value,()=>r("copyLink",s.user.id)),x=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const B=await s.apiUpdateFunction(s.user.id);B?(d.value=B,r("dataUpdated",B)):(u.value=!0,c.value=!0,r("dataUpdated",null))}catch(B){u.value=!0,c.value=!0,console.error("Failed to fetch user data:",B)}finally{l.value=!1}},P=()=>{k(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(x,s.refreshInterval))},k=()=>{f!==null&&(clearInterval(f),f=null)},M=B=>{var z;if(B.ctrlKey||B.metaKey){window.open(T.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?(z=s.switchInstance)==null||z.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(T.value,"_blank")}},N=B=>{M(B),r("insightClick",s.user.id)};return Qe([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],P),Xt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await x(),P()):l.value=!1}),nu(()=>{h&&clearInterval(h),k()}),(B,z)=>s.showPrivateUser&&(s.private||c.value)?(q(),de("div",{key:0,class:le([B.$style["info-row"],B.$style["private-badge"]])},[...z[0]||(z[0]=[Se("span",null,"Private User",-1)])],2)):(q(),de("div",{key:1,class:le([B.$style["mini-people-card"],{[B.$style.loading]:l.value},"bg-skeleton"])},[Se("div",{class:le(B.$style["avatar-section"])},[v.value&&b.value?(q(),je(eM,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":y.value},{default:we(()=>[ye(Ef,jt({readOnly:!0},I.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(q(),je(Ef,jt({key:1,readOnly:!0},I.value),null,16))],2),Se("div",{class:le(B.$style["user-info"])},[Se("div",{class:le(B.$style["info-column"])},[ze((q(),de("span",{class:le(B.$style["user-name"])},[tt(at(w.value),1)],2)),[[V(n),{content:w.value,delay:[1e3,0]}]]),E.value&&v.value&&b.value?(q(),de("div",{key:0,class:le([B.$style["info-row"],B.$style["time-row"]])},[ze((q(),de("div",{class:le(B.$style["time-display"])},[ye(gt,{source:"remote",src:"Globe",class:le(B.$style["clock-icon"]),size:"10"},null,8,["class"]),Se("span",{class:le(B.$style["time-text"])},at(_.value)+" ("+at(E.value)+")",3)],2)),[[V(o),{isLoading:l.value,fullwidth:!0}]])],2)):Ye("",!0)],2),!e.readOnly&&v.value?(q(),de("div",{key:0,class:le([B.$style["info-row"],B.$style.actions])},[e.showInsightButton&&b.value?(q(),je(St,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Ht(N,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Ye("",!0),e.showCopyLinkButton&&b.value?ze((q(),je(St,{key:1,variant:["icon","secondary"],size:"small",onClick:Ht(V(F),["prevent","stop"]),disabled:s.disabled},{default:we(()=>[ye(gt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[V(n),{content:V(L),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ye("",!0)],2)):Ye("",!0)],2)],2))}}),wQ=_t(yQ,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),CQ=_t(ot({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e,{expose:t}){const n=Io,o=Kt,s=e,{isEditing:r}=ld(s),i=()=>{var h,f;const c=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=c==null?void 0:c.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};c==null||c.startEditingCell(d)},a=X(()=>{var d,h;const c=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((c==null?void 0:c.rowIndex)??0)+10}),l=()=>{var c,d;(d=(c=s.params)==null?void 0:c.api)==null||d.stopEditing()},u=$();return t({focus(){var c;(c=u.value)==null||c.focus()},blur(){var c;(c=u.value)==null||c.blur()}}),(c,d)=>ze((q(),je(St,{class:le(c.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:V(r),onClick:Ht(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:u},{default:we(()=>[ye(gt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[V(o),"More actions"],[V(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),bQ=["src","width","height","alt"],va=_t(ot({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=$s,{getCachedValue:n,setCachedValue:o}=bf({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=X(()=>({minWidth:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},u=X(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:c,loading:d}=UP(u,"visual",l,a);return(h,f)=>ze((q(),de("div",{class:le([h.$style.visualWrapper,{[h.$style.loading]:V(d)}]),style:hn(i.value)},[Se("img",{src:V(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:hn(i.value)},null,12,bQ)],6)),[[V(t),{isLoading:V(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),SQ=["tabindex"],No=_t(ot({__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:{},focusableIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;Zg();const r=dm(),i=$(null),a=$("default"),l=X(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),u=X(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),c=X(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var y,E;const g=((y=i.value)==null?void 0:y.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=i.value)==null?void 0:E.querySelectorAll(":scope > .wrapper-suffix").length)||0,w="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${b}))`:!g&&v?`calc(100% - (${v} * ${w} + ${b})) repeat(${v}, ${w})`:g&&v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${v} * ${w} + ${b})) repeat(${v}, ${w})`:"100%"},h=$("100%"),f=()=>{h.value=d()};$h(()=>{f()}),Xt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{ht(()=>{var g;(g=i.value)==null||g.focus()})},triggerFocus:()=>{console.log("triggerFocus called"),ht(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>{const w=Sc("focusable");return ze((q(),de("div",{ref_key:"rootEl",ref:i,class:le([V(r)["display-wrapper"],c.value]),tabindex:e.tabIndex,style:hn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":u.value})},[kt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),kt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),kt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,SQ)),[[w,o.focusableIndex]])}}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_rxmoy_1",readOnly:"_readOnly_rxmoy_26",bordered:"_bordered_rxmoy_29",disabled:"_disabled_rxmoy_29",active:"_active_rxmoy_29",focused:"_focused_rxmoy_29",hovered:"_hovered_rxmoy_33",error:"_error_rxmoy_37",clickable:"_clickable_rxmoy_50",suffix:"_suffix_rxmoy_56",prefix:"_prefix_rxmoy_57"}}]]),EQ=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const _Q=Object.prototype.toString,RQ=e=>_Q.call(e)==="[object Object]",_i=()=>{};function TQ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return"cancel"in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}function DQ(e,t={}){let n,o,s=_i,r=_i;const i=xh(!1),a=c=>{clearTimeout(c),s(),s=_i};let l;return Object.assign(c=>{const d=ta(e),h=ta(t.maxWait);return n&&a(n),d<=0||h!==void 0&&h<=0?(o&&(a(o),o=void 0),i.value=!1,Promise.resolve(c())):(i.value=!0,new Promise((f,p)=>{s=t.rejectOnCancel?p:f,r=f,l=c,h&&!o&&(o=setTimeout(()=>{n&&a(n),o=void 0,i.value=!1,f(l())},h)),n=setTimeout(()=>{o&&a(o),o=void 0,i.value=!1,f(c())},d)}))},{cancel:()=>{n&&(a(n),n=void 0),o&&(a(o),o=void 0),i.value=!1,r=_i},flush:()=>{if(i.value){n&&(clearTimeout(n),n=void 0),o&&(clearTimeout(o),o=void 0),i.value=!1;const c=r;s=_i,r=_i,c(l())}},isPending:Vr(i)})}function SE(e){return Array.isArray(e)?e:[e]}function IQ(e,t=200,n={}){return TQ(DQ(t,n),e)}function xQ(e,t,n){return Qe(e,t,{...n,immediate:!0})}const tM=EQ?window:void 0;function zf(e){var t;const n=ta(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function EE(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=X(()=>{const o=SE(ta(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return xQ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>zf(r)))!==null&&o!==void 0?o:[tM].filter(r=>r!=null),SE(ta(n.value?e[1]:e[0])),SE(V(n.value?e[2]:e[1])),ta(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const u=RQ(i)?{...i}:i,c=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function _E(e,t,n={}){const{window:o=tM,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:_i,cancel:_i,trigger:_i}:_i;let l=!0;const u=v=>ta(s).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(S=>S===v.target||v.composedPath().includes(S));{const S=zf(w);return S&&(v.target===S||v.composedPath().includes(S))}});function c(v){const w=ta(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const S=ta(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(y=>y.el===w.target||w.composedPath().includes(y.el))}const h=v=>{const w=zf(e);if(v.target!=null&&!(!(w instanceof Element)&&c(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!u(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[EE(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),EE(o,"pointerdown",v=>{const w=zf(e);l=!u(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),i&&EE(o,"blur",v=>{setTimeout(()=>{const w=zf(e);let S=o.document.activeElement;for(;S!=null&&S.shadowRoot;)S=S.shadowRoot.activeElement;(S==null?void 0:S.tagName)==="IFRAME"&&!(w!=null&&w.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const AQ=["type","value","placeholder","max","min","disabled","readonly","aria-invalid","aria-disabled","inputmode","maxlength"],hl=_t(ot({__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:{},showClear:{type:Boolean,default:!0},maxValue:{default:void 0},minValue:{default:0},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const o=Io,s=Kt,r=e,i=n,a=$(null),l=$(r.modelValue||""),u=$(!1),c=$(!1),d=$(r.modelValue||"");Qe(()=>r.modelValue,A=>{l.value=A||"",d.value=A||""});const h=X(()=>l.value.length>0),f={text:A=>A.slice(0,r.maxLength||255),number:A=>{const j=r.minValue<0;let ne=A.replace(j?/[^\d.-]/g:/[^\d.]/g,"");const ge=ne.split(".");ge.length>2&&(ne=ge[0]+"."+ge.slice(1).join("")),ne=ne.replace(/-/g,(re,R)=>R===0?re:"");const ue=ne.startsWith("-")?"-":"",Y=ne.replace("-","").split(".");return Y[0].length>17&&(Y[0]=Y[0].substring(0,17)),r.maxDecimalChar!==void 0&&Y.length>1&&(Y[1]=Y[1].substring(0,r.maxDecimalChar)),ne=ue+Y.join("."),ne},email:A=>A.replace(/\s/g,"").slice(0,r.maxLength||255),url:A=>A.replace(/\s/g,"").slice(0,r.maxLength||255),tel:A=>A.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},p=A=>{const j=f[r.type];return j?j(A):A},g=IQ(A=>{r.autoEmit&&(i("update:modelValue",A),i("input",A))},r.debounceDelay),v=A=>{const j=A;if(r.disabled||r.readOnly){j.preventDefault();return}const ne=j.target,ge=ne.selectionStart??ne.value.length,xe=ne.value,ue=l.value;let K=p(xe);if(r.type==="number"&&K!==""&&K!=="-"){const Y=Number(K);(r.maxValue!==void 0&&Y>r.maxValue||!Number.isNaN(Y)&&Y<r.minValue)&&(K=ue)}if(ne.value!==K){const Y=Math.max(0,xe.length-K.length);ne.value=K;const re=Math.max(0,Math.min(ge-Y,K.length));ne.setSelectionRange(re,re)}ue!==K&&(l.value=K,i("input",K),r.autoEmit&&g(K))},w=A=>{if(r.disabled||r.readOnly){A.preventDefault();return}c.value=!0;const j=l.value;l.value="",i("update:modelValue",""),i("clear"),j!==""&&i("change",""),A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),ht(()=>{var ne;(ne=a.value)==null||ne.focus(),setTimeout(()=>{c.value=!1},100)})},S=A=>{r.disabled||r.readOnly||(i("focus",A),r.selectOnFocus&&ht(()=>{A.target.select()}))},b=A=>{if(c.value)return;const ne=A.target.value;r.autoEmit||i("update:modelValue",ne),d.value!==ne&&(i("change",ne),d.value=ne),i("blur",ne,A)},y=A=>{const j=A.target.value;i("enter",j,A),i("enterValue",j),r.submitOnEnter&&(A.preventDefault(),r.autoEmit||i("update:modelValue",j),d.value!==j&&(i("change",j),d.value=j))},E=A=>{const j=A.target,ne=j.value;if(i("escape",ne,A),A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&j.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&j.blur()},_=A=>{const ne=A.target.value;i("tab",ne,A),r.autoEmit||(i("update:modelValue",ne),d.value!==ne&&(i("change",ne),d.value=ne))},I=(A,j,ne)=>new RegExp(`^-?\\d{0,${j}}(\\.\\d{0,${ne}})?$`).test(A)?ne>0||!A.includes("."):!1,T=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"]),F=A=>{if(i("keydown",A),A.key===" "&&A.stopPropagation(),r.type==="number"){if(A.key==="e"||A.key==="E"){A.preventDefault();return}if(A.key.length===1&&!A.ctrlKey&&!A.metaKey&&!A.altKey&&!T.has(A.key)){if(!(r.minValue<0?/[\d.-]/:/[\d.]/).test(A.key)){A.preventDefault();return}const ne=A.target,ge=l.value,xe=ne.selectionStart??ge.length,ue=ne.selectionEnd??xe,K=ge.slice(0,xe)+A.key+ge.slice(ue);if(!I(K,17,r.maxDecimalChar??2)){A.preventDefault();return}const Y=Number(K);if(r.maxValue!==void 0&&Y>r.maxValue||K!=="-"&&!Number.isNaN(Y)&&Y<r.minValue){A.preventDefault();return}}}A.key==="Escape"?E(A):A.key==="Enter"?y(A):A.key==="Tab"?_(A):(A.key==="ArrowUp"||A.key==="ArrowDown")&&r.type==="number"&&A.preventDefault()},L=A=>{i("keyup",A)},x=A=>{if(r.disabled||r.readOnly){A.preventDefault();return}i("paste",A)},P=A=>{if(r.disabled||r.readOnly){A.preventDefault();return}i("cut",A)},k=A=>{i("select",A)},M=`input-text-${Math.random().toString(36).slice(2,11)}`,N=X(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Qe(l,A=>{i("onValidation",A),u.value=r.validatorFnc?!!A&&!r.validatorFnc(A):!1});const B=$(null),z=X(()=>({disabled:r.disabled,readOnly:r.readOnly,error:u.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:B,bordered:!0})),{argsMain:oe,isHover:ie,isFocus:te}=xo(z);t({triggerFocus:()=>{ht(()=>{var A;(A=a.value)==null||A.focus()})},focus:()=>{se()},blur:()=>{ht(()=>{var A;(A=a.value)==null||A.blur()})},select:()=>{ht(()=>{var A;(A=a.value)==null||A.select()})},setSelectionRange:(A,j)=>{ht(()=>{var ne;(ne=a.value)==null||ne.setSelectionRange(A,j)})},getValue:()=>l.value,setValue:A=>{l.value=p(A),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const se=()=>{!r.disabled&&!r.readOnly&&ht(()=>{var A;(A=a.value)==null||A.focus()})},Z=X(()=>te.value&&h.value);return(A,j)=>(q(),de("div",{class:le([A.$style["input-wrapper"],"input-editor"]),onClick:se},[ze((q(),je(No,jt(V(oe),{ref_key:"wrapperRef",ref:B,class:[A.$style["input-box"],{[A.$style["is-hovered"]]:V(ie),[A.$style["is-focused"]]:V(te),[A.$style["has-input"]]:h.value,[A.$style["is-editting"]]:Z.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:we(()=>[kt(A.$slots,"prefix")]),suffix:we(()=>[h.value&&!r.disabled&&!r.readOnly&&r.showClear?kt(A.$slots,"clear",{},()=>[ze((q(),je(St,{variant:["icon","tertiary"],"aria-label":"Clear",onMousedown:Ht(w,["prevent","stop"]),size:18,rounded:!0,class:le(["wrapper-suffix",A.$style["clear-button"]])},{default:we(()=>[ye(gt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[V(s),{content:"Clear",contentClass:"extra-padding"}]])],void 0,0):kt(A.$slots,"suffix",{},void 0,void 0,1)]),default:we(()=>[Se("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:r.type,value:l.value,placeholder:e.placeholder,class:le([A.$style["column-config__input"]]),max:r.maxValue,min:r.minValue,id:M,disabled:e.disabled,readonly:e.readOnly,"aria-invalid":u.value||void 0,"aria-disabled":e.disabled||void 0,inputmode:N.value,maxlength:r.maxLength,onInput:v,onFocus:S,onBlur:b,onKeydown:F,onKeyup:L,onPaste:x,onCut:P,onSelect:k},null,42,AQ)]),_:3},16,["class","bordered"])),[[V(o),r.focusIndex]]),u.value?kt(A.$slots,"error",{},void 0,void 0,0):Ye("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_83ot4_1","is-disabled":"_is-disabled_83ot4_16","is-readonly":"_is-readonly_83ot4_16","is-hovered":"_is-hovered_83ot4_16","is-focused":"_is-focused_83ot4_20","column-config__input":"_column-config__input_83ot4_44","clear-button":"_clear-button_83ot4_59"}}]]),PQ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},RE=ot({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null),i=Cr(u=>{s("update:modelValue",u),s("search",u)},Si),a=()=>{s("update:modelValue",""),s("clear"),ht(()=>{var u;(u=r.value)==null||u.focus()})},l=$(o.modelValue);return t({focus:()=>{var u;(u=r.value)==null||u.focus()},setValue(u){l.value=u}}),(u,c)=>(q(),je(hl,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:V(i),onClear:a,onCancel:c[1]||(c[1]=d=>s("cancel")),"auto-emit":!0},{prefix:we(()=>[Se("div",PQ,[ye(gt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),fl=_t(ot({name:"ListItem",directives:{tooltip:Kt,focusable:Io},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=Io,s=e,r=n,i=$(!1),a=$(!1);function l(E){if(!E||typeof E!="object")return!1;const _=E;return typeof _.name=="string"&&typeof _.id=="string"&&typeof _.initial=="string"}const u=X(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!y.prefix),c=X(()=>!!y.suffix||s.danger&&i.value),d=X(()=>{var E;return s.type==="status"&&typeof((E=s.data)==null?void 0:E.color)=="string"?{backgroundColor:s.data.color,border:uS(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=dm(),f=X(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:u.value,[h["has-suffix"]]:c.value,[h.readOnly]:s.readOnly}));X(()=>({content:"Cancel",...b})),X(()=>({content:"Confirm",theme:"warning",...b}));function p(E){return{name:E.name,initial:E.initial,id:E.id,profile_image:E.profile_image??null,color:E.color,size:24}}function g(){i.value=!1}function v(E){E?r("click",E):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function w(E){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(E);r("handleClick",E)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),y=Zg();return Qe(()=>s.show,E=>{E===!1&&(i.value=!1)}),t({select:()=>{w(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(E,_)=>{const I=Sc("tooltip");return ze((q(),je(St,{variant:["menu-item",e.danger?"danger":"menu-item"],class:le([E.$style["list-item"],f.value]),onHandleClick:w,onMouseenter:_[0]||(_[0]=T=>a.value=!0),onMouseleave:_[1]||(_[1]=T=>a.value=!1),onEscape:S,style:hn({width:s.itemWidth})},{default:we(()=>[u.value?(q(),de("div",{key:0,class:le(E.$style["list-item__prefix"])},[kt(E.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(q(),je(gt,{key:0,src:e.icon,source:"remote",class:le(E.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(q(),de("div",{key:1,class:le(E.$style["status-indicator"]),style:hn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(q(),je(Ef,jt({key:2},p(e.data),{class:E.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ye("",!0)])],2)):Ye("",!0),Se("div",{class:le(E.$style["list-item__label"])},[kt(E.$slots,"label",{selected:e.selected},()=>[tt(at(e.label),1)])],2),c.value?(q(),de("div",{key:1,class:le(E.$style["list-item__suffix"])},[kt(E.$slots,"suffix",{item:E.$props,hovered:a.value},()=>[e.danger&&i.value?(q(),de("div",{key:0,class:le(E.$style["confirm-action"])},[ze((q(),je(St,{variant:["tertiary","icon","danger"],size:"small",onClick:Ht(g,["stop","prevent"])},{default:we(()=>[ye(gt,{src:"Xmark",source:"remote"})]),_:1})),[[V(o),`${s.focusIndex}.0`],[I,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),ze((q(),je(St,{variant:["danger","primary","icon"],size:"small",onClick:Ht(v,["stop","prevent"])},{default:we(()=>[ye(gt,{src:"Check",source:"remote"})]),_:1})),[[V(o),`${s.focusIndex}.1`],[I,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)])],2)):Ye("",!0)]),_:3},8,["variant","class","style"])),[[V(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_iekfz_1",disabled:"_disabled_iekfz_17",danger:"_danger_iekfz_24","has-prefix":"_has-prefix_iekfz_27","has-suffix":"_has-suffix_iekfz_27",clickable:"_clickable_iekfz_41",readOnly:"_readOnly_iekfz_44",hover:"_hover_iekfz_48",active:"_active_iekfz_54","list-item__prefix":"_list-item__prefix_iekfz_79","list-item__label":"_list-item__label_iekfz_87","list-item__suffix":"_list-item__suffix_iekfz_101","status-indicator":"_status-indicator_iekfz_108","item-icon":"_item-icon_iekfz_114","arbo-icon-state":"_arbo-icon-state_iekfz_119","item-avatar":"_item-avatar_iekfz_122","confirm-action":"_confirm-action_iekfz_131"}}]]),kQ=["aria-activedescendant"],FQ=["innerHTML"],OQ=10,ya=_t(ot({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Kt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=$(""),l=$(-1),u=$(null),c=$(null),d=$(new Map),h=X(()=>rE(a.value)),f=()=>{const Z=h.value;if(!Z||Z.length<r.minQueryLength)return r.options;if(d.value.has(Z))return d.value.get(Z);const A=r.options.map(j=>({item:j,score:mJ(` ${j.label} `,Z)})).filter(({score:j})=>j>0).sort((j,ne)=>ne.score-j.score).map(({item:j})=>j);return d.value.set(Z,A),A},p=$([]);Qe(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=X(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=Cr(Z=>{a.value=Z,l.value=-1,i("search",Z)},Si),w=async Z=>{te.value=0,await v(Z||""),te.value=1},S=Z=>a.value?vJ(Z,a.value):Z,b=Z=>{const j={[s.ARROW_DOWN]:()=>y(Z),[s.ARROW_UP]:()=>E(Z),[s.ENTER]:()=>T(Z),[s.ESCAPE]:()=>F(Z),[s.TAB]:()=>L(Z)}[Z.key];j&&j()},y=Z=>{Z.preventDefault(),_(1)},E=Z=>{Z.preventDefault(),_(-1)},_=Z=>{const A=p.value.length;if(A===0)return;let j;Z>0?j=(l.value+1)%A:l.value>0?j=l.value-1:j=A-1,l.value=j,I()},I=()=>{ht(()=>{var A;const Z=(A=c.value)==null?void 0:A.querySelectorAll('[role="menuitem"]')[l.value];Z==null||Z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},T=Z=>{if(Z.preventDefault(),l.value>=0&&l.value<p.value.length){const j=p.value[l.value];x(j,Z)}},F=Z=>{Z.preventDefault(),k()},L=Z=>{i("tab",Z)},x=(Z,A)=>{!Z||Z.disabled||(i("select",Z,A),l.value=-1,k())},P=Z=>{Z>=0&&Z<p.value.length&&(l.value=Z)},k=()=>{i("close")},M=()=>{if(!g.value||!c.value)return;const{scrollTop:Z,clientHeight:A,scrollHeight:j}=c.value;j-(Z+A)<=OQ&&i("loadMore")},N=()=>{var Z,A,j;(Z=c.value)==null||Z.addEventListener("scroll",M),(j=(A=oe.value)==null?void 0:A.$el)==null||j.addEventListener("keydown",b)},B=()=>{var Z,A,j;(Z=c.value)==null||Z.removeEventListener("scroll",M),(j=(A=oe.value)==null?void 0:A.$el)==null||j.removeEventListener("keydown",b)};Xt(()=>{N()}),Vn(()=>{B()}),Qe(()=>r.loading,Z=>{!Z&&p.value.length>0&&(l.value=-1)});const z=Z=>Z?Array.isArray(r.selectedId)?r.selectedId.includes(String(Z.id)):r.selectedId==Z.id:!1,oe=$(null);Qe(l,()=>{I()});const ie=()=>{ht(()=>{var Z;(Z=oe.value)==null||Z.focus()})};t({focus:()=>{ht(()=>{var Z;(Z=oe.value)==null||Z.focus()})},reset:()=>{var Z;(Z=oe.value)==null||Z.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:k,clearSearch:()=>{a.value=""},scrollTo:Z=>{c.value&&(c.value.scrollTop=Z)},selectIndex:Z=>{Z>=0&&Z<p.value.length&&(l.value=Z,I())}});const te=$(0);Qe([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const Z=r.options.length>0&&p.value.length>0,A=!Z&&a.value.length>0,j=!Z&&a.value.length===0;r.loading?te.value=0:Z?te.value=1:A?te.value=2:j&&(te.value=3)},{immediate:!0,deep:!0});const se=()=>{i("cancel")};return(Z,A)=>(q(),de("datalist",{ref_key:"searchListRef",ref:u,class:le([Z.$style["search-list"],te.value===3||te.value===2?Z.$style.empty:"",p.value.length>8?Z.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:hn({width:e.itemWidth||e.width})},[ye(RE,{ref_key:"searchBoxRef",ref:oe,modelValue:a.value,"onUpdate:modelValue":A[0]||(A[0]=j=>a.value=j),class:le(Z.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:A[1]||(A[1]=j=>w("")),onCancel:se},null,8,["modelValue","class","disabled"]),Se("div",{ref_key:"popupRef",ref:c,class:le(Z.$style["list-container"])},[kt(Z.$slots,"extra-item",{query:a.value,isEmpty:te.value===3||te.value===2,isLoading:r.loading}),(q(!0),de(Pt,null,xn(p.value,(j,ne)=>ze((q(),de("div",{key:`${j.id}-${ne}`,role:"menuitem"},[kt(Z.$slots,"item",{item:j,index:ne,selectedIndex:l.value,isSelected:z,handleSelect:x,handleItemHover:P,getHighlightedLabel:S,query:a.value,idx:ne,focused:l.value==ne,focus:ie},()=>[j.hide?Ye("",!0):(q(),je(fl,jt({key:0,ref_for:!0},j,{hover:ne===l.value,selected:z(j),type:j.type,id:`item-${ne}`,"aria-selected":ne===l.value,onClick:ge=>x(j,ge),onMouseover:ge=>P(ne),onEscape:k,itemWidth:e.itemWidth||e.width}),{prefix:we(()=>[kt(Z.$slots,"prefix-item",{item:j})]),label:we(()=>[a.value?ze((q(),de("span",{key:0,class:le(Z.$style.match),innerHTML:S(j.label)},null,10,FQ)),[[V(o),{content:j.label,delay:[1e3,0]}]]):ze((q(),de("span",{key:1,class:le(Z.$style["item-label"])},[tt(at(j.label),1)],2)),[[V(o),{content:j.label,delay:[1e3,0]}]])]),suffix:we(({hovered:ge})=>[kt(Z.$slots,"action",{item:j,isHovered:ne===l.value,hovered:ge,selected:l.value==ne})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[dr,te.value===1]])),128)),te.value===0?kt(Z.$slots,"loading-more",{},()=>[(q(),de(Pt,null,xn(8,j=>Se("div",{class:le(Z.$style["loading-more"]),key:j},[Se("div",{class:le(Z.$style["loading-skeleton"])},null,2),Se("div",{class:le(Z.$style["loading-skeleton"])},null,2)],2)),64))],void 0,0):Ye("",!0),te.value===2?(q(),de("div",{key:1,class:le(Z.$style["no-results"])},[kt(Z.$slots,"empty",{query:a.value},()=>[Se("div",{class:le(Z.$style["no-results-content"])},[...A[2]||(A[2]=[Se("div",null,[tt(" No results. "),Se("br"),tt(" Try another search. ")],-1)])],2)])],2)):Ye("",!0),te.value===3?(q(),de("div",{key:2,class:le(Z.$style["no-results"])},[kt(Z.$slots,"empty-list",{},()=>[Se("div",{class:le(Z.$style["no-results-content"])},[...A[3]||(A[3]=[Se("div",null,"No items available.",-1)])],2)])],2)):Ye("",!0),kt(Z.$slots,"footer")],2)],14,kQ))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Iu=ot({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=ej,n=e,o=$(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=$(s());Qe(()=>n,()=>{setTimeout(()=>{ht(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=X(()=>un.getInstance().getItem("user.ws_user_role_id")),a=X(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,u)=>ze((q(),je(Ef,_U(A1(a.value)),null,16)),[[V(t),r.value]])}}),MQ={class:"avatar-wrapper"},NQ={class:"assignee-label"},LQ=_t(ot({__name:"AssigneeItem",props:{user:{},hovered:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Kt,o=e,s=X(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=Zg(),i=X(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const u=c=>{c.forEach(d=>{d.type===Pt&&Array.isArray(d.children)?u(d.children):d.type!==no&&d.type!==Ka&&l++})};return u(r.actions()),l}),a=$(!1);return(l,u)=>(q(),de("div",{class:le(["assignee-selector-item",{hovered:a.value||o.hovered,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:hn({"--actions-count":i.value}),onMouseenter:u[0]||(u[0]=c=>a.value=!0),onMouseleave:u[1]||(u[1]=c=>a.value=!1)},[Se("div",MQ,[ye(Iu,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(q(),de("div",{key:0,class:le(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(q(),je(gt,{key:0,src:"CircleXMark"})):(q(),je(gt,{key:1,src:"CirclePlus"}))],2)):Ye("",!0)]),ze((q(),de("div",NQ,[kt(l.$slots,"name",{},()=>[tt(at(o.user.name),1)],!0)])),[[V(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hovered||o.focused?kt(l.$slots,"actions",{},void 0,!0,0):Ye("",!0)],38))}}),[["__scopeId","data-v-4de522be"]]),VQ={class:"unassign-icon"},TE=_t(ot({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(q(),je(V(St),{variant:"menu-item",onClick:o,actived:e.actived,style:hn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:we(()=>[Se("div",VQ,[kt(s.$slots,"icon",{},()=>[r[0]||(r[0]=Se("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Se("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:we(()=>[kt(s.$slots,"label",{},()=>[tt(at(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),BQ=["innerHTML"],nM=20,oM=_t(ot({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,{id:r}=Ng(s),i=n,a=j=>{var ge,xe;const ne=(xe=(ge=s.params)==null?void 0:ge.api)==null?void 0:xe.getRowNode(String(r.value));ne==null||ne.setDataValue("assignees",nv(j.assignees)),A("updated",j)},l=$(!1),u=$(!1),c=$(null),d=$(1),h=$(!0),f=$(0),p=$(""),g=Dn("bulkUpdate",$(!1)),v=Dn("isSelectAll",$(!1)),w=X(()=>{var j;return g.value&&v.value?[]:(j=s.ids)!=null&&j.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:y,assigneeList:E,mergedOptions:_,selectedUserIds:I}=Iv({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{A("update-failed")}},w),{apiServices:T}=so(!g.value,s),F=Dn("workspaceId"),L=async(j=1,ne="",ge=!1)=>{var ue,K,Y,re,R,G;if(!T.value)throw console.error("API service or item identifiers are undefined",T.value),new Error("API service or item identifiers are undefined");if(ge?u.value=!0:l.value=!0,c.value=null,!((ue=T.value)!=null&&ue.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const xe=(s.ids??(s.id?[s.id]:[])).map(String);try{let J;xe.length==0?J=await((K=T.value)==null?void 0:K.getEntityUserRoles({workspaceId:String(F),page:j,per_page:nM,display_name_like:ne.trim(),entity_ids:String(s.entityId)})):J=await((Y=T.value)==null?void 0:Y.multipleAssignableUser({workspaceId:String(F),itemIds:xe,page:j,perPage:nM,q:ne.trim(),entityId:String(s.entityId)}));const ce=((re=ad(J.data))==null?void 0:re.map(Dv))??[];E.value=ge?Kc(E.value,ce,"id"):ce,f.value=J.meta.total,h.value=(((R=J==null?void 0:J.meta)==null?void 0:R.current_page)||0)<(((G=J==null?void 0:J.meta)==null?void 0:G.last_page)||0),d.value=j}catch(J){console.error("Error fetching assignable users:",J),c.value="Failed to load assignable users"}finally{l.value=!1,u.value=!1}},x=()=>{!u.value&&h.value&&L(d.value+1,p.value,!0)},P=Cr(async j=>{p.value=j,await L(1,j,!1)},Si),k=()=>L(1,p.value,!1);Xt(()=>{var j;(j=N.value)==null||j.focus()}),t({getValue:()=>{var j;return(j=_.value.find(ne=>ne.selected))==null?void 0:j.value},refresh:k,clearInternal:()=>{I.value=[]},focus:()=>{var j;(j=N.value)==null||j.focus()}});const M=()=>{const j=un.getInstance().getItem("BASE_URL"),ne=es({type:"access_setting",config:{baseDomain:j,ws_code:s.workspaceId,entity_id:F}}).url;window.open(ne,"_blank")},N=$(null);Xt(()=>{ht(()=>{var j;(j=N.value)==null||j.focus()})}),Qe([()=>s.id,()=>s.workspaceId],()=>{L()},{deep:!0,immediate:!0});const B=j=>{var ge;const ne=un.getInstance().getItem("ws.code");return((ge=T.value)==null?void 0:ge.getUserInformation(ne,j))||Promise.resolve(null)},z=async(j,ne,ge)=>{ne.preventDefault(),ne.stopPropagation(),ne.stopImmediatePropagation(),A("update-start");try{const xe=await y(j);if(xe)A("update-completed",xe);else throw new Error("Failed to update assignees")}catch(xe){A("update-failed"),console.error("Error updating assignees:",xe)}},oe=async()=>{try{A("update-start");const j=await S();if(j)A("update-completed",j);else throw new Error("Failed to unassign all assignees")}catch(j){A("update-failed"),console.error("Error unassigning all assignees:",j)}finally{}},ie=async j=>{try{A("update-start");const ne=await b(j);if(ne)A("update-completed",ne);else throw new Error("Failed to replace assignees")}catch(ne){A("update-failed"),console.error("Error replacing assignees:",ne)}finally{}},te=()=>{var j,ne;i("cancel"),(ne=(j=s.params)==null?void 0:j.api)==null||ne.stopEditing()};ci("popupAttachRef",N);const se=$(),Z=$(!1),A=(j,ne)=>{switch(j){case"updated":i("updated",ne);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed",ne);break}};return Xt(()=>{ht(()=>{setTimeout(()=>{Z.value=!0},50)})}),(j,ne)=>(q(),de("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:se},[ye(ya,jt({"selected-id":V(I)},{...s},{options:V(_),loading:l.value,ref_key:"popupRef",ref:N,"loading-more":u.value,"has-more":h.value,onSelect:ne[0]||(ne[0]=(ge,xe)=>{z(ge,xe)}),"data-wrapper":"true",onSearch:V(P),onLoadMore:x,onCancel:te,onClose:te}),Hh({"extra-item":we(({isEmpty:ge,isLoading:xe})=>[!ge&&!xe?(q(),je(TE,{key:0,onClick:oe,actived:!1,label:"Unassign"},{icon:we(()=>[ye(gt,{src:"UserXMark",source:"remote"})]),_:1})):Ye("",!0)]),item:we(({item:ge,selectedIndex:xe,isSelected:ue,handleItemHover:K,getHighlightedLabel:Y,query:re,idx:R,focused:G})=>[ye(LQ,{user:ge.data,"multiple-select":!0,"append-to":se.value,isMe:!1,hover:R===xe,selected:ue(ge),focused:G,onClick:Ht(J=>z(ge,J,"click"),["stop","prevent"]),onMouseover:J=>K(R),"api-update-function":B},{name:we(()=>[re?ze((q(),de("span",{key:0,class:le([j.$style["item-label"],j.$style.match]),style:{flex:"1"},innerHTML:Y(ge.label)},null,10,BQ)),[[V(o),{content:ge.label}]]):ze((q(),de("span",{key:1,class:le(j.$style["item-label"]),style:{flex:"1"}},[tt(at(ge.label),1)],2)),[[V(o),{content:ge.label}]])]),actions:we(()=>[ze((q(),je(St,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:Ht(J=>{var ce;return ie((ce=ge.data)==null?void 0:ce.id)},["stop"])},{default:we(()=>[ye(gt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[V(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":we(()=>[Se("div",{class:le(j.$style["empty-state"])},[ne[3]||(ne[3]=tt(" No assignee available. ",-1)),ne[4]||(ne[4]=Se("br",null,null,-1)),ye(St,{onClick:M,variant:["tertiary"],size:"small"},{default:we(()=>[...ne[2]||(ne[2]=[tt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[c.value?{name:"error",fn:we(()=>[Se("div",{class:le(j.$style["error-message"])},[tt(at(c.value)+" ",1),ye(St,{onClick:k,size:"small"},{default:we(()=>[...ne[1]||(ne[1]=[tt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),$Q={key:0,class:"inner"},jf=_t(ot({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=$(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:u,show:c}=vo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=$(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=Fo({isShow:!1,isRender:!1});Xt(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.addEventListener("keydown",h)}),Vn(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,w)=>{f.isShow=v,f.isRender=w};return Qe(()=>a.value,(v,w)=>{v?ht(()=>{a.value&&g(!0,!0)}):f.isShow=!1,p("onVisibleChange",v,w)}),t({hide:()=>{console.log(" "),l(),g(!1,!0)},isVisible:a,open:()=>{c(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,w)=>(q(),de("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[Se("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[kt(v.$slots,"trigger",{isVisible:V(a),hide:V(l),disabled:o.isUpdating||o.disabled,popupRef:V(i),triggerRef:V(r),toggle:V(u)},void 0,!0)],512),Se("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?ze((q(),de("div",$Q,[kt(v.$slots,"popup",{isVisible:V(a),hide:V(l),popupRef:V(i),triggerRef:V(r),toggle:V(u),open:V(c)},void 0,!0)],512)),[[dr,f.isShow]]):Ye("",!0)],512)],512))}}),[["__scopeId","data-v-af84b00b"]]),HQ=ot({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;ci("bulkUpdate",!0);const o=$(!1),s=t,r=$(null),i=()=>{var d;o.value=!0,s("update-start"),(d=l.value)==null||d.hide()},a=(d,h)=>{var f,p;o.value=!1,d?(s("update-completed",h),(f=l.value)==null||f.destroy()):(s("update-failed"),(p=l.value)==null||p.open())},l=$(null),u=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},c=(d,h)=>{ht(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return(d,h)=>(q(),je(jf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:c},{trigger:we(({hide:f,disabled:p})=>[ye(St,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:we(()=>[ye(gt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=tt(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({hide:f})=>[ye(oM,jt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:u,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0,p)),onCancel:f}),null,16,["ids","onCancel"])]),default:we(()=>[h[3]||(h[3]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),Kf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],GQ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),pl=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let u=Kf.indexOf(l);const c=i?-1:1;for(const d of Kf){u=(u+c+Kf.length)%Kf.length;const h=Kf[u],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(GQ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},UQ=["aria-label"],WQ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],zQ={style:{flex:"1"}},jQ=_t(ot({__name:"MainCalendar",props:QD({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},hasWarning:{type:Boolean,default:!0},disabledTooltip:{default:"This date is disabled"},parentConfig:{}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:QD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Kt,s=$(null),r=e,i=X(()=>r.startDate&&r.endDate),a=az(e,"tracingCase"),l=n,u=$(r.year),c=$(r.month),d=X(()=>{var xe,ue,K;const A=Y=>Y==null?void 0:Y.toFormat("yyyy-MM-dd"),j=(xe=r.parentConfig)==null?void 0:xe.parentName,ne=(ue=r.parentConfig)==null?void 0:ue.parentStartDate,ge=(K=r.parentConfig)==null?void 0:K.parentDueDate;return{smaller:`Before the ${j} start date (${A(ne)})`,larger:`After the ${j} due date (${A(ge)})`,none:""}});Qe(()=>[r.year,r.month],([A,j])=>{u.value=A,c.value=j});const h=X(()=>lt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),f=X(()=>lt.now().setZone(r.timezone)),p=X(()=>r.startDate?lt.fromJSDate(r.startDate,{zone:r.timezone}):null),g=X(()=>r.endDate?lt.fromJSDate(r.endDate,{zone:r.timezone}):null),v=$(p.value),w=$(g.value),S=$(p.value),b=$(g.value);Qe([p,g],()=>{r.requireConfirm||(v.value=p.value,w.value=g.value,S.value=p.value,b.value=g.value)},{immediate:!0});const y=X(()=>r.requireConfirm?v.value:p.value),E=X(()=>r.requireConfirm?w.value:g.value);Qe(()=>r.activeField,A=>{const j=A==="start"?y.value:E.value;j&&(u.value=j.year,c.value=j.month)}),Qe(()=>{var A,j;return[(A=y.value)==null?void 0:A.toISODate(),(j=E.value)==null?void 0:j.toISODate(),r.activeField]},()=>{const A=r.activeField==="start"?y.value:E.value;A&&(A.year!==u.value||A.month!==c.value)&&(u.value=A.year,c.value=A.month)});function _(A){return A.setZone("utc")}const I=$("");function T(A){I.value=A.toISODate()||"",ht(()=>{const j=document.querySelector(`.arbo-calendar-day[data-date="${I.value}"]`);j==null||j.focus()})}Qe(()=>{var A,j;return[u.value,c.value,r.activeField,(A=y.value)==null?void 0:A.toISODate(),(j=E.value)==null?void 0:j.toISODate()]},()=>{const A=r.activeField==="start"?y.value:E.value;let j;A&&A.year===u.value&&A.month===c.value?j=A:y.value&&y.value.year===u.value&&y.value.month===c.value?j=y.value:j=f.value,T(j)});function F(A){return A.toFormat("d")}const L=X(()=>{var G,J,ce,Ee,Ce,Ne,pe,H;const A=lt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}),j=A.weekday,ne=r.weekStart===1?(j+6)%7:j%7;let ge=A.minus({days:ne});const xe=[],ue=rd.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),K=dm(),Y=(J=(G=r.parentConfig)==null?void 0:G.parentStartDate)==null?void 0:J.startOf("day").toMillis(),re=(Ee=(ce=r.parentConfig)==null?void 0:ce.parentDueDate)==null?void 0:Ee.endOf("day").toMillis();console.log("calculating classes for cursor:",{cursor:ge.toISODate(),parentStartMs:Y,parentDueMs:re,parentConfig:r.parentConfig});for(let W=0;W<42;W++){const be=[];ge.month!==c.value&&be.push(K["is-outside"]),ge.hasSame(f.value,"day")&&be.push(K["is-today"]),y.value&&ge.hasSame(y.value,"day")&&be.push(K["is-selected-start"]),E.value&&ge.hasSame(E.value,"day")&&be.push(K["is-selected-end"]),y.value&&E.value&&ge>y.value&&ge<E.value&&be.push(K["is-in-range"]);const Ae=F(ge),He=ue[ge.weekday-1]||"";let Te="none";const Xe=ge.startOf("day").toMillis();Y!==void 0&&Xe<Y?Te="smaller":re!==void 0&&Xe>re&&(Te="larger"),console.log("dayMs:",ge.startOf("day").toFormat("yyyy-MM-dd"),"parentStartMs:",(Ne=(Ce=r.parentConfig)==null?void 0:Ce.parentStartDate)==null?void 0:Ne.toFormat("yyyy-MM-dd"),"parentDueMs:",(H=(pe=r.parentConfig)==null?void 0:pe.parentDueDate)==null?void 0:H.toFormat("yyyy-MM-dd"),"resulting warning:",Te),xe.push({dt:ge,iso:ge.toISODate()||"",label:ge.toFormat("d"),displayLabel:Ae,weekdayLabel:He,aria:ge.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),warning:Te,classes:be}),ge=ge.plus({days:1})}const R=[];for(let W=0;W<6;W++)R.push(xe.slice(W*7,W*7+7));return console.log("cells:",R),R}),x=X(()=>{const A=rd.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?A:[A[6],...A.slice(0,6)]});function P(A,j,ne){const ge=A==="start"?j.startOf("day"):j.endOf("day"),xe=_(ge),ue={year:ge.year,month:ge.month,day:ge.day,utc:xe.toISO()||""};A==="start"?(l("select-start",ue,ne??!0),l("select-start-utc",ue.utc)):(l("select-end",ue),l("select-end-utc",ue.utc))}function k(A){let j=u.value,ne=c.value+A;for(;ne<1;)ne+=12,j-=1;for(;ne>12;)ne-=12,j+=1;u.value=j,c.value=ne,l("update:year",j),l("update:month",ne)}function M(A){const ne=(I.value?lt.fromISO(I.value,{zone:r.timezone}):f.value).plus({days:A});ne.month===c.value&&ne.year===u.value&&T(ne)}function N(A=!1){const ne=(I.value?lt.fromISO(I.value,{zone:r.timezone}):f.value).weekday%7,ge=A?6-ne:-ne;M(ge)}const B=A=>{z(A)};function z(A){switch(A.preventDefault(),A.stopPropagation(),A.key){case"ArrowLeft":A.preventDefault(),M(-1);break;case"ArrowRight":A.preventDefault(),M(1);break;case"ArrowUp":A.preventDefault(),M(-7);break;case"ArrowDown":A.preventDefault(),M(7);break;case"Home":A.preventDefault(),N(!1);break;case"End":A.preventDefault(),N(!0);break;case"PageUp":A.preventDefault(),k(A.shiftKey?-12:-1);break;case"PageDown":A.preventDefault(),k(A.shiftKey?12:1);break;case"Enter":case" ":{A.preventDefault();const j=I.value?lt.fromISO(I.value,{zone:r.timezone}):f.value,ne=L.value.flat().find(ge=>ge.iso===j.toISODate());ne&&ie(ne);break}}}const oe=A=>{const j=lt.now().setZone(r.timezone);u.value=j.year,c.value=j.month,l("update:year",j.year),l("update:month",j.month),T(j),l("gotoToday")};function ie(A){var Ee,Ce;const j=!!p.value,ne=!!g.value,ge=r.activeField,xe=((Ee=p.value)==null?void 0:Ee.toISODate())||"null",ue=((Ce=g.value)==null?void 0:Ce.toISODate())||"null",K=A.dt.toISODate()||"",Y=(Ne,pe)=>{a.value={case:Ne,behavior:pe}},re=()=>`Selected start ${K} > existing end ${ue} -> reset both to ${K}`,R=()=>`Selected end ${K} < existing start ${xe} -> reset both to ${K}`,G=()=>{P("start",A.dt,!0),P("end",A.dt),l("update:activeField","end")},J=(Ne=!1)=>{P("start",A.dt,Ne),Ne&&l("update:activeField","end")},ce=(Ne=!1)=>{P("end",A.dt),Ne&&l("close")};if(j&&ne){ge==="start"?g.value&&A.dt>g.value?(G(),Y("INVERT_RANGE_FROM_START",re())):(J(!1),Y("UPDATE_START_IN_RANGE",`Updated start from ${xe} to ${K}; end remains ${ue}`)):p.value&&A.dt<p.value?(G(),Y("INVERT_RANGE_FROM_END",R())):(ce(!1),Y("UPDATE_END_IN_RANGE",`Updated end from ${ue} to ${K}; start remains ${xe}`));return}if(!j&&ne&&ge==="start"&&g.value&&A.dt>g.value){G(),Y("CREATE_RANGE_FROM_LATE_START",re());return}if(j&&!ne&&ge==="end"&&p.value&&A.dt<p.value){G(),Y("CREATE_RANGE_FROM_EARLY_END",R());return}if(!j&&!ne){if(ge==="start"){J(!0),Y("INIT_START",`Picked start ${K}; awaiting end selection`);return}ce(r.immediatelyUpdate),Y("INIT_END",`Picked end ${K}; awaiting start selection`);return}if(!j&&ne){if(ge==="start"){J(!0),Y("FILL_MISSING_START",`Inserted start ${K}; existing end ${ue}`);return}ce(!1),Y("STRICT_UPDATE_END_ONLY",`Updated end to ${K}; start still null`);return}if(j&&!ne){if(ge==="start"){J(!0),Y("RESELECT_START_BEFORE_END",`Replaced start with ${K}; end still null, switching to end`);return}ce(r.immediatelyUpdate),Y("FILL_MISSING_END",`Picked end ${K}; start ${xe}`);return}}function te(){S.value=v.value,b.value=w.value,l("confirm")}function se(){v.value=S.value,w.value=b.value,l("cancel")}function Z(){ht(()=>{var A;(A=s.value)==null||A.focus()})}return Xt(()=>{Z()}),t({focus:Z}),(A,j)=>(q(),de("div",{ref_key:"calendarRef",ref:s,class:le([A.$style["arbo-calendar"],{[A.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":h.value,tabindex:"0"},[Se("div",{class:le([A.$style["arbo-calendar-header"],A.$style["arbo-calendar-week"]]),role:"row"},[(q(!0),de(Pt,null,xn(x.value,ne=>(q(),de("div",{key:ne,class:le(A.$style["arbo-calendar-weekday"]),role:"columnheader"},at(ne),3))),128))],2),Se("div",{class:le(A.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:j[0]||(j[0]=Ht(ne=>V(pl)(ne,B),["prevent","stop"]))},[(q(!0),de(Pt,null,xn(L.value,(ne,ge)=>(q(),de("div",{key:ge,class:le(A.$style["arbo-calendar-week"])},[(q(!0),de(Pt,null,xn(ne,xe=>ze((q(),de("button",{key:xe.iso,class:le([A.$style["arbo-calendar-day"],xe.classes,{[A.$style["is-focused"]]:xe.iso===I.value},{[A.$style["is-warning"]]:xe.warning!=="none"}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":xe.aria,"data-date":xe.iso,"data-weekday":xe.weekdayLabel,tabindex:xe.iso===I.value?0:-1,onClick:ue=>ie(xe)},[tt(at(xe.displayLabel),1)],10,WQ)),[[V(o),{content:r.disabled||r.readOnly?r.disabledTooltip:d.value[xe.warning],bypassOverflowCheck:!0}]])),128))],2))),128))],34),r.hasWarning?(q(),de("div",{key:0,class:le(A.$style["warning-selection"])},[ye(gt,{src:"InfoCircle",size:"16",color:"var(--tessr-snackbar-fg-warning, #F7941D)"}),j[2]||(j[2]=tt(" Outside the parent folder's date range. You can still confirm. ",-1))],2)):Ye("",!0),r.readOnly?Ye("",!0):(q(),de("div",{key:1,class:le(A.$style["arbo-calendar-actions"])},[Se("div",zQ,[ze((q(),je(St,{variant:"secondary",size:"medium",onClick:j[1]||(j[1]=ne=>oe()),onKeydown:V(pl),"data-index":"today-btn"},{prefix:we(()=>[ye(gt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[V(o),"Today"]])]),ye(St,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:V(pl),variant:"secondary",size:"medium",onClick:se,"data-index":"cancel-btn"},{default:we(()=>[tt(at(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ye(St,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:V(pl),onClick:te},{default:we(()=>[tt(at(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,UQ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_2hwrk_1","arbo-calendar-week":"_arbo-calendar-week_2hwrk_2","arbo-calendar-day":"_arbo-calendar-day_2hwrk_3","arbo-calendar":"_arbo-calendar_2hwrk_2","arbo-calendar-nav":"_arbo-calendar-nav_2hwrk_36","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_2hwrk_44","arbo-calendar-nav-label":"_arbo-calendar-nav-label_2hwrk_51","arbo-calendar-weekday":"_arbo-calendar-weekday_2hwrk_56","arbo-calendar-weeks":"_arbo-calendar-weeks_2hwrk_61","is-today":"_is-today_2hwrk_95","is-selected-start":"_is-selected-start_2hwrk_100","is-selected-end":"_is-selected-end_2hwrk_108","is-outside":"_is-outside_2hwrk_128","is-focused":"_is-focused_2hwrk_131","is-in-range":"_is-in-range_2hwrk_136","is-warning":"_is-warning_2hwrk_141","arbo-calendar-actions":"_arbo-calendar-actions_2hwrk_154","warning-selection":"_warning-selection_2hwrk_162","arbo-calendar-btn":"_arbo-calendar-btn_2hwrk_179",cancel:"_cancel_2hwrk_188",confirm:"_confirm_2hwrk_193"}}]]),KQ=["onClick"],qQ=["variant","onClick"],YQ=_t(ot({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=X(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const k=o.locale||"en-US",M=o.monthLabelStyle||"short",N=new Intl.DateTimeFormat(k,{month:M,timeZone:"UTC"});return Array.from({length:12},(z,oe)=>N.format(new Date(Date.UTC(2020,oe,1))))}),r=n,i=$(o.year),a=$(o.month),l=$(o.year);Qe(()=>o.year,k=>{k!==i.value&&(i.value=k,l.value=k)}),Qe(()=>o.month,k=>{k!==a.value&&(a.value=k)});const u=$("days");function c(k){u.value!==k&&(u.value=k,r("mode-change",k))}const d=X(()=>o.minYear),h=X(()=>o.maxYear),f=X(()=>{const k=o.yearSpan;return l.value-l.value%k}),p=X(()=>f.value+o.yearSpan-1);function g(){const k=o.yearSpan,M=f.value-k;M>=d.value&&(l.value=M)}function v(){const k=o.yearSpan,M=f.value+k;M<=h.value&&(l.value=M)}const w=X(()=>f.value-o.yearSpan<d.value),S=X(()=>p.value+o.yearSpan>h.value),b=X(()=>{const k=o.yearSpan;return Math.ceil(k/3)});function y(k){const N=f.value+(k-1)*3;return Array.from({length:3},(B,z)=>N+z).filter(B=>B<=p.value)}function E(){u.value==="months"?c("days"):c("months")}function _(){u.value==="years"?c("days"):c("years")}function I(k){i.value=k,l.value=k,r("update:year",k),r("year-selected",k),c("months")}function T(k){a.value=k,r("update:month",k),r("month-selected",k),c("days")}function F(){if(u.value==="days"){let k=i.value,M=a.value-1;if(M<1&&(M=12,k--),k<d.value)return;i.value=k,a.value=M,r("update:year",k),r("update:month",M)}else if(u.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else u.value==="years"&&g()}function L(){if(u.value==="days"){let k=i.value,M=a.value+1;if(M>12&&(M=1,k++),k>h.value)return;i.value=k,a.value=M,r("update:year",k),r("update:month",M)}else if(u.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else u.value==="years"&&v()}const x=X(()=>u.value==="days"?i.value===d.value&&a.value===1:u.value==="months"?i.value-1<d.value:w.value),P=X(()=>u.value==="days"?i.value===h.value&&a.value===12:u.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(k,M)=>{i.value=k,a.value=M}}),(k,M)=>(q(),de("div",{class:le([k.$style["cal-nav-wrapper"]])},[kt(k.$slots,"selection"),u.value==="days"?(q(),de("div",{key:0,class:le(k.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ye(St,{variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Previous",disabled:x.value,label:"",onClick:F,"data-index":"prev-btn",onKeydownCapture:po(Ht(F,["prevent","stop"]),["enter"]),onKeydown:V(pl)},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),Se("div",{class:le(k.$style["cal-nav-center"])},[ye(St,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:V(pl)},{default:we(()=>[tt(at(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ye(St,{variant:"secondary",onClick:_,"data-index":"year-btn",onKeydown:V(pl)},{default:we(()=>[tt(at(i.value),1)]),_:1},8,["onKeydown"])],2),ye(St,{"data-index":"next-btn",variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:P.value,label:"",onClick:L,onKeydownCapture:po(Ht(L,["prevent","stop"]),["enter"]),onKeydown:V(pl)},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ye("",!0),u.value==="years"?(q(),de("div",{key:1,class:le(k.$style["year-grid"])},[Se("div",{class:le(k.$style["year-grid-header"])},[ye(St,{variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),Se("div",{class:le(k.$style["range-label"])},at(f.value)+" - "+at(p.value),3),ye(St,{variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),Se("div",{class:le(k.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(q(!0),de(Pt,null,xn(b.value,N=>(q(),de("div",{key:"yr-row-"+N,class:le(k.$style["year-grid-row"])},[(q(!0),de(Pt,null,xn(y(N),B=>(q(),de("a",{key:B,tabindex:"0",class:le([k.$style["year-cell"],{[k.$style.selected]:B===i.value}]),onClick:z=>I(B)},at(B),11,KQ))),128))],2))),128))],2)],2)):u.value==="months"?(q(),de("div",{key:2,class:le(k.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[Se("div",{class:le(k.$style.months)},[(q(!0),de(Pt,null,xn(s.value,(N,B)=>(q(),de("a",{tabindex:"0",key:N,variant:B+1===a.value?"primary":"text",class:le([k.$style["month-cell"],{[k.$style.selected]:B+1===a.value}]),onClick:z=>T(B+1)},at(N),11,qQ))),128))],2)],2)):(q(),de("div",{key:3,class:le(k.$style["days-slot"])},[kt(k.$slots,"default",{year:i.value,month:a.value,mode:u.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function XQ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=$(""),i=X(()=>{const g=lt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=X(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const w=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return w<S?-1:w>S?1:0},u=X(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),c=X(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&u.value),d=X(()=>r.value.length===t.length&&c.value);return{inputValue:r,isValid:c,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=lt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>c.value?i.value:null}}const ZQ={key:0,style:{marginLeft:"8px"}},JQ=["disabled","readonly","placeholder"],sM=_t(ot({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=n,i=$(null),a=$(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:h,getDate:f}=XQ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=X(()=>s.active),g=X(()=>({disabled:s.disabled,error:!l.value&&c.value.length>0,readOnly:s.readOnly,isEmpty:c.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:S}=xo(g),b=T=>{var L;const F=(L=T.clipboardData)==null?void 0:L.getData("text/plain");F&&(c.value=F.trim())},y=T=>{if(T.key==="Escape"){r("blur"),T.target.blur(),T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation();return}else T.key==="Tab"&&I(T)},E=()=>{d(),r("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var T;return(T=i.value)==null?void 0:T.focus()}}),Qe(()=>s.modelValue,T=>{T?h(T):d()},{immediate:!0}),Qe([()=>u.value,()=>c.value],()=>{if(c.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&u.value){const T=f();(T||c.value.length===0)&&r("complete",T)}}),Qe(()=>l.value,T=>{T||r("invalid","")});const _=X(()=>!!s.isMultipleDate),I=T=>{T.preventDefault(),T.stopImmediatePropagation(),T.stopPropagation(),r("tab",T)};return(T,F)=>(q(),je(No,jt(V(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:we(()=>[Se("div",{class:le([T.$style["date-input-wrapper"]])},[_.value?(q(),de("span",ZQ," Multiple ")):ze((q(),de("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":F[0]||(F[0]=L=>mn(c)?c.value=L:null),onPaste:Ht(b,["prevent"]),placeholder:s.placeholder,class:le([T.$style["date-input"]]),onKeydown:y},null,42,JQ)),[[hI,V(c)]]),kt(T.$slots,"clear",{handleClear:E},()=>[(V(c).length>0||_.value)&&!s.readOnly&&!s.disabled&&(V(w)||V(S))?ze((q(),je(St,{key:0,variant:["icon","primary"],onClick:Ht(E,["stop"]),size:16,rounded:!0},{default:we(()=>[ye(gt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[V(o),"Clear"]]):(q(),je(gt,{key:1,src:"Calendar",source:"remote",class:le(T.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),rM=(e,t)=>{if(e==null||e==="")return null;let n;return lt.isDateTime(e)?n=e.setZone(t):e instanceof Date?n=lt.fromJSDate(e,{zone:t}):typeof e=="number"?n=lt.fromMillis(e,{zone:t}):n=lt.fromISO(e,{zone:t}),n.isValid?n:null},QQ=ot({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:lE()},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},parent_name:{},parentConfig:{}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=$({case:"",behavior:""}),s=e,r=$(null),i=n,a=async(R,G)=>{i("start-update"),await R(),i("finish-update"),ht(()=>{var J,ce;G(),(ce=(J=s.params)==null?void 0:J.api)==null||ce.stopEditing()})},l=(R,G)=>{R(),ht(()=>{var J,ce;G(),(ce=(J=s.params)==null?void 0:J.api)==null||ce.stopEditing()})},u=()=>{var G;const R=lt.now().setZone(s.timezone);A.value=R.year,j.value=R.month,(G=Z.value)==null||G.setNavigation(R.year,R.month)},c=Fo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:w,beginInteraction:S,clearStart:b,clearDue:y}=bJ(s,i),E=X(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Qe(()=>s.multipleStartDates,R=>{h.value=!!R},{immediate:!0}),Qe(()=>s.multipleDueDates,R=>{f.value=!!R},{immediate:!0});const _=$(null),I=$(null),T=R=>{R.preventDefault(),R.stopImmediatePropagation(),R.stopPropagation(),ie()},F=()=>{var R;(R=I.value)==null||R.focus()},L=R=>{if(!R){c.start=!1,b();return}const G=d.endDate?lt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(G&&x(R,G)>0){const ce={year:R.year,month:R.month,day:R.day};c.start=!1,w(ce,!1),p(ce),ht(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const J={year:R.year,month:R.month,day:R.day};c.start=!1,w(J,!0)},x=(R,G)=>{const J=R.startOf("day"),ce=G.startOf("day");return J<ce?-1:J>ce?1:0},P=R=>{var G;R.preventDefault(),R.stopImmediatePropagation(),R.stopPropagation(),(G=document.querySelector('[data-index="prev-btn"]'))==null||G.focus()},k=R=>{if(!R){c.end=!1,y();return}const G=d.startDate?lt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(G&&x(R,G)<0){const ce={year:R.year,month:R.month,day:R.day};c.end=!1,w(ce),p(ce),ht(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const J={year:R.year,month:R.month,day:R.day};c.end=!1,p(J)},M=()=>{h.value=!1,b()},N=()=>{f.value=!1,y()},B=()=>{te()},z=X(()=>d.isSelectingStart||d.isSelectingEnd);function oe(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,ht(()=>{var R;(R=r.value)==null||R.focus()}))}function ie(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,ht(()=>{var R;(R=_.value)==null||R.focus()}))}function te(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function se(R){R.key==="Escape"?(R.stopPropagation(),te()):R.key=="Tab"&&i("tab",R)}const Z=$(null),A=$(new Date().getFullYear()),j=$(new Date().getMonth()+1);Qe(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(A.value=d.startDate.getFullYear(),j.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(A.value=d.endDate.getFullYear(),j.value=d.endDate.getMonth()+1)},{immediate:!0});const ne=$(null);function ge(){if(Array.isArray(s.value)){const[G,J]=s.value;d.startDate=G||null,d.endDate=J||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const R=d.startDate||d.endDate||new Date;A.value=R.getFullYear(),j.value=R.getMonth()+1}Qe(()=>{var R,G,J,ce,Ee,Ce,Ne,pe;return[((J=(G=(R=s.value)==null?void 0:R[0])==null?void 0:G.getTime)==null?void 0:J.call(G))||((ce=s.value)==null?void 0:ce[0]),((Ne=(Ce=(Ee=s.value)==null?void 0:Ee[1])==null?void 0:Ce.getTime)==null?void 0:Ne.call(Ce))||((pe=s.value)==null?void 0:pe[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{ge()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ge,openStart:oe,openEnd:ie,closePicker:te,clearAll:B,isOpen:z,drpRef:ne,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?oe():ie():oe()}});const ue=$(null);Qe(()=>z.value,R=>{if(s.disabled||s.readOnly)return;const G=ue.value;G&&(R?G.show():G.hide())},{immediate:!0});const K=R=>lt.fromJSDate(R,{zone:s.timezone}),Y=X(()=>{var R,G,J;return{start:rM((R=s.parentConfig)==null?void 0:R.parentStartDate,s.timezone),due:rM((G=s.parentConfig)==null?void 0:G.parentDueDate,s.timezone),name:(J=s.parentConfig)==null?void 0:J.parentName}}),re=X(()=>{const{startDate:R,endDate:G}=d,J=Y.value.start,ce=Y.value.due,Ee=Ne=>!!(Ne&&J&&K(Ne).startOf("day")<J.startOf("day")),Ce=Ne=>!!(Ne&&ce&&K(Ne).startOf("day")>ce.startOf("day"));return Ee(R)||Ee(G)||Ce(R)||Ce(G)});return(R,G)=>(q(),de("div",{class:le(R.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:I,onKeydown:se,tabindex:"1","data-index":"calendar-wrapper"},[ye(YQ,{year:A.value,"onUpdate:year":G[6]||(G[6]=J=>A.value=J),month:j.value,"onUpdate:month":G[7]||(G[7]=J=>j.value=J),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:Z},{selection:we(()=>[Se("div",{class:le(R.$style["calendar-input-section"])},[ye(sM,{ref_key:"starDateRef",ref:r,"model-value":V(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:V(d).isSelectingStart,onClick:oe,onClear:M,onComplete:L,onInvalid:G[0]||(G[0]=J=>c.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:F,onTab:T},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ye(sM,{ref_key:"endDateRef",ref:_,"model-value":V(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:V(d).isSelectingEnd,onClick:ie,onClear:N,disabled:s.disabled,onComplete:k,onInvalid:G[1]||(G[1]=J=>c.end=!0),readOnly:s.readOnly,isMultipleDate:V(f),onTab:P},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:we(({year:J,month:ce})=>[ye(jQ,{disabled:s.disabled,"has-warning":re.value,disableConfirm:c.end||c.start,readOnly:s.readOnly,ref_key:"drpRef",ref:ne,"tracing-case":o.value,"onUpdate:tracingCase":G[2]||(G[2]=Ee=>o.value=Ee),year:J,month:ce,"start-date":V(d).startDate,"end-date":V(d).endDate,"active-field":E.value,timezone:s.timezone,parentConfig:s.parentConfig,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:V(w),onSelectEnd:V(p),onGotoToday:u,onConfirm:G[3]||(G[3]=()=>{a(V(v),te)}),onCancel:G[4]||(G[4]=Ee=>l(V(g),te)),onClose:G[5]||(G[5]=Ee=>a(V(v),te))},null,8,["disabled","has-warning","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","parentConfig","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Nv=_t(QQ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_k2sex_1","calendar-input-section":"_calendar-input-section_k2sex_11","display-wrapper":"_display-wrapper_k2sex_19","calendar-actions":"_calendar-actions_k2sex_23","clear-all-btn":"_clear-all-btn_k2sex_29"}}]]),Lv=Ja("entity",()=>{const e=$(null);function t(i){e.value=i}const n=X(()=>{var i;return((i=e.value)==null?void 0:i.name)??""}),o=X(()=>{var i;return((i=e.value)==null?void 0:i.start_date)??""}),s=X(()=>{var i;return((i=e.value)==null?void 0:i.due_date)??""}),r=X(()=>{const i=e.value;return{parentName:(i==null?void 0:i.name)??null,parentStartDate:i!=null&&i.start_date?lt.fromJSDate(new Date(i==null?void 0:i.start_date)):null,parentDueDate:i!=null&&i.due_date?lt.fromJSDate(new Date(i==null?void 0:i.due_date)):null}});return{entityData:e,setEntityData:t,entityName:n,entityStartDate:o,entityEndDate:s,parentConfig:r}}),eee=ot({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=Dn("isSelectAll",$(!1)),r=Dn("bulkUpdate",$(!1)),i=X(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=so(!r.value,o),l=Dn("filterParams",null),u=$(null),c=async L=>{var x,P,k,M;try{y.value=!0,n("update-start");let N={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in L&&(N.startDate=L.start?Tv(L.start):null),"end"in L&&(N.dueDate=L.end?Tv(L.end):null),i.value?(N.itemIds=void 0,N.entityId=o.entityId):N.entityId=void 0;const B=await((P=(x=a.value)==null?void 0:x.changeDate)==null?void 0:P.call(x,N));n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:N}),n("update-completed",B),(k=u.value)==null||k.hide()}catch(N){console.error("Failed to update dates:",N),ht(()=>{ht(()=>{var B;n("update-failed"),(B=u.value)==null||B.open()})})}finally{(M=S.value)==null||M.resetCalendarLogic(),y.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{w.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const x=o.rowSelected[0].dateRange;b.value=[(x==null?void 0:x[0])??null,(x==null?void 0:x[1])??null],w.value=!1,v.value=!1},p=()=>{var x,P;if(o.rowSelected.some(k=>k.dateRange&&(k.dateRange[0]!==null||k.dateRange[1]!==null))){const k=g(0),M=g(1);if(v.value=k,w.value=M,k)b.value[0]=null;else{const N=((x=o.rowSelected[0].dateRange)==null?void 0:x[0])??null;b.value[0]=N}if(M)b.value[1]=null;else{const N=((P=o.rowSelected[0].dateRange)==null?void 0:P[1])??null;b.value[1]=N}}else v.value=!1,w.value=!1,b.value=[null,null]},g=L=>{const x=o.rowSelected.map(k=>{var M;return(M=k.dateRange)==null?void 0:M[L]});return x.length===0?!1:new Set(x.map(k=>{var M;return(M=k==null?void 0:k.getTime)==null?void 0:M.call(k)})).size>1},v=$(!1),w=$(!1),S=$(null),b=$([null,null]);Qe([()=>o.ids,()=>o.rowSelected],L=>{d(),ht(()=>{var x;(x=S.value)==null||x.focus()})},{immediate:!0,deep:!0});const y=$(!1),E=()=>{y.value=!0},_=()=>{ht(()=>{setTimeout(()=>{y.value=!1},500)})},I=(L,x)=>{L&&ht(()=>{var P;(P=S.value)==null||P.focus()})},T=Lv(),{parentConfig:F}=go(T);return(L,x)=>(q(),je(jf,{ref_key:"wrapperRef",ref:u,isUpdating:y.value,disabled:o.disabled||y.value,onOnVisibleChange:I},{trigger:we(({hide:P,disabled:k})=>[ye(St,{variant:o.variant,loading:y.value,disabled:k,onEscape:P},{default:we(()=>[ye(gt,{src:"Calendar"}),x[0]||(x[0]=tt(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({isVisible:P,hide:k})=>[P?(q(),je(Nv,{key:0,"parent-config":V(F),immediatelyUpdate:!1,value:b.value,onConfirmed:c,ref_key:"calendarRef",ref:S,onClosed:k,onStartUpdate:E,onFinishUpdate:_,multipleDueDates:w.value,multipleStartDates:v.value},null,8,["parent-config","value","onClosed","multipleDueDates","multipleStartDates"])):Ye("",!0)]),default:we(()=>[x[1]||(x[1]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tee=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"},iM=Ja("metricStore",()=>{const e=$();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return tee(o)}}}),nee=["onKeydown"],oee=["width","height","viewBox"],see=["d"],ree="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",aM=ot({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(o.modelValue??0),i=$(null),a=X(()=>{var x;return((x=o.params)==null?void 0:x.size)??24}),l=X(()=>{var x;return((x=o.params)==null?void 0:x.iconViewBox)??"0 0 24 24"}),u=X(()=>{var x;return((x=o.params)==null?void 0:x.iconPath)??ree}),c=X(()=>{var x;return((x=o.params)==null?void 0:x.wrapperTag)??"span"}),d=X(()=>{var x;return o.disabled||((x=o.params)==null?void 0:x.disabled)||!1}),h=X(()=>{var x;return o.readOnly||((x=o.params)==null?void 0:x.readOnly)||!1}),f=X(()=>!d.value&&!h.value),p=X(()=>d.value?"not-allowed":h.value?"default":"pointer");Qe(()=>o.modelValue,x=>{typeof x=="number"&&x!==r.value&&(r.value=x)});const g=x=>{var P;return((P=o.params)==null?void 0:P.maxRating)-x+1<=r.value&&!v.value},v=$(!1),w=()=>{v.value=!0},S=()=>{v.value=!1},b=x=>{f.value&&y(x)},y=x=>{var k,M;if(!f.value)return;let P=((k=o.params)==null?void 0:k.maxRating)-x+1;P===r.value&&(P=0),r.value=P,s("update:modelValue",P),s("update",P),s("change",P),(M=o.params)!=null&&M.onUpdate&&o.params.onUpdate(P)},E=x=>{var P;x!==r.value&&(r.value=x,s("update:modelValue",x),s("update",x),s("change",x),(P=o.params)!=null&&P.onUpdate&&o.params.onUpdate(x),_.value=x)},_=$(r.value),I=x=>{x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation(),r.value=_.value,s("cancel")},T=x=>{x.preventDefault(),E(r.value),s("handleEnter",r.value)},F=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),E(r.value))},L=()=>{f.value&&(r.value=Math.max(r.value-1,0),E(r.value))};return t({focus:()=>{var x;(x=i.value)==null||x.focus()}}),(x,P)=>(q(),de("div",{class:le(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:hn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[po(Ht(L,["prevent"]),["left"]),po(Ht(F,["prevent"]),["right"]),po(Ht(L,["prevent"]),["down"]),po(Ht(F,["prevent"]),["up"]),po(Ht(T,["prevent"]),["enter"]),po(Ht(T,["prevent"]),["tab"]),po(Ht(I,["prevent"]),["escape"])]},[(q(!0),de(Pt,null,xn(e.params.maxRating,k=>(q(),je(OC(c.value),{key:k,class:le(["rating-item",{filled:g(k),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:hn({cursor:p.value,order:e.params.maxRating-k,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(k),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-k+1,tabindex:-1,onClick:Ht(M=>b(k),["prevent","stop"]),onMouseenter:w,onMouseleave:S},{default:we(()=>[kt(x.$slots,"icon",{index:k,filled:g(k),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:k},()=>[(q(),de("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[Se("path",{d:u.value},null,8,see)],8,oee))]),kt(x.$slots,"overlay",{index:k,filled:g(k),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,nee))}}),iee={style:{maxWidth:"180px",lineHeight:"15px"}},aee=["innerHTML"],lM=ot({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var w;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(y=>({label:y.name,value:y.name,id:y.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((w=v.restricted_value)==null?void 0:w.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},u=X(()=>l(s.config)),c=$(s.modelValue),d=v=>{c.value=v,r("update:modelValue",v),r("change",v||null)},h=$(u.value),f=$(!1),p=v=>{f.value=!0,v?h.value=u.value.filter(w=>w.label.toLowerCase().includes(v.toLowerCase())):h.value=u.value,setTimeout(()=>{f.value=!1},300)},g=$(null);return Xt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,w)=>(q(),je(ya,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:w[0]||(w[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:we(({item:S,getHighlightedLabel:b,selectedIndex:y,index:E})=>[ye(fl,{hover:y==E,selected:S.value===e.modelValue,label:S.label,onSelect:_=>d(S.value||null),onClick:_=>d(S.value||null)},{label:we(()=>[Se("div",iee,[ze(Se("span",{innerHTML:b(S.label)},null,8,aee),[[V(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":we(()=>[...w[1]||(w[1]=[tt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),lee={class:"metric-input-wrapper"},uee={key:0,class:"error-text input-2"},uM=ot({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=$(s.modelValue),i=$(s.modelValue),a=$(!1),l=$(!0),u=$(""),c=X(()=>{var N;const M=Number.parseInt(String((N=s.config)==null?void 0:N.format_value)||"2",10);return Number.isFinite(M)&&M>=0?M:2}),d=M=>{if(!M)return M;const N=String(M).split(".");return N.length>1&&N[1].length>c.value?c.value===0?N[0]:`${N[0]}.${N[1].slice(0,c.value)}`:String(M)},h=M=>{const N=d(M);N!==M&&b.value?r.value=N:r.value=M},f=M=>{const N=M.target;if(!N)return;const B=N.value||"",z=B.indexOf(".");if(M.key==="."&&c.value===0){M.preventDefault();return}z!==-1&&/[0-9]/.test(M.key)&&B.slice(z+1).length>=c.value&&M.preventDefault()},p=X(()=>l.value||s.showInlineError?{content:""}:{content:u.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var se;const M=s.config.restricted_type.trim(),N=((se=s.config.restricted_value)==null?void 0:se.split(",").map(Number))||[],[B,z]=N,ie={range:`Enter a value between ${B} and ${z}`,not:`These values are not allowed: ${N.join(", ")}`,exact:"Value is not allowed"}[M];return l.value?"":ie},v=X(()=>{var N;let M="";return Number((N=s.config)==null?void 0:N.format_value)&&(M+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${M}`});Qe(()=>s.modelValue,M=>{r.value=M,i.value=M});const w=M=>bv(s.config,M),S=n,b=$(null),y=M=>{const N=M===""?null:M,B=i.value===""?null:i.value;return N!==B},E=M=>{const N=d(M);if(!y(N))return!1;const B=N===""?null:N;return r.value=B,i.value=B,S("update:modelValue",B),S("handleChange",B),!0},_=()=>{r.value=i.value,S("update:modelValue",i.value)},I=(M,N)=>{E(M),S("enter")},T=(M,N)=>{if(a.value){a.value=!1;return}s.saveOnBlur?E(M):_()},F=M=>{if(M===null||M===""){l.value=!0;return}l.value=bv(s.config,Number(M)),u.value=l.value?"":g()},L=(M,N)=>{a.value=!0,s.saveOnEscape?E(M):_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},x=M=>{F(M),S("onValidation",M)},P=()=>{a.value=!0,_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},k=()=>{var M;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(M=b.value)==null||M.focus()};return t({focus:()=>{var M;return(M=b.value)==null?void 0:M.focus()},blur:()=>{var M;return(M=b.value)==null?void 0:M.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>E(r.value),revert:_}),Xt(()=>{var M;(M=b.value)==null||M.focus()}),(M,N)=>ze((q(),de("div",lee,[ye(hl,{maxDecimalChar:c.value,modelValue:r.value,"onUpdate:modelValue":N[0]||(N[0]=B=>r.value=B),placeholder:v.value,validatorFnc:w,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:I,onBlur:T,onClear:k,onEscape:L,onCancel:P,onOnValidation:x,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(q(),de("span",uee,at(u.value),1)):Ye("",!0)])),[[V(o),p.value]])}}),cee={key:2},dee={class:"wrapper-suffix"},hee={key:3},fee=_t(ot({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=$(null),i=$(0),a=$(null),l=$(null),u=X(()=>TO(s.config)),c=$(!1),d=X(()=>!!ne.value),h=n,f=()=>{c.value=!1,j(),h("cancel")},p=$(!0),g=ue=>{if(ue===null||ue===""){p.value=!0;return}if(u.value!=="number"){p.value=!0;return}p.value=bv(s.config,Number(ue)),w.value=S()},v=()=>{c.value=!0,z()},w=$(""),S=()=>{var ce;const ue=s.config.restricted_type.trim(),K=((ce=s.config.restricted_value)==null?void 0:ce.split(",").map(Number))||[],[Y,re]=K,G={range:`Enter a value between ${Y} and ${re}`,not:`These values are not allowed: ${K.join(", ")}`,exact:"Value is not allowed"}[ue];return p.value?"":G},b=X(()=>{var K;const ue=Number.parseInt(String((K=s.config)==null?void 0:K.format_value)||"2",10);return Number.isFinite(ue)&&ue>=0?ue:2}),y=ue=>{c.value=!0,r.value=ue},E=()=>{c.value=!0,j(),z()},_=ue=>{i.value=ue,c.value=!0,z()},I=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(K=>K.charAt(0).toUpperCase()+K.slice(1)).join("").replace(/Outline|Solid/g,""),T=$(null),F=$(!0),L=X(()=>{var ue;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((ue=r.value)==null?void 0:ue.length)===0,wrapperRef:Z,active:d,focus:s.focus,bordered:!0}}),x=$(null),P=X(()=>F.value),k=X(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:x,active:P,focus:F.value,bordered:!0})),{argsMain:M}=xo(k),{argsMain:N}=xo(L),B=$(null),z=()=>{ht(()=>{var ue;(ue=B.value)==null||ue.focus()})},oe=ue=>{var K;if(ue.format_type==="dropdown"&&ue.format_value)try{const Y=JSON.parse(ue.format_value);if(Array.isArray(Y))return Y.map(re=>({label:re.name,value:re.name,id:re.name}))}catch(Y){console.error("Failed to parse dropdown options",Y)}return ue.format_type=="number"&&ue.restricted_type=="exact"?((K=ue.restricted_value)==null?void 0:K.split(",").map(re=>({label:ue.mapping[`!${re}`]||re,value:re,id:re})))||[]:[]},ie=X(()=>oe(s.config)),te=X(()=>{var ue;return((ue=ie.value.find(K=>K.value===r.value))==null?void 0:ue.label)||r.value||"-"}),se=()=>{var ue;if(u.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(u.value=="number"){const K=(ue=l.value)==null?void 0:ue.getValue();h("updateMetric",K||null)}else h("updateMetric",r.value||null);c.value=!1,j()},{triggerRef:Z,popupRef:A,hide:j,isVisible:ne,show:ge}=vo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),xe=()=>{switch(u.value){case"number":ht(()=>{var ue;(ue=l.value)==null||ue.focus()});break;case"dropdown":ge(),ht(()=>{var ue;(ue=T.value)==null||ue.focus()});break;case"rating":F.value=!0,ht(()=>{var ue;(ue=a.value)==null||ue.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,c.value=!1},focus:xe,hasChanges:()=>c.value}),Xt(()=>{ht(()=>{setTimeout(()=>{xe()},300)})}),(ue,K)=>(q(),de("div",{class:le(ue.$style["metric-editor"])},[u.value=="number"?(q(),je(uM,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>r.value=Y),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:y,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):u.value=="rating"?(q(),je(No,jt({key:1,"tab-index":1},V(M),{ref_key:"triggerRef2",ref:x,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:we(()=>[ye(aM,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":K[1]||(K[1]=Y=>i.value=Y),onHandleEnter:_,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:we(()=>[ye(gt,{source:"rating",src:I()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):u.value=="dropdown"?(q(),de("div",cee,[ye(No,jt(V(N),{ref_key:"triggerRef",ref:Z,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:we(({})=>[Se("div",dee,[ye(gt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:we(()=>[ze((q(),de("span",null,[tt(at(te.value||""),1)])),[[V(o),{content:te.value}]])]),_:1},16),Se("div",{ref_key:"popupRef",ref:A},[V(ne)?(q(),je(lM,{key:0,ref_key:"metricEditorDropdownRef",ref:T,config:s.config,modelValue:r.value,"onUpdate:modelValue":K[2]||(K[2]=Y=>r.value=Y),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ye("",!0)],512)])):(q(),de("span",hee,"Formular")),ze((q(),je(St,{ref_key:"confirmButtonRef",ref:B,onHandleClick:se,"tab-index":"1",onKeypress:[po(Ht(xe,["shift","prevent"]),["tab"]),po(Ht(f,["prevent"]),["escape"])],disabled:!p.value},{default:we(()=>[ye(gt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[V(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),pee=_t(ot({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=n,i=$(!1),a=$(null),l=$(null),u=()=>{i.value=!i.value},c=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await ht(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const w={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&c()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];w&&w()};return Qe(i,g=>{g&&r("open")}),t({hide:c,show:d}),(g,v)=>(q(),de("div",{class:le([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[Se("div",{class:le(g.$style["metric-label"]),onClick:Ht(u,["stop"])},[kt(g.$slots,"default",{open:i.value},()=>[ze((q(),de("span",{class:le(g.$style["metric-name"])},[tt(at(e.label),1)],2)),[[V(o),{content:e.label}]]),e.morpheme&&i.value?(q(),de("small",{key:0,class:le(g.$style["metric-morpheme"])}," ("+at(e.morpheme)+") ",3)):Ye("",!0)])],2),ye(Xz,{mode:"out-in",name:"slide"},{default:we(()=>[i.value?(q(),je(fee,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Ye("",!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"}}]]);function cM(e,t){return function(){return e.apply(t,arguments)}}const{toString:gee}=Object.prototype,{getPrototypeOf:wa}=Object,{iterator:qf,toStringTag:dM}=Symbol,Ca=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),hM=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),Vv=(e,t,n)=>e===Object.prototype||!n&&t===null,mee=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(n=>{if(hM(n))return!1;const o=Object.getOwnPropertyDescriptor(e,n);return!!o&&o.configurable&&o.writable===!0})},DE=(e,t)=>{let n=e;const o=[];for(;n!=null;){if(o.indexOf(n)!==-1)return!1;o.push(n);const s=wa(n);if(Vv(n,s,n===e))return!1;if(Ca(n,t))return!0;n=s}return!1},vee=(e,t)=>e!=null&&DE(e,t)?e[t]:void 0,yee=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=wa(e);if(t===null&&mee(e))return e;const n=Object.create(null),o=Object.create(null),s=[];let r=e;for(;r!=null&&s.indexOf(r)===-1;){s.push(r);const i=r===e?t:wa(r);if(Vv(r,i,r===e))break;const a=Object.getOwnPropertyNames(r);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(r));for(const l of a)hM(l)||Ca(o,l)||(n[l]=e[l],o[l]=!0);r=i}return n},IE=(e=>t=>{const n=gee.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),_r=e=>(e=e.toLowerCase(),t=>IE(t)===e),Bv=e=>t=>typeof t===e,{isArray:xu}=Array,Au=Bv("undefined");function pd(e){return e!==null&&!Au(e)&&e.constructor!==null&&!Au(e.constructor)&&Ts(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fM=_r("ArrayBuffer");function wee(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fM(e.buffer),t}const Cee=Bv("string"),Ts=Bv("function"),bee=Bv("number"),gd=e=>e!==null&&typeof e=="object",See=e=>e===!0||e===!1,$v=e=>{if(!gd(e))return!1;const t=wa(e);return(t===null||t===Object.prototype||wa(t)===null)&&(Vv(e,t,!0)||!Ca(e,dM)&&!Ca(e,qf))},Eee=e=>{if(!gd(e)||pd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},_ee=_r("Date"),Ree=_r("File"),Tee=e=>!!(e&&typeof e.uri<"u"),Dee=e=>e&&typeof e.getParts<"u",Iee=_r("Blob"),xee=_r("FileList"),Aee=_r("Set"),Pee=e=>gd(e)&&Ts(e.pipe);function kee(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const pM=kee(),gM=typeof pM.FormData<"u"?pM.FormData:void 0,Fee=e=>{if(!e)return!1;if(gM&&e instanceof gM)return!0;const t=wa(e);if(!t||t===Object.prototype||!Ts(e.append))return!1;const n=IE(e);return n==="formdata"||n==="object"&&Ts(e.toString)&&e.toString()==="[object FormData]"},Oee=_r("URLSearchParams"),[Mee,Nee,Lee,Vee]=["ReadableStream","Request","Response","Headers"].map(_r),Bee=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),xu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(pd(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function $ee(e,t){if(pd(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const Pu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mM=e=>!Au(e)&&e!==Pu;function xE(...e){const{caseless:t,skipUndefined:n}=mM(this)&&this||{},o={},s=t?Object.create(null):null,r=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;let l=a;if(s&&typeof a=="string"){const c=a.toLowerCase(),d=s[c];d!==void 0&&Ca(o,d)?l=d:s[c]=a}const u=Ca(o,l)?o[l]:void 0;$v(u)&&$v(i)?o[l]=xE(u,i):$v(i)?o[l]=xE({},i):xu(i)?o[l]=i.slice():(!n||!Au(i))&&(o[l]=i)};for(let i=0,a=e.length;i<a;i++){const l=e[i];if(!l||pd(l)||(Yf(l,r),typeof l!="object"||xu(l)||!Object.getOwnPropertySymbols))continue;const u=Object.getOwnPropertySymbols(l);for(let c=0;c<u.length;c++){const d=u[c];Jee.call(l,d)&&r(l[d],d)}}return o}const Hee=(e,t,n,{allOwnKeys:o}={})=>(Yf(t,(s,r)=>{n&&Ts(s)?Object.defineProperty(e,r,{__proto__:null,value:cM(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),Gee=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uee=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Wee=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&wa(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zee=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},jee=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,o=new Set;let s=e;for(;s!=null&&n.size<t;){if(o.has(s))return null;o.add(s);const i=wa(s);if(Vv(s,i,s===e))break;Object.getOwnPropertyNames(s).forEach(a=>{const l=+a;Number.isInteger(l)&&l>=0&&l<t&&String(l)===a&&Ca(s,a)&&n.add(l)}),s=i}if(n.size!==t)return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Kee=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&wa(Uint8Array)),qee=(e,t)=>{const o=(e&&e[qf]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},Yee=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},Xee=_r("HTMLFormElement"),Zee=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),{propertyIsEnumerable:Jee}=Object.prototype,Qee=_r("RegExp"),vM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Yf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},ete=e=>{vM(e,(t,n)=>{if(Ts(e)&&["arguments","caller","callee"].includes(n))return!1;const o=e[n];if(Ts(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},tte=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return xu(e)?o(e):o(String(e).split(t)),n},nte=()=>{},ote=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ste(e){return!!(e&&Ts(e.append)&&e[dM]==="FormData"&&e[qf])}const rte=e=>{const t=new WeakSet,n=o=>{if(gd(o)){if(t.has(o))return;if(pd(o))return o;if(!("toJSON"in o)){t.add(o);let s;if(Aee(o)){s=[];for(const r of o){const i=n(r);!Au(i)&&s.push(i)}}else s=xu(o)?[]:{},Yf(o,(r,i)=>{const a=n(r);!Au(a)&&(s[i]=a)});return t.delete(o),s}}return o};return n(e)},ite=_r("AsyncFunction"),ate=e=>e&&(gd(e)||Ts(e))&&Ts(e.then)&&Ts(e.catch),yM=((e,t)=>e?setImmediate:t?((n,o)=>(Pu.addEventListener("message",({source:s,data:r})=>{s===Pu&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),Pu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ts(Pu.postMessage)),lte=typeof queueMicrotask<"u"?queueMicrotask.bind(Pu):typeof ee<"u"&&ee.nextTick||yM,wM=e=>e!=null&&Ts(e[qf]),he={isArray:xu,isArrayBuffer:fM,isBuffer:pd,isFormData:Fee,isArrayBufferView:wee,isString:Cee,isNumber:bee,isBoolean:See,isObject:gd,isPlainObject:$v,isEmptyObject:Eee,isReadableStream:Mee,isRequest:Nee,isResponse:Lee,isHeaders:Vee,isUndefined:Au,isDate:_ee,isFile:Ree,isReactNativeBlob:Tee,isReactNative:Dee,isBlob:Iee,isRegExp:Qee,isFunction:Ts,isStream:Pee,isURLSearchParams:Oee,isTypedArray:Kee,isFileList:xee,forEach:Yf,merge:xE,extend:Hee,trim:Bee,stripBOM:Gee,inherits:Uee,toFlatObject:Wee,kindOf:IE,kindOfTest:_r,endsWith:zee,toArray:jee,forEachEntry:qee,matchAll:Yee,isHTMLForm:Xee,hasOwnProperty:Ca,hasOwnProp:Ca,hasOwnInPrototypeChain:DE,getSafeProp:vee,toSafeFlatObject:yee,reduceDescriptors:vM,freezeMethods:ete,toObjectSet:tte,toCamelCase:Zee,noop:nte,toFiniteNumber:ote,findKey:$ee,global:Pu,isContextDefined:mM,isSpecCompliantForm:ste,toJSONObject:rte,isAsyncFn:ite,isThenable:ate,setImmediate:yM,asap:lte,isIterable:wM,isSafeIterable:e=>e!=null&&DE(e,qf)&&wM(e)},ute=he.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"]),cte=e=>{const t=Object.create(null);let n,o,s;return e&&e.split(`
147
+ `},u=()=>{const p=xv(n),g=e.zIndex?e.zIndex-1:998;if(t.centered&&p){if(r.value=!0,l(p),t.showOverlay){const v=()=>{t.closeOnOverlayClick&&c()};a=AO(t.overlayOpacity,g,v)}}else if(s.value&&(s.value.show(),r.value=!0,t.showOverlay)){const v=()=>{t.closeOnOverlayClick&&c()};a=AO(t.overlayOpacity,g,v)}},c=()=>{const p=xv(n);t.centered&&p?(r.value=!1,p.style.display="none",t.showOverlay&&(uE(a||void 0),a=null)):s.value&&(s.value.hide(),r.value=!1,t.showOverlay&&(uE(a||void 0),a=null))},d=()=>{r.value?c():u()},h=()=>{s.value&&(s.value.destroy(),s.value=null),t.showOverlay&&a&&(uE(a),a=null)},f=()=>{var v;const p=xv(n);if(!p)return;if(p.style.display="none",t.centered){t.showOnInit&&u();return}const g={content:p,placement:t.placement,theme:t.theme,trigger:t.trigger,interactive:t.interactive,appendTo:t.appendTo,arrow:t.showArrow,allowHTML:!0,hideOnClick:!1,popperOptions:{...t.popperOptions,modifiers:[...((v=t.popperOptions)==null?void 0:v.modifiers)||[],{name:"computeStyles",options:{adaptive:!1}}]},onShow(){r.value=!0,p.style.display="block"},onHide(){r.value=!1}};if(t.useTrigger){const w=xv(o);if(!w)return;s.value=tl(w,g)}else{const w=document.createElement("div");w.style.display="none",document.body.appendChild(w),s.value=tl(w,g)}t.showOnInit&&u()};return Xt(()=>{f()}),Vn(()=>{h()}),Qe(()=>t.alwaysShow,p=>{p?u():c()},{immediate:!0}),{popupRef:n,triggerRef:o,instance:s,isVisible:r,show:u,hide:c,toggle:d,destroy:h}}const cE=Ja("permissionStore",()=>{const e=$([]),t=$(),n=$({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),xJ="woohoo_getWoohooUserInterface_read",dE="media_getReviewUserInterface_read",AJ="update_getUpdateUserInterface_read",PO="Unarchive parent folder first to continue",PJ=(e,t,n,o,s,r)=>{const i=cE(),{userPermissions:a}=go(i),l=X(()=>{const T=un.getInstance().getItem("BASE_URL"),F=un.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:L,entity_id:x,scene_id:P}=e.value;return{baseDomain:T||"",ws_code:L||"",entity_id:x||"",scene_id:P||"",reviewDomain:F||"",take_id:x||"",woohoo_id:x||"",parent_id:x||""}}),u=X(()=>{var F;const T=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(dE),canCopyLink:!0,canRename:(T==null?void 0:T.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(dE),canOpenTakeInUpdate:a.value.includes(AJ),canOpenTakeInWoohoo:a.value.includes(xJ),canDeleteRendition:((F=T==null?void 0:T.media)==null?void 0:F.has_delete_rendition_permission)??!1,canDeleteThumbnail:(T==null?void 0:T.has_edit_thumbnail_permission)??!1,canArchiveScene:T==null?void 0:T.has_archive_permission,canUnarchiveScene:T==null?void 0:T.has_archive_permission,canDeleteScene:(T==null?void 0:T.has_delete_permission)??!1,canEditDescription:(T==null?void 0:T.has_edit_permission)??!1}}),c=X(()=>({project:es({type:"project",config:l.value}).url,take_review:es({type:"review_take",config:l.value}).url,review:es({type:"review_scene",config:l.value}).url,review_scene:es({type:"review_scene",config:l.value}).url,woohoo:es({type:"woohoo",config:l.value}).url,update:es({type:"update",config:l.value}).url,scene_hub:es({type:"scene_hub",config:l.value}).url})),d=(T,F)=>{const L=T.metaKey||T.ctrlKey,x=c.value[F]||"";if(x){if(F==="scene_hub"){if(L){window.open(x,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}L?window.open(x,"_blank"):window.location.href=x}},h=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(x==null?void 0:x.message)!="Done"&&console.error("Failed to delete rendition.")}catch(x){console.error("Error deleting rendition",x)}finally{s()}},f=async(T,F)=>{var L;try{await((L=e.value.axiosService.value)==null?void 0:L.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(x){console.error("Error deleting thumbnail",x)}finally{s()}},p=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(x==null?void 0:x.message)!="Done"&&console.error("Failed to archive scene."),F&&F("archived")}catch(x){console.error("Error archiving item",x)}finally{s()}},g=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(x==null?void 0:x.message)!="Done"&&console.error("Failed to delete scene."),F&&F("deleted")}catch(x){console.error("Error deleting item",x)}finally{s()}},v=T=>{const F=c.value.scene_hub||"";F&&(E.value="Copied",navigator.clipboard.writeText(F),setTimeout(()=>{E.value="Copy link"},5e3))},w=async(T,F)=>{var L;try{const x=await((L=e.value.axiosService.value)==null?void 0:L.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(x==null?void 0:x.message)!="Done"&&console.error("Failed to unarchive scene."),F&&F("unarchived")}catch(x){console.error("Error unarchiving item",x)}finally{s()}},S=T=>p(T,t),b=T=>w(T,t),y=T=>g(T,t),E=$("Copy link"),_=T=>d(T,"review"),I=X(()=>{let T=[];if(!l.value.scene_id&&e.value.optionBlock&&T.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const F=()=>Math.random().toString(36).substring(2,9);return[{id:F(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:_,hide:!u.value.canOpenReview,disabled:!u.value.canOpenReview,description:"",type:"icon"},{id:F(),label:E.value,icon:"Link",action:v,hide:!u.value.canCopyLink,disabled:!u.value.canCopyLink,description:"",type:"icon"}]},{id:F(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:u.value.canArchiveScene==0,disabled:u.value.canArchiveScene!==1,description:u.value.canArchiveScene==-1?PO:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:u.value.canUnarchiveScene==0,disabled:u.value.canUnarchiveScene!==1,description:u.value.canUnarchiveScene===-1?PO:"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:y,hide:!u.value.canDeleteScene,type:"icon"}]}]});return{linkMap:c,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:w,options:I}};function xo(e){const t=$(!1),n=$(!1),o=X(()=>{var d;const u=e.value,c=!!u.readOnly;return{readOnly:c,disabled:!!u.disabled,hovered:n.value,focused:t.value,isEmpty:u.empty??!1,error:!!u.error,actived:!!((d=u.active)!=null&&d.value),clickable:c?!1:u.clickable??!1}}),s=()=>{t.value=!0,ht(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},r=()=>{t.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return Xt(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",s),u.addEventListener("blur",r)),c&&(c.addEventListener("mouseenter",i),c.addEventListener("mouseleave",a))}),Vn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",s),u.removeEventListener("blur",r)),c&&(c.removeEventListener("mouseenter",i),c.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const ld=e=>{const t=$(!1),n=X(()=>t.value);return Xt(()=>{var a,l,u,c;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(c=(u=e.params)==null?void 0:u.colDef)==null?void 0:c.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),Qe(()=>e,()=>{e.isEditing!==void 0&&(t.value=e.isEditing)}),{isEditing:n}};var fs=(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))(fs||{});const Gf=Ja("bulkUpdate",()=>{const e=$(Ft.UNCHECK),t=Fo({loaded:0,total:0}),n=c=>{t.total=c},o=c=>{t.loaded=c},s=Fo({isBulkUpdating:!1});function r(c){s.isBulkUpdating=c}const i=$({}),a=c=>{i.value=c},l=(c,d)=>{i.value[c]=d},u=c=>{e.value=c};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:u,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{u(Ft.CHECKED)}}}),kJ={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{error:"Deletion failed. Please try again."},delete_thumbnail:{error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{},bulkRename:{},bulkCreate:{}},offline:{error:"You are currently offline. Please check your network connection."}};function kO(e,t,n){return(t=OJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OJ(e){var t=FJ(e,"string");return typeof t=="symbol"?t:t+""}function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var FO=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function OO(e){return Du(e)==="object"&&e!==null&&!Array.isArray(e)}function MO(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function MJ(e){return typeof Blob<"u"&&e instanceof Blob}var NJ=function(t){return OO(t)&&MO(t,["file","fileName"])&&MJ(t.file)&&typeof t.fileName=="string"},LJ=function(t){return OO(t)&&MO(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"};Object.freeze(kO(kO({},FO.TOOLBOX_EXPORT_DATA,NJ),FO.SW_APP_LOADER,LJ));let VJ=class extends Error{},dl=class extends VJ{constructor(){super("Zone is an abstract class")}},NO=class{get type(){throw new dl}get name(){throw new dl}get ianaName(){return this.name}get isUniversal(){throw new dl}offsetName(t,n){throw new dl}formatOffset(t,n){throw new dl}offset(t){throw new dl}equals(t){throw new dl}get isValid(){throw new dl}};const hE=new Map;function BJ(e){let t=hE.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),hE.set(e,t)),t}const $J={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function HJ(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,u,c]=o;return[i,s,r,a,l,u,c]}function GJ(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=$J[r];r==="era"?o[a]=i:Av(a)||(o[a]=parseInt(i,10))}return o}const fE=new Map;let UJ=class UT extends NO{static create(t){let n=fE.get(t);return n===void 0&&fE.set(t,n=new UT(t)),n}static resetCache(){fE.clear(),hE.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=UT.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return KJ(t,n,o,this.name)}formatOffset(t,n){return kv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=BJ(this.name);let[s,r,i,a,l,u,c]=o.formatToParts?GJ(o,n):HJ(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=jJ({year:s,month:r,day:i,hour:l===24?0:l,minute:u,second:c,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},pE=null,WJ=class bg extends NO{static get utcInstance(){return pE===null&&(pE=new bg(0)),pE}static instance(t){return t===0?bg.utcInstance:new bg(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new bg(VO(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${kv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${kv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return kv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function Av(e){return typeof e>"u"}function Pv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function LO(e){if(!(Av(e)||e===null||e===""))return parseInt(e,10)}function zJ(e){if(!(Av(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function jJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function KJ(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function VO(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function kv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Pv(n,2)}:${Pv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Pv(n,2)}${Pv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const BO=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ud(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function cd(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function $O(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=LO(t[n+s]);return[o,null,n+s]}}const HO=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,qJ=`(?:${HO.source}?(?:\\[(${BO.source})\\])?)?`,GO=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,UO=RegExp(`${GO.source}${qJ}`),gE=RegExp(`(?:[Tt]${UO.source})?`),YJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,XJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ZJ=/(\d{4})-?(\d{3})/,JJ=$O("weekYear","weekNumber","weekDay"),QJ=$O("year","ordinal"),eQ=/(\d{4})-(\d\d)-(\d\d)/,WO=RegExp(`${GO.source} ?(?:${HO.source}|(${BO.source}))?`),tQ=RegExp(`(?: ${WO.source})?`);function dd(e,t,n){const o=e[t];return Av(o)?n:LO(o)}function nQ(e,t){return[{year:dd(e,t),month:dd(e,t+1,1),day:dd(e,t+2,1)},null,t+3]}function hd(e,t){return[{hours:dd(e,t,0),minutes:dd(e,t+1,0),seconds:dd(e,t+2,0),milliseconds:zJ(e[t+3])},null,t+4]}function Uf(e,t){const n=!e[t]&&!e[t+1],o=VO(e[t+1],e[t+2]),s=n?null:WJ.instance(o);return[{},s,t+3]}function Wf(e,t){const n=e[t]?UJ.create(e[t]):null;return[{},n,t+1]}ud(YJ,gE),ud(XJ,gE),ud(ZJ,gE),ud(UO),cd(nQ,hd,Uf,Wf),cd(JJ,hd,Uf,Wf),cd(QJ,hd,Uf,Wf),cd(hd,Uf,Wf),cd(hd),ud(eQ,tQ),ud(WO),cd(hd,Uf,Wf);var Mo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Mo||{});Mo.review,Mo.review_take,Mo.review_scene,Mo.review_rendition,Mo.review_frame,Mo.review_rendition_comment,Mo.review_comment,Mo.scene_hub,Mo.hub_rendition,Mo.hub_comment,Mo.people_insight,Mo.people_detail,Mo.project,Mo.woohoo,Mo.update,Mo.core,Mo.project_focusMode;var mE=null;function oQ(e){mE=e}function Fv(){if(!mE)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return mE}function Ov(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function zO(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=Fv();return"".concat(Ov(t.t("errorMessages.fallback.unknownError"))," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function sQ(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&Du(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function rQ(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function jO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function KO(e,t){if(!e||Du(e)!=="object")return null;try{var n=Fv();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var u=l.rule,c=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var w,S=t.toUpperCase();v=(w=p[g])===null||w===void 0||(w=w.errorMessages)===null||w===void 0||(w=w[S])===null||w===void 0||(w=w.validation_rules)===null||w===void 0?void 0:w[u]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[u]}if(v&&typeof v=="string")return Ov(sQ(v,a,c,d))}catch(y){console.error("Error in validation rules",y)}}}}catch(y){return console.error("Error in getValidationErrorMessage:",y),null}return null}function qO(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return zO();var n=e.code,o=e.error,s=e.details,r=e.message;if(jO(s)&&s){var i=KO(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=Fv();return Ov(a.t("errorMessages.GEN.validation_error"))}catch{return"Validation error occurred."}}if(o&&Du(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var u,c,d,h="errorMessages.".concat(l,".").concat(o.key),f=Fv(),p=((u=f.messages)===null||u===void 0?void 0:u.value)||f.messages,g=((c=f.locale)===null||c===void 0?void 0:c.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var w=v;return s!=null&&s.context&&(w=rQ(w,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",w)),w=Ov(w),n!==""?"[".concat(n,"] ").concat(w," ").concat(t):"".concat(w," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&Du(o)!=="object"&&jO(s)){var S=KO(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):zO()}const Rs=Ja("toast",()=>{const e=u=>qO(u),t=u=>{var c;if((u==null?void 0:u.apiCode)==="offline")r({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const d=qO((c=u==null?void 0:u.res)==null?void 0:c.data);r({id:u==null?void 0:u.apiCode,type:"error",message:d})}},n=$([]),o=(u,c)=>{const d=kJ[u];if(d){const h=d[c];if(h){r({id:u,type:c,message:h});return}}else r({id:u,type:c,message:u})},s=new Map,r=(u,c=5e3)=>{const d={...u,id:u.id??Date.now()+Math.random()};if(n.value.push(d),c>0){const h=Date.now(),f=setTimeout(()=>{i(d.id),s.delete(d.id)},c);s.set(d.id,{timeoutId:f,remainingTime:c,startTime:h})}};function i(u){n.value=n.value.filter(d=>d.id!==u);const c=s.get(u);c&&(clearTimeout(c.timeoutId),s.delete(u))}function a(u){const c=s.get(u);if(c){clearTimeout(c.timeoutId);const d=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-d)}}function l(u){const c=s.get(u);if(c&&c.remainingTime>0){const d=setTimeout(()=>{i(u),s.delete(u)},c.remainingTime);c.timeoutId=d,c.startTime=Date.now()}}return{notifications:n,addNotification:r,removeNotification:i,showMessage:o,showErrorNetMessage:t,pauseAutoDismiss:a,resumeAutoDismiss:l,getErrorMessageFromResponse:e}}),vE=Ja("sortStore",()=>{const e=$({}),t=$(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}};return{sortingAPIConfiguration:X(()=>{const u=e.value;return Object.values(u).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),sorts:e,setSort:(u,c)=>{e.value={[u]:{colId:u,sort:c}}},clearSorting:()=>{e.value={}},isSortingRunning:$(!1),defaultSortStorePreferences:t,setDefaultSort:u=>{t.value=u}}}),yE=10,wE=5,Ei={number:{first:"000",step:"1"},letter:{first:"A",step:"1"}},YO={up:{first:"Start at",step:"Increase by"},down:{first:"End at",step:"Decrease by"}},iQ=/^[0-9]$/,aQ=/^[A-Za-z]$/,XO=(e,t)=>t==="first"&&e==="letter"?aQ:iQ,ZO=(e,t,n)=>XO(e,t).test(n),lQ=e=>e==="first"?yE:wE,uQ=e=>e&&e[0]===e[0].toLowerCase()?e.toLowerCase():e.toUpperCase(),JO=(e,t,n)=>{const o=XO(e,t),s=Array.from(n).filter(r=>o.test(r)).join("").slice(0,lQ(t));return t==="first"&&e==="letter"?uQ(s):s},Mv=(e,t)=>t!==""&&(e==="first"||Number(t)>0),cQ=e=>Array.from(e.toUpperCase()).reduce((t,n)=>t*26+(n.charCodeAt(0)-64),0),dQ=e=>{let t="",n=e;for(;n>0;){const o=(n-1)%26;t=String.fromCharCode(65+o)+t,n=Math.floor((n-1)/26)}return t},CE=({type:e,direction:t,first:n,step:o,count:s})=>{const r=Number(o)||1,i=u=>(t==="up"?u:s-1-u)*r;if(e==="number"){const u=Number(n);return Array.from({length:s},(c,d)=>String(u+i(d)).padStart(n.length,"0"))}const a=cQ(n),l=n!==""&&n[0]===n[0].toLowerCase();return Array.from({length:s},(u,c)=>{const d=dQ(a+i(c));return l?d.toLowerCase():d})},hQ="Your update is queued. Reload the table later to see the changes.",bE="Update failed.",fQ=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]),pQ=(e,t,n)=>{const o=e.getRowNode(t);o&&o.setData({...o.data,...n})},gQ=(e,{currentName:t,counterValue:n})=>e.map(o=>{switch(o.type){case"text":return o.value;case"current_name":return t;case"counter":return n;default:return""}}).join(""),mQ=(e,t)=>{const n=e.find(o=>o.type==="counter");return n?CE({type:n.format,direction:n.direction==="asc"?"up":"down",first:n.value,step:n.step,count:t}):[]},QO=(e,t,n)=>Rs().addNotification({id:n,type:e,message:t}),vQ=(e,t,n={})=>{const o=Gf(),{selectionStatus:s}=go(o),{sortingAPIConfiguration:r}=go(vE()),i=X(()=>s.value===Ft.CHECKED),a=X(()=>e.selectRowData.map(se=>se.id)),l=X(()=>e.selectRowData.length>0),{apiServices:u}=so(!1,e),c=Dn("filterParams",void 0),d=X(()=>({workspaceId:String(e.workspaceId),itemIds:l.value&&i.value?[]:a.value,entityId:e.entityId,filterParams:c!=null&&c.value?c.value:void 0})),h=$(!0),f=$(!1);let p=null;const g=se=>{var A,j;if(!se.apiCode||!fQ.has(se.apiCode))return;const Z=(A=se.res)==null?void 0:A.data;p={success:se.success,status:(j=se.res)==null?void 0:j.status,data:typeof Z=="object"&&Z!==null?Z:void 0,error:se.error}};Qe(u,(se,Z)=>{Z==null||Z.off("call-api",g),se==null||se.on("call-api",g)},{immediate:!0}),Vn(()=>{var se;return(se=u.value)==null?void 0:se.off("call-api",g)}),Qe(()=>e.selectRowData,()=>{h.value=!1},{deep:!0,immediate:!0});const v=()=>{p=null},w=se=>{var xe,ue;const Z=p,A=Z==null?void 0:Z.data,j=(Z==null?void 0:Z.error)??se,ne=(A==null?void 0:A.message)??((ue=(xe=j==null?void 0:j.response)==null?void 0:xe.data)==null?void 0:ue.message),ge=typeof ne=="string"&&ne.trim()?ne:bE;QO("error",ge,"bulk-update-error")},S=(se,Z,A,j)=>{se.length!==0&&(se.forEach(ne=>{const ge=Z.getRowNode(ne);ge&&ge.setData({...ge.data,...A})}),Z.refreshCells({...j.length>0?{columns:j}:{},force:!0}))},b=se=>{const Z=e.gridApi;if(Z){if(i.value){Z.deselectAll();return}se.forEach(A=>{var j;return(j=Z.getRowNode(A))==null?void 0:j.setSelected(!1)})}},y=({ids:se,apply:Z,columns:A,isDelete:j=!1})=>{var Y;let ne=se;se.length==0&&(ne=e.selectRowData.map(re=>re.id)??[]),console.log("Finishing bulk action for ids:",{ids:ne,columns:A,isDelete:j,selectedRows:e.selectRowData,lastOutcome:p});const ge=p;if((ge==null?void 0:ge.status)!==fs.ACCEPTED){Z(),j&&b(ne);return}QO("white",hQ,"bulk-update-queued");const xe=(Y=ge.data)==null?void 0:Y.bulk_process;let ue;typeof(xe==null?void 0:xe.state)=="number"?ue=xe.state:ue=j?0:1;const K=e.gridApi;K&&(ne.forEach(re=>pQ(K,re,{isProcessing:{state:ue,message:typeof(xe==null?void 0:xe.message)=="string"?xe.message:""}})),K.refreshCells({columns:[...A,"name"],force:!0})),(j||ue==0)&&b(ne)},E=async({request:se,apply:Z,columns:A,isDelete:j=!1})=>{var xe,ue,K;const ne=a.value,ge=e.gridApi;if(!ge){console.error("Grid API is not available for bulk action.");return}v();try{const Y=se();if(!Y)throw new Error("Bulk update service is unavailable.");await Y}catch(Y){console.error("Bulk action failed:",Y),w(Y),(xe=t.value)==null||xe.open();return}if((p==null?void 0:p.success)===!1){const Y=p.error??new Error(bE);console.error("Bulk action failed:",Y),w(Y),(ue=t.value)==null||ue.open();return}y({ids:ne,columns:A,isDelete:j,apply:()=>Z(ne,ge)}),(K=t.value)==null||K.hide()},_=({itemIds:se,data:Z,isUpdateAll:A})=>{let j=se;A&&(console.log("Bulk update for all items with data:",Z),j=a.value),console.log("Handling bulk update for status with itemIds:",j,"and data:",Z);const ne=e.gridApi;if(!ne){console.error("Grid API is undefined");return}y({ids:j,columns:["status"],apply:()=>{S(j,ne,{status:Z},["status"])}})},I=({itemIds:se,data:Z})=>{var j;const A=e.gridApi;if(!A){console.error("Grid API is undefined");return}y({ids:se,columns:["dateRange","name"],apply:()=>{let ne=se;console.log("Applying bulk date update for itemIds:",se,"with data:",Z),(!se||se.length===0)&&(console.warn("No itemIds provided for bulk date update."),ne=e.selectRowData.map(ge=>ge.id)),ne.forEach(ge=>{const xe=A.getRowNode(ge);if(xe){const ue=[...xe.data.dateRange||[null,null]];"startDate"in Z&&Z.startDate!==void 0&&(ue[0]=Z.startDate?new Date(Z.startDate):null),"dueDate"in Z&&Z.dueDate!==void 0&&(ue[1]=Z.dueDate?new Date(Z.dueDate):null),xe.setData({...xe.data,dateRange:ue})}})}}),(j=n.onUpdated)==null||j.call(n)},T=se=>{var ne;const Z=e.gridApi,{id:A,value:j}=se;if(!Z){console.error("Grid API is undefined");return}y({ids:a.value,columns:[`metric_${A}`,"name"],apply:()=>{S(a.value,Z,{[`metric_${A}`]:j},[`metric_${A}`])}}),(ne=n.onUpdated)==null||ne.call(n)},F=se=>{const{assignees:Z,type:A}=se,j=e.gridApi;if(!j){console.error("Grid API is not available for bulk update.");return}const ne=new Set(Z.map(xe=>xe.id)),ge=xe=>{const ue=j.getRowNode(xe);if(!ue)return;const K=ue.data.assignees||[];let Y=[];switch(A){case"add":{const re=new Set(K.map(R=>R.id));Y=[...K,...Z.filter(R=>!re.has(R.id))];break}case"overwrite":Y=Z;break;case"remove":Y=K.filter(re=>!ne.has(re.id));break;case"removeAll":Y=[];break}ue.setData({...ue.data,assignees:Y})};y({ids:a.value,columns:["assignees","name"],apply:()=>a.value.forEach(ge)})},L=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.bulkDeleteItems(d.value)},isDelete:!0,columns:["name"],apply:(se,Z)=>S(se,Z,{isDeleted:!0,disabled:!0,isProcessing:{state:0,message:""}},[])}),x=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.bulkUnarchiveItems(d.value)},columns:["name"],apply:(se,Z)=>S(se,Z,{isArchived:!1},["name"])}),P=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.bulkArchiveItems(d.value)},columns:["name"],apply:(se,Z)=>S(se,Z,{isArchived:!0},["name"])}),k=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.deleteThumbnail(d.value)},columns:["thumbnail"],apply:(se,Z)=>S(se,Z,{thumbnail:null},["thumbnail"])}),M=()=>E({request:()=>{var se;return(se=u.value)==null?void 0:se.deleteRendition(d.value)},columns:["name"],apply:(se,Z)=>S(se,Z,{},["name"])}),N=()=>{v(),h.value=!0},B=se=>{console.trace("Bulk update response:",se),ht(()=>{h.value=!1})},z=()=>{w(),B({})},oe=(se,Z)=>{const A=new Map(e.selectRowData.map(ne=>[ne.id,ne.name||""])),j=mQ(se,Z.length);return Z.map((ne,ge)=>{const xe=A.get(ne)??"",ue=gQ(se,{currentName:xe,counterValue:j[ge]??""});return{id:ne,from:xe,to:ue}})},ie=()=>{const se=e.gridApi;return se==null?[]:e.selectRowData.map((Z,A)=>{var j;return{id:Z.id,rowIndex:((j=se.getRowNode(Z.id))==null?void 0:j.rowIndex)??A}}).sort((Z,A)=>Z.rowIndex-A.rowIndex).map(({id:Z})=>Z)};return{apiServices:u,selectionStatus:s,isSelectAll:i,selectedIds:a,isBulkUpdate:l,isUpdating:h,isLoading:f,handleUpdateStart:N,handleUpdatePostUpdate:B,handleUpdateFailed:z,handleUpdateBulkStatus:_,handleUpdateBulkDate:I,handleBulkUpdateMetric:T,handleUpdateNewAssignee:F,handleDelete:L,handleArchive:P,handleUnarchive:x,deleteThumbnail:k,deleteRendition:M,handleBulkUpdateName:async se=>{var xe;if(!e.workspaceId||!e.entityId)return;const Z=ie(),A={item_ids:Z,segments:se},j=r.value;i.value&&(delete A.item_ids,A.entity_id=e.entityId),A.sort_by=j;const ne={workspaceId:e.workspaceId,entityId:e.entityId,payload:A,filter:c!=null&&c.value?c.value:void 0},ge=oe(se,Z);v(),h.value=!0,f.value=!0;try{const ue=(xe=u.value)==null?void 0:xe.bulkRename(ne);if(!ue)throw new Error("Bulk update service is unavailable.");if(await ue,(p==null?void 0:p.success)===!1){w(p.error??new Error(bE));return}}catch(ue){w(ue);return}finally{h.value=!1,f.value=!1}y({ids:Z,columns:["name"],apply:()=>{var K;const ue=e.gridApi;ue&&(ge.forEach(({id:Y,to:re})=>{var R;return(R=ue.getRowNode(Y))==null?void 0:R.setDataValue("name",re)}),(K=n.onRefreshSelectedRow)==null||K.call(n))}})}}},eM=_t(ot({__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=$s,{triggerRef:n,popupRef:o}=vo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=X(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(q(),de("div",{class:le(i.$style["status-badge-wrapper"]),style:hn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[kt(i.$slots,"default"),ze(Se("div",{class:le(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[dr,r.showBadge],[V(t),{isLoading:r.loading,fullwidth:!0}]]),Se("div",{ref_key:"popupRef",ref:o,class:le(i.$style["badge-tooltip"])},at(r.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),fd=Ja("switchStore",()=>{const e=$(null),t=Dn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),yQ=ot({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:Cv()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Kt,o=$s,s=e,r=t,i={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=$(new Date),l=$(!0),u=$(!1),c=$(!1),d=$(null);let h=null,f=null;const p=fd(),{openPeopleInsight:g}=p,v=X(()=>!s.private&&!u.value),w=X(()=>{var B,z;return((B=d.value)==null?void 0:B.display_name)??((z=s.user)==null?void 0:z.name)}),S=X(()=>{var B,z;return!v.value||!d.value?s.status:(B=d.value.private_info)!=null&&B.is_offline?"offline":(z=d.value.private_info)!=null&&z.last_active?"active":"away"}),b=X(()=>{var B;return!!((B=d.value)!=null&&B.private_info)}),y=X(()=>{const B=S.value;return B?i[B]:""}),E=X(()=>{var B,z;return((z=(B=d.value)==null?void 0:B.private_info)==null?void 0:z.timezone)??s.timezone}),_=X(()=>{if(!E.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:E.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",E.value),""}}),I=X(()=>{var B,z,oe;return{id:s.user.id,name:w.value,initial:((B=d.value)==null?void 0:B.initial)??s.user.initial,profile_image:((z=d.value)==null?void 0:z.profile_image)??s.user.profile_image,color:((oe=d.value)==null?void 0:oe.color)??s.user.color,size:72,borderRadius:"8px"}}),T=X(()=>{const B=un.getInstance().getItem("BASE_URL"),z=un.getInstance().getItem("ws.code")||"";return es({type:"people_insight",config:{ws_code:z,baseDomain:B,user_id:s.user.id}}).url}),{copyToClipboard:F,tooltip:L}=IO(T.value,()=>r("copyLink",s.user.id)),x=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const B=await s.apiUpdateFunction(s.user.id);B?(d.value=B,r("dataUpdated",B)):(u.value=!0,c.value=!0,r("dataUpdated",null))}catch(B){u.value=!0,c.value=!0,console.error("Failed to fetch user data:",B)}finally{l.value=!1}},P=()=>{k(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(x,s.refreshInterval))},k=()=>{f!==null&&(clearInterval(f),f=null)},M=B=>{var z;if(B.ctrlKey||B.metaKey){window.open(T.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?(z=s.switchInstance)==null||z.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(T.value,"_blank")}},N=B=>{M(B),r("insightClick",s.user.id)};return Qe([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],P),Xt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await x(),P()):l.value=!1}),nu(()=>{h&&clearInterval(h),k()}),(B,z)=>s.showPrivateUser&&(s.private||c.value)?(q(),de("div",{key:0,class:le([B.$style["info-row"],B.$style["private-badge"]])},[...z[0]||(z[0]=[Se("span",null,"Private User",-1)])],2)):(q(),de("div",{key:1,class:le([B.$style["mini-people-card"],{[B.$style.loading]:l.value},"bg-skeleton"])},[Se("div",{class:le(B.$style["avatar-section"])},[v.value&&b.value?(q(),je(eM,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":y.value},{default:we(()=>[ye(Ef,jt({readOnly:!0},I.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(q(),je(Ef,jt({key:1,readOnly:!0},I.value),null,16))],2),Se("div",{class:le(B.$style["user-info"])},[Se("div",{class:le(B.$style["info-column"])},[ze((q(),de("span",{class:le(B.$style["user-name"])},[tt(at(w.value),1)],2)),[[V(n),{content:w.value,delay:[1e3,0]}]]),E.value&&v.value&&b.value?(q(),de("div",{key:0,class:le([B.$style["info-row"],B.$style["time-row"]])},[ze((q(),de("div",{class:le(B.$style["time-display"])},[ye(gt,{source:"remote",src:"Globe",class:le(B.$style["clock-icon"]),size:"10"},null,8,["class"]),Se("span",{class:le(B.$style["time-text"])},at(_.value)+" ("+at(E.value)+")",3)],2)),[[V(o),{isLoading:l.value,fullwidth:!0}]])],2)):Ye("",!0)],2),!e.readOnly&&v.value?(q(),de("div",{key:0,class:le([B.$style["info-row"],B.$style.actions])},[e.showInsightButton&&b.value?(q(),je(St,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Ht(N,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Ye("",!0),e.showCopyLinkButton&&b.value?ze((q(),je(St,{key:1,variant:["icon","secondary"],size:"small",onClick:Ht(V(F),["prevent","stop"]),disabled:s.disabled},{default:we(()=>[ye(gt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[V(n),{content:V(L),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ye("",!0)],2)):Ye("",!0)],2)],2))}}),wQ=_t(yQ,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),CQ=_t(ot({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e,{expose:t}){const n=Io,o=Kt,s=e,{isEditing:r}=ld(s),i=()=>{var h,f;const c=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=c==null?void 0:c.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};c==null||c.startEditingCell(d)},a=X(()=>{var d,h;const c=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((c==null?void 0:c.rowIndex)??0)+10}),l=()=>{var c,d;(d=(c=s.params)==null?void 0:c.api)==null||d.stopEditing()},u=$();return t({focus(){var c;(c=u.value)==null||c.focus()},blur(){var c;(c=u.value)==null||c.blur()}}),(c,d)=>ze((q(),je(St,{class:le(c.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:V(r),onClick:Ht(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:u},{default:we(()=>[ye(gt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[V(o),"More actions"],[V(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),bQ=["src","width","height","alt"],va=_t(ot({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=$s,{getCachedValue:n,setCachedValue:o}=bf({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=X(()=>({minWidth:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},u=X(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:c,loading:d}=UP(u,"visual",l,a);return(h,f)=>ze((q(),de("div",{class:le([h.$style.visualWrapper,{[h.$style.loading]:V(d)}]),style:hn(i.value)},[Se("img",{src:V(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:hn(i.value)},null,12,bQ)],6)),[[V(t),{isLoading:V(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),SQ=["tabindex"],No=_t(ot({__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:{},focusableIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;Zg();const r=dm(),i=$(null),a=$("default"),l=X(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),u=X(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),c=X(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var y,E;const g=((y=i.value)==null?void 0:y.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=i.value)==null?void 0:E.querySelectorAll(":scope > .wrapper-suffix").length)||0,w="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${b}))`:!g&&v?`calc(100% - (${v} * ${w} + ${b})) repeat(${v}, ${w})`:g&&v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${v} * ${w} + ${b})) repeat(${v}, ${w})`:"100%"},h=$("100%"),f=()=>{h.value=d()};$h(()=>{f()}),Xt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{ht(()=>{var g;(g=i.value)==null||g.focus()})},triggerFocus:()=>{console.log("triggerFocus called"),ht(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>{const w=Sc("focusable");return ze((q(),de("div",{ref_key:"rootEl",ref:i,class:le([V(r)["display-wrapper"],c.value]),tabindex:e.tabIndex,style:hn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":u.value})},[kt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),kt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),kt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,SQ)),[[w,o.focusableIndex]])}}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_rxmoy_1",readOnly:"_readOnly_rxmoy_26",bordered:"_bordered_rxmoy_29",disabled:"_disabled_rxmoy_29",active:"_active_rxmoy_29",focused:"_focused_rxmoy_29",hovered:"_hovered_rxmoy_33",error:"_error_rxmoy_37",clickable:"_clickable_rxmoy_50",suffix:"_suffix_rxmoy_56",prefix:"_prefix_rxmoy_57"}}]]),EQ=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const _Q=Object.prototype.toString,RQ=e=>_Q.call(e)==="[object Object]",_i=()=>{};function TQ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return"cancel"in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}function DQ(e,t={}){let n,o,s=_i,r=_i;const i=xh(!1),a=c=>{clearTimeout(c),s(),s=_i};let l;return Object.assign(c=>{const d=ta(e),h=ta(t.maxWait);return n&&a(n),d<=0||h!==void 0&&h<=0?(o&&(a(o),o=void 0),i.value=!1,Promise.resolve(c())):(i.value=!0,new Promise((f,p)=>{s=t.rejectOnCancel?p:f,r=f,l=c,h&&!o&&(o=setTimeout(()=>{n&&a(n),o=void 0,i.value=!1,f(l())},h)),n=setTimeout(()=>{o&&a(o),o=void 0,i.value=!1,f(c())},d)}))},{cancel:()=>{n&&(a(n),n=void 0),o&&(a(o),o=void 0),i.value=!1,r=_i},flush:()=>{if(i.value){n&&(clearTimeout(n),n=void 0),o&&(clearTimeout(o),o=void 0),i.value=!1;const c=r;s=_i,r=_i,c(l())}},isPending:Vr(i)})}function SE(e){return Array.isArray(e)?e:[e]}function IQ(e,t=200,n={}){return TQ(DQ(t,n),e)}function xQ(e,t,n){return Qe(e,t,{...n,immediate:!0})}const tM=EQ?window:void 0;function zf(e){var t;const n=ta(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function EE(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=X(()=>{const o=SE(ta(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return xQ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>zf(r)))!==null&&o!==void 0?o:[tM].filter(r=>r!=null),SE(ta(n.value?e[1]:e[0])),SE(V(n.value?e[2]:e[1])),ta(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const u=RQ(i)?{...i}:i,c=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function _E(e,t,n={}){const{window:o=tM,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:_i,cancel:_i,trigger:_i}:_i;let l=!0;const u=v=>ta(s).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(S=>S===v.target||v.composedPath().includes(S));{const S=zf(w);return S&&(v.target===S||v.composedPath().includes(S))}});function c(v){const w=ta(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const S=ta(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(y=>y.el===w.target||w.composedPath().includes(y.el))}const h=v=>{const w=zf(e);if(v.target!=null&&!(!(w instanceof Element)&&c(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!u(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[EE(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),EE(o,"pointerdown",v=>{const w=zf(e);l=!u(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),i&&EE(o,"blur",v=>{setTimeout(()=>{const w=zf(e);let S=o.document.activeElement;for(;S!=null&&S.shadowRoot;)S=S.shadowRoot.activeElement;(S==null?void 0:S.tagName)==="IFRAME"&&!(w!=null&&w.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const AQ=["type","value","placeholder","max","min","disabled","readonly","aria-invalid","aria-disabled","inputmode","maxlength"],hl=_t(ot({__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:{},showClear:{type:Boolean,default:!0},maxValue:{default:void 0},minValue:{default:0},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const o=Io,s=Kt,r=e,i=n,a=$(null),l=$(r.modelValue||""),u=$(!1),c=$(!1),d=$(r.modelValue||"");Qe(()=>r.modelValue,A=>{l.value=A||"",d.value=A||""});const h=X(()=>l.value.length>0),f={text:A=>A.slice(0,r.maxLength||255),number:A=>{const j=r.minValue<0;let ne=A.replace(j?/[^\d.-]/g:/[^\d.]/g,"");const ge=ne.split(".");ge.length>2&&(ne=ge[0]+"."+ge.slice(1).join("")),ne=ne.replace(/-/g,(re,R)=>R===0?re:"");const ue=ne.startsWith("-")?"-":"",Y=ne.replace("-","").split(".");return Y[0].length>17&&(Y[0]=Y[0].substring(0,17)),r.maxDecimalChar!==void 0&&Y.length>1&&(Y[1]=Y[1].substring(0,r.maxDecimalChar)),ne=ue+Y.join("."),ne},email:A=>A.replace(/\s/g,"").slice(0,r.maxLength||255),url:A=>A.replace(/\s/g,"").slice(0,r.maxLength||255),tel:A=>A.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},p=A=>{const j=f[r.type];return j?j(A):A},g=IQ(A=>{r.autoEmit&&(i("update:modelValue",A),i("input",A))},r.debounceDelay),v=A=>{const j=A;if(r.disabled||r.readOnly){j.preventDefault();return}const ne=j.target,ge=ne.selectionStart??ne.value.length,xe=ne.value,ue=l.value;let K=p(xe);if(r.type==="number"&&K!==""&&K!=="-"){const Y=Number(K);(r.maxValue!==void 0&&Y>r.maxValue||!Number.isNaN(Y)&&Y<r.minValue)&&(K=ue)}if(ne.value!==K){const Y=Math.max(0,xe.length-K.length);ne.value=K;const re=Math.max(0,Math.min(ge-Y,K.length));ne.setSelectionRange(re,re)}ue!==K&&(l.value=K,i("input",K),r.autoEmit&&g(K))},w=A=>{if(r.disabled||r.readOnly){A.preventDefault();return}c.value=!0;const j=l.value;l.value="",i("update:modelValue",""),i("clear"),j!==""&&i("change",""),A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),ht(()=>{var ne;(ne=a.value)==null||ne.focus(),setTimeout(()=>{c.value=!1},100)})},S=A=>{r.disabled||r.readOnly||(i("focus",A),r.selectOnFocus&&ht(()=>{A.target.select()}))},b=A=>{if(c.value)return;const ne=A.target.value;r.autoEmit||i("update:modelValue",ne),d.value!==ne&&(i("change",ne),d.value=ne),i("blur",ne,A)},y=A=>{const j=A.target.value;i("enter",j,A),i("enterValue",j),r.submitOnEnter&&(A.preventDefault(),r.autoEmit||i("update:modelValue",j),d.value!==j&&(i("change",j),d.value=j))},E=A=>{const j=A.target,ne=j.value;if(i("escape",ne,A),A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&j.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&j.blur()},_=A=>{const ne=A.target.value;i("tab",ne,A),r.autoEmit||(i("update:modelValue",ne),d.value!==ne&&(i("change",ne),d.value=ne))},I=(A,j,ne)=>new RegExp(`^-?\\d{0,${j}}(\\.\\d{0,${ne}})?$`).test(A)?ne>0||!A.includes("."):!1,T=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"]),F=A=>{if(i("keydown",A),A.key===" "&&A.stopPropagation(),r.type==="number"){if(A.key==="e"||A.key==="E"){A.preventDefault();return}if(A.key.length===1&&!A.ctrlKey&&!A.metaKey&&!A.altKey&&!T.has(A.key)){if(!(r.minValue<0?/[\d.-]/:/[\d.]/).test(A.key)){A.preventDefault();return}const ne=A.target,ge=l.value,xe=ne.selectionStart??ge.length,ue=ne.selectionEnd??xe,K=ge.slice(0,xe)+A.key+ge.slice(ue);if(!I(K,17,r.maxDecimalChar??2)){A.preventDefault();return}const Y=Number(K);if(r.maxValue!==void 0&&Y>r.maxValue||K!=="-"&&!Number.isNaN(Y)&&Y<r.minValue){A.preventDefault();return}}}A.key==="Escape"?E(A):A.key==="Enter"?y(A):A.key==="Tab"?_(A):(A.key==="ArrowUp"||A.key==="ArrowDown")&&r.type==="number"&&A.preventDefault()},L=A=>{i("keyup",A)},x=A=>{if(r.disabled||r.readOnly){A.preventDefault();return}i("paste",A)},P=A=>{if(r.disabled||r.readOnly){A.preventDefault();return}i("cut",A)},k=A=>{i("select",A)},M=`input-text-${Math.random().toString(36).slice(2,11)}`,N=X(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Qe(l,A=>{i("onValidation",A),u.value=r.validatorFnc?!!A&&!r.validatorFnc(A):!1});const B=$(null),z=X(()=>({disabled:r.disabled,readOnly:r.readOnly,error:u.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:B,bordered:!0})),{argsMain:oe,isHover:ie,isFocus:te}=xo(z);t({triggerFocus:()=>{ht(()=>{var A;(A=a.value)==null||A.focus()})},focus:()=>{se()},blur:()=>{ht(()=>{var A;(A=a.value)==null||A.blur()})},select:()=>{ht(()=>{var A;(A=a.value)==null||A.select()})},setSelectionRange:(A,j)=>{ht(()=>{var ne;(ne=a.value)==null||ne.setSelectionRange(A,j)})},getValue:()=>l.value,setValue:A=>{l.value=p(A),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const se=()=>{!r.disabled&&!r.readOnly&&ht(()=>{var A;(A=a.value)==null||A.focus()})},Z=X(()=>te.value&&h.value);return(A,j)=>(q(),de("div",{class:le([A.$style["input-wrapper"],"input-editor"]),onClick:se},[ze((q(),je(No,jt(V(oe),{ref_key:"wrapperRef",ref:B,class:[A.$style["input-box"],{[A.$style["is-hovered"]]:V(ie),[A.$style["is-focused"]]:V(te),[A.$style["has-input"]]:h.value,[A.$style["is-editting"]]:Z.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:we(()=>[kt(A.$slots,"prefix")]),suffix:we(()=>[h.value&&!r.disabled&&!r.readOnly&&r.showClear?kt(A.$slots,"clear",{},()=>[ze((q(),je(St,{variant:["icon","tertiary"],"aria-label":"Clear",onMousedown:Ht(w,["prevent","stop"]),size:18,rounded:!0,class:le(["wrapper-suffix",A.$style["clear-button"]])},{default:we(()=>[ye(gt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[V(s),{content:"Clear",contentClass:"extra-padding"}]])],void 0,0):kt(A.$slots,"suffix",{},void 0,void 0,1)]),default:we(()=>[Se("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:r.type,value:l.value,placeholder:e.placeholder,class:le([A.$style["column-config__input"]]),max:r.maxValue,min:r.minValue,id:M,disabled:e.disabled,readonly:e.readOnly,"aria-invalid":u.value||void 0,"aria-disabled":e.disabled||void 0,inputmode:N.value,maxlength:r.maxLength,onInput:v,onFocus:S,onBlur:b,onKeydown:F,onKeyup:L,onPaste:x,onCut:P,onSelect:k},null,42,AQ)]),_:3},16,["class","bordered"])),[[V(o),r.focusIndex]]),u.value?kt(A.$slots,"error",{},void 0,void 0,0):Ye("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_83ot4_1","is-disabled":"_is-disabled_83ot4_16","is-readonly":"_is-readonly_83ot4_16","is-hovered":"_is-hovered_83ot4_16","is-focused":"_is-focused_83ot4_20","column-config__input":"_column-config__input_83ot4_44","clear-button":"_clear-button_83ot4_59"}}]]),PQ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},RE=ot({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null),i=Cr(u=>{s("update:modelValue",u),s("search",u)},Si),a=()=>{s("update:modelValue",""),s("clear"),ht(()=>{var u;(u=r.value)==null||u.focus()})},l=$(o.modelValue);return t({focus:()=>{var u;(u=r.value)==null||u.focus()},setValue(u){l.value=u}}),(u,c)=>(q(),je(hl,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:V(i),onClear:a,onCancel:c[1]||(c[1]=d=>s("cancel")),"auto-emit":!0},{prefix:we(()=>[Se("div",PQ,[ye(gt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),fl=_t(ot({name:"ListItem",directives:{tooltip:Kt,focusable:Io},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=Io,s=e,r=n,i=$(!1),a=$(!1);function l(E){if(!E||typeof E!="object")return!1;const _=E;return typeof _.name=="string"&&typeof _.id=="string"&&typeof _.initial=="string"}const u=X(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!y.prefix),c=X(()=>!!y.suffix||s.danger&&i.value),d=X(()=>{var E;return s.type==="status"&&typeof((E=s.data)==null?void 0:E.color)=="string"?{backgroundColor:s.data.color,border:uS(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=dm(),f=X(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:u.value,[h["has-suffix"]]:c.value,[h.readOnly]:s.readOnly}));X(()=>({content:"Cancel",...b})),X(()=>({content:"Confirm",theme:"warning",...b}));function p(E){return{name:E.name,initial:E.initial,id:E.id,profile_image:E.profile_image??null,color:E.color,size:24}}function g(){i.value=!1}function v(E){E?r("click",E):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function w(E){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(E);r("handleClick",E)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),y=Zg();return Qe(()=>s.show,E=>{E===!1&&(i.value=!1)}),t({select:()=>{w(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(E,_)=>{const I=Sc("tooltip");return ze((q(),je(St,{variant:["menu-item",e.danger?"danger":"menu-item"],class:le([E.$style["list-item"],f.value]),onHandleClick:w,onMouseenter:_[0]||(_[0]=T=>a.value=!0),onMouseleave:_[1]||(_[1]=T=>a.value=!1),onEscape:S,style:hn({width:s.itemWidth})},{default:we(()=>[u.value?(q(),de("div",{key:0,class:le(E.$style["list-item__prefix"])},[kt(E.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(q(),je(gt,{key:0,src:e.icon,source:"remote",class:le(E.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(q(),de("div",{key:1,class:le(E.$style["status-indicator"]),style:hn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(q(),je(Ef,jt({key:2},p(e.data),{class:E.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ye("",!0)])],2)):Ye("",!0),Se("div",{class:le(E.$style["list-item__label"])},[kt(E.$slots,"label",{selected:e.selected},()=>[tt(at(e.label),1)])],2),c.value?(q(),de("div",{key:1,class:le(E.$style["list-item__suffix"])},[kt(E.$slots,"suffix",{item:E.$props,hovered:a.value},()=>[e.danger&&i.value?(q(),de("div",{key:0,class:le(E.$style["confirm-action"])},[ze((q(),je(St,{variant:["tertiary","icon","danger"],size:"small",onClick:Ht(g,["stop","prevent"])},{default:we(()=>[ye(gt,{src:"Xmark",source:"remote"})]),_:1})),[[V(o),`${s.focusIndex}.0`],[I,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),ze((q(),je(St,{variant:["danger","primary","icon"],size:"small",onClick:Ht(v,["stop","prevent"])},{default:we(()=>[ye(gt,{src:"Check",source:"remote"})]),_:1})),[[V(o),`${s.focusIndex}.1`],[I,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)])],2)):Ye("",!0)]),_:3},8,["variant","class","style"])),[[V(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_iekfz_1",disabled:"_disabled_iekfz_17",danger:"_danger_iekfz_24","has-prefix":"_has-prefix_iekfz_27","has-suffix":"_has-suffix_iekfz_27",clickable:"_clickable_iekfz_41",readOnly:"_readOnly_iekfz_44",hover:"_hover_iekfz_48",active:"_active_iekfz_54","list-item__prefix":"_list-item__prefix_iekfz_79","list-item__label":"_list-item__label_iekfz_87","list-item__suffix":"_list-item__suffix_iekfz_101","status-indicator":"_status-indicator_iekfz_108","item-icon":"_item-icon_iekfz_114","arbo-icon-state":"_arbo-icon-state_iekfz_119","item-avatar":"_item-avatar_iekfz_122","confirm-action":"_confirm-action_iekfz_131"}}]]),kQ=["aria-activedescendant"],FQ=["innerHTML"],OQ=10,ya=_t(ot({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Kt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=$(""),l=$(-1),u=$(null),c=$(null),d=$(new Map),h=X(()=>rE(a.value)),f=()=>{const Z=h.value;if(!Z||Z.length<r.minQueryLength)return r.options;if(d.value.has(Z))return d.value.get(Z);const A=r.options.map(j=>({item:j,score:mJ(` ${j.label} `,Z)})).filter(({score:j})=>j>0).sort((j,ne)=>ne.score-j.score).map(({item:j})=>j);return d.value.set(Z,A),A},p=$([]);Qe(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=X(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=Cr(Z=>{a.value=Z,l.value=-1,i("search",Z)},Si),w=async Z=>{te.value=0,await v(Z||""),te.value=1},S=Z=>a.value?vJ(Z,a.value):Z,b=Z=>{const j={[s.ARROW_DOWN]:()=>y(Z),[s.ARROW_UP]:()=>E(Z),[s.ENTER]:()=>T(Z),[s.ESCAPE]:()=>F(Z),[s.TAB]:()=>L(Z)}[Z.key];j&&j()},y=Z=>{Z.preventDefault(),_(1)},E=Z=>{Z.preventDefault(),_(-1)},_=Z=>{const A=p.value.length;if(A===0)return;let j;Z>0?j=(l.value+1)%A:l.value>0?j=l.value-1:j=A-1,l.value=j,I()},I=()=>{ht(()=>{var A;const Z=(A=c.value)==null?void 0:A.querySelectorAll('[role="menuitem"]')[l.value];Z==null||Z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},T=Z=>{if(Z.preventDefault(),l.value>=0&&l.value<p.value.length){const j=p.value[l.value];x(j,Z)}},F=Z=>{Z.preventDefault(),k()},L=Z=>{i("tab",Z)},x=(Z,A)=>{!Z||Z.disabled||(i("select",Z,A),l.value=-1,k())},P=Z=>{Z>=0&&Z<p.value.length&&(l.value=Z)},k=()=>{i("close")},M=()=>{if(!g.value||!c.value)return;const{scrollTop:Z,clientHeight:A,scrollHeight:j}=c.value;j-(Z+A)<=OQ&&i("loadMore")},N=()=>{var Z,A,j;(Z=c.value)==null||Z.addEventListener("scroll",M),(j=(A=oe.value)==null?void 0:A.$el)==null||j.addEventListener("keydown",b)},B=()=>{var Z,A,j;(Z=c.value)==null||Z.removeEventListener("scroll",M),(j=(A=oe.value)==null?void 0:A.$el)==null||j.removeEventListener("keydown",b)};Xt(()=>{N()}),Vn(()=>{B()}),Qe(()=>r.loading,Z=>{!Z&&p.value.length>0&&(l.value=-1)});const z=Z=>Z?Array.isArray(r.selectedId)?r.selectedId.includes(String(Z.id)):r.selectedId==Z.id:!1,oe=$(null);Qe(l,()=>{I()});const ie=()=>{ht(()=>{var Z;(Z=oe.value)==null||Z.focus()})};t({focus:()=>{ht(()=>{var Z;(Z=oe.value)==null||Z.focus()})},reset:()=>{var Z;(Z=oe.value)==null||Z.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:k,clearSearch:()=>{a.value=""},scrollTo:Z=>{c.value&&(c.value.scrollTop=Z)},selectIndex:Z=>{Z>=0&&Z<p.value.length&&(l.value=Z,I())}});const te=$(0);Qe([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const Z=r.options.length>0&&p.value.length>0,A=!Z&&a.value.length>0,j=!Z&&a.value.length===0;r.loading?te.value=0:Z?te.value=1:A?te.value=2:j&&(te.value=3)},{immediate:!0,deep:!0});const se=()=>{i("cancel")};return(Z,A)=>(q(),de("datalist",{ref_key:"searchListRef",ref:u,class:le([Z.$style["search-list"],te.value===3||te.value===2?Z.$style.empty:"",p.value.length>8?Z.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:hn({width:e.itemWidth||e.width})},[ye(RE,{ref_key:"searchBoxRef",ref:oe,modelValue:a.value,"onUpdate:modelValue":A[0]||(A[0]=j=>a.value=j),class:le(Z.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:A[1]||(A[1]=j=>w("")),onCancel:se},null,8,["modelValue","class","disabled"]),Se("div",{ref_key:"popupRef",ref:c,class:le(Z.$style["list-container"])},[kt(Z.$slots,"extra-item",{query:a.value,isEmpty:te.value===3||te.value===2,isLoading:r.loading}),(q(!0),de(Pt,null,xn(p.value,(j,ne)=>ze((q(),de("div",{key:`${j.id}-${ne}`,role:"menuitem"},[kt(Z.$slots,"item",{item:j,index:ne,selectedIndex:l.value,isSelected:z,handleSelect:x,handleItemHover:P,getHighlightedLabel:S,query:a.value,idx:ne,focused:l.value==ne,focus:ie},()=>[j.hide?Ye("",!0):(q(),je(fl,jt({key:0,ref_for:!0},j,{hover:ne===l.value,selected:z(j),type:j.type,id:`item-${ne}`,"aria-selected":ne===l.value,onClick:ge=>x(j,ge),onMouseover:ge=>P(ne),onEscape:k,itemWidth:e.itemWidth||e.width}),{prefix:we(()=>[kt(Z.$slots,"prefix-item",{item:j})]),label:we(()=>[a.value?ze((q(),de("span",{key:0,class:le(Z.$style.match),innerHTML:S(j.label)},null,10,FQ)),[[V(o),{content:j.label,delay:[1e3,0]}]]):ze((q(),de("span",{key:1,class:le(Z.$style["item-label"])},[tt(at(j.label),1)],2)),[[V(o),{content:j.label,delay:[1e3,0]}]])]),suffix:we(({hovered:ge})=>[kt(Z.$slots,"action",{item:j,isHovered:ne===l.value,hovered:ge,selected:l.value==ne})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[dr,te.value===1]])),128)),te.value===0?kt(Z.$slots,"loading-more",{},()=>[(q(),de(Pt,null,xn(8,j=>Se("div",{class:le(Z.$style["loading-more"]),key:j},[Se("div",{class:le(Z.$style["loading-skeleton"])},null,2),Se("div",{class:le(Z.$style["loading-skeleton"])},null,2)],2)),64))],void 0,0):Ye("",!0),te.value===2?(q(),de("div",{key:1,class:le(Z.$style["no-results"])},[kt(Z.$slots,"empty",{query:a.value},()=>[Se("div",{class:le(Z.$style["no-results-content"])},[...A[2]||(A[2]=[Se("div",null,[tt(" No results. "),Se("br"),tt(" Try another search. ")],-1)])],2)])],2)):Ye("",!0),te.value===3?(q(),de("div",{key:2,class:le(Z.$style["no-results"])},[kt(Z.$slots,"empty-list",{},()=>[Se("div",{class:le(Z.$style["no-results-content"])},[...A[3]||(A[3]=[Se("div",null,"No items available.",-1)])],2)])],2)):Ye("",!0),kt(Z.$slots,"footer")],2)],14,kQ))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Iu=ot({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=ej,n=e,o=$(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=$(s());Qe(()=>n,()=>{setTimeout(()=>{ht(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=X(()=>un.getInstance().getItem("user.ws_user_role_id")),a=X(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,u)=>ze((q(),je(Ef,_U(A1(a.value)),null,16)),[[V(t),r.value]])}}),MQ={class:"avatar-wrapper"},NQ={class:"assignee-label"},LQ=_t(ot({__name:"AssigneeItem",props:{user:{},hovered:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Kt,o=e,s=X(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=Zg(),i=X(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const u=c=>{c.forEach(d=>{d.type===Pt&&Array.isArray(d.children)?u(d.children):d.type!==no&&d.type!==Ka&&l++})};return u(r.actions()),l}),a=$(!1);return(l,u)=>(q(),de("div",{class:le(["assignee-selector-item",{hovered:a.value||o.hovered,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:hn({"--actions-count":i.value}),onMouseenter:u[0]||(u[0]=c=>a.value=!0),onMouseleave:u[1]||(u[1]=c=>a.value=!1)},[Se("div",MQ,[ye(Iu,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(q(),de("div",{key:0,class:le(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(q(),je(gt,{key:0,src:"CircleXMark"})):(q(),je(gt,{key:1,src:"CirclePlus"}))],2)):Ye("",!0)]),ze((q(),de("div",NQ,[kt(l.$slots,"name",{},()=>[tt(at(o.user.name),1)],!0)])),[[V(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hovered||o.focused?kt(l.$slots,"actions",{},void 0,!0,0):Ye("",!0)],38))}}),[["__scopeId","data-v-4de522be"]]),VQ={class:"unassign-icon"},TE=_t(ot({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(q(),je(V(St),{variant:"menu-item",onClick:o,actived:e.actived,style:hn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:we(()=>[Se("div",VQ,[kt(s.$slots,"icon",{},()=>[r[0]||(r[0]=Se("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Se("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:we(()=>[kt(s.$slots,"label",{},()=>[tt(at(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),BQ=["innerHTML"],nM=20,oM=_t(ot({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,{id:r}=Ng(s),i=n,a=j=>{var ge,xe;const ne=(xe=(ge=s.params)==null?void 0:ge.api)==null?void 0:xe.getRowNode(String(r.value));ne==null||ne.setDataValue("assignees",nv(j.assignees)),A("updated",j)},l=$(!1),u=$(!1),c=$(null),d=$(1),h=$(!0),f=$(0),p=$(""),g=Dn("bulkUpdate",$(!1)),v=Dn("isSelectAll",$(!1)),w=X(()=>{var j;return g.value&&v.value?[]:(j=s.ids)!=null&&j.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:y,assigneeList:E,mergedOptions:_,selectedUserIds:I}=Iv({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{A("update-failed")}},w),{apiServices:T}=so(!g.value,s),F=Dn("workspaceId"),L=async(j=1,ne="",ge=!1)=>{var ue,K,Y,re,R,G;if(!T.value)throw console.error("API service or item identifiers are undefined",T.value),new Error("API service or item identifiers are undefined");if(ge?u.value=!0:l.value=!0,c.value=null,!((ue=T.value)!=null&&ue.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const xe=(s.ids??(s.id?[s.id]:[])).map(String);try{let J;xe.length==0?J=await((K=T.value)==null?void 0:K.getEntityUserRoles({workspaceId:String(F),page:j,per_page:nM,display_name_like:ne.trim(),entity_ids:String(s.entityId)})):J=await((Y=T.value)==null?void 0:Y.multipleAssignableUser({workspaceId:String(F),itemIds:xe,page:j,perPage:nM,q:ne.trim(),entityId:String(s.entityId)}));const ce=((re=ad(J.data))==null?void 0:re.map(Dv))??[];E.value=ge?Kc(E.value,ce,"id"):ce,f.value=J.meta.total,h.value=(((R=J==null?void 0:J.meta)==null?void 0:R.current_page)||0)<(((G=J==null?void 0:J.meta)==null?void 0:G.last_page)||0),d.value=j}catch(J){console.error("Error fetching assignable users:",J),c.value="Failed to load assignable users"}finally{l.value=!1,u.value=!1}},x=()=>{!u.value&&h.value&&L(d.value+1,p.value,!0)},P=Cr(async j=>{p.value=j,await L(1,j,!1)},Si),k=()=>L(1,p.value,!1);Xt(()=>{var j;(j=N.value)==null||j.focus()}),t({getValue:()=>{var j;return(j=_.value.find(ne=>ne.selected))==null?void 0:j.value},refresh:k,clearInternal:()=>{I.value=[]},focus:()=>{var j;(j=N.value)==null||j.focus()}});const M=()=>{const j=un.getInstance().getItem("BASE_URL"),ne=es({type:"access_setting",config:{baseDomain:j,ws_code:s.workspaceId,entity_id:F}}).url;window.open(ne,"_blank")},N=$(null);Xt(()=>{ht(()=>{var j;(j=N.value)==null||j.focus()})}),Qe([()=>s.id,()=>s.workspaceId],()=>{L()},{deep:!0,immediate:!0});const B=j=>{var ge;const ne=un.getInstance().getItem("ws.code");return((ge=T.value)==null?void 0:ge.getUserInformation(ne,j))||Promise.resolve(null)},z=async(j,ne,ge)=>{ne.preventDefault(),ne.stopPropagation(),ne.stopImmediatePropagation(),A("update-start");try{const xe=await y(j);if(xe)A("update-completed",xe);else throw new Error("Failed to update assignees")}catch(xe){A("update-failed"),console.error("Error updating assignees:",xe)}},oe=async()=>{try{A("update-start");const j=await S();if(j)A("update-completed",j);else throw new Error("Failed to unassign all assignees")}catch(j){A("update-failed"),console.error("Error unassigning all assignees:",j)}finally{}},ie=async j=>{try{A("update-start");const ne=await b(j);if(ne)A("update-completed",ne);else throw new Error("Failed to replace assignees")}catch(ne){A("update-failed"),console.error("Error replacing assignees:",ne)}finally{}},te=()=>{var j,ne;i("cancel"),(ne=(j=s.params)==null?void 0:j.api)==null||ne.stopEditing()};ci("popupAttachRef",N);const se=$(),Z=$(!1),A=(j,ne)=>{switch(j){case"updated":i("updated",ne);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed",ne);break}};return Xt(()=>{ht(()=>{setTimeout(()=>{Z.value=!0},50)})}),(j,ne)=>(q(),de("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:se},[ye(ya,jt({"selected-id":V(I)},{...s},{options:V(_),loading:l.value,ref_key:"popupRef",ref:N,"loading-more":u.value,"has-more":h.value,onSelect:ne[0]||(ne[0]=(ge,xe)=>{z(ge,xe)}),"data-wrapper":"true",onSearch:V(P),onLoadMore:x,onCancel:te,onClose:te}),Hh({"extra-item":we(({isEmpty:ge,isLoading:xe})=>[!ge&&!xe?(q(),je(TE,{key:0,onClick:oe,actived:!1,label:"Unassign"},{icon:we(()=>[ye(gt,{src:"UserXMark",source:"remote"})]),_:1})):Ye("",!0)]),item:we(({item:ge,selectedIndex:xe,isSelected:ue,handleItemHover:K,getHighlightedLabel:Y,query:re,idx:R,focused:G})=>[ye(LQ,{user:ge.data,"multiple-select":!0,"append-to":se.value,isMe:!1,hover:R===xe,selected:ue(ge),focused:G,onClick:Ht(J=>z(ge,J,"click"),["stop","prevent"]),onMouseover:J=>K(R),"api-update-function":B},{name:we(()=>[re?ze((q(),de("span",{key:0,class:le([j.$style["item-label"],j.$style.match]),style:{flex:"1"},innerHTML:Y(ge.label)},null,10,BQ)),[[V(o),{content:ge.label}]]):ze((q(),de("span",{key:1,class:le(j.$style["item-label"]),style:{flex:"1"}},[tt(at(ge.label),1)],2)),[[V(o),{content:ge.label}]])]),actions:we(()=>[ze((q(),je(St,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:Ht(J=>{var ce;return ie((ce=ge.data)==null?void 0:ce.id)},["stop"])},{default:we(()=>[ye(gt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[V(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":we(()=>[Se("div",{class:le(j.$style["empty-state"])},[ne[3]||(ne[3]=tt(" No assignee available. ",-1)),ne[4]||(ne[4]=Se("br",null,null,-1)),ye(St,{onClick:M,variant:["tertiary"],size:"small"},{default:we(()=>[...ne[2]||(ne[2]=[tt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[c.value?{name:"error",fn:we(()=>[Se("div",{class:le(j.$style["error-message"])},[tt(at(c.value)+" ",1),ye(St,{onClick:k,size:"small"},{default:we(()=>[...ne[1]||(ne[1]=[tt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),$Q={key:0,class:"inner"},jf=_t(ot({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=$(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:u,show:c}=vo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=$(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=Fo({isShow:!1,isRender:!1});Xt(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.addEventListener("keydown",h)}),Vn(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,w)=>{f.isShow=v,f.isRender=w};return Qe(()=>a.value,(v,w)=>{v?ht(()=>{a.value&&g(!0,!0)}):f.isShow=!1,p("onVisibleChange",v,w)}),t({hide:()=>{console.log(" "),l(),g(!1,!0)},isVisible:a,open:()=>{c(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,w)=>(q(),de("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[Se("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[kt(v.$slots,"trigger",{isVisible:V(a),hide:V(l),disabled:o.isUpdating||o.disabled,popupRef:V(i),triggerRef:V(r),toggle:V(u)},void 0,!0)],512),Se("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?ze((q(),de("div",$Q,[kt(v.$slots,"popup",{isVisible:V(a),hide:V(l),popupRef:V(i),triggerRef:V(r),toggle:V(u),open:V(c)},void 0,!0)],512)),[[dr,f.isShow]]):Ye("",!0)],512)],512))}}),[["__scopeId","data-v-af84b00b"]]),HQ=ot({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;ci("bulkUpdate",!0);const o=$(!1),s=t,r=$(null),i=()=>{var d;o.value=!0,s("update-start"),(d=l.value)==null||d.hide()},a=(d,h)=>{var f,p;o.value=!1,d?(s("update-completed",h),(f=l.value)==null||f.destroy()):(s("update-failed"),(p=l.value)==null||p.open())},l=$(null),u=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},c=(d,h)=>{ht(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return(d,h)=>(q(),je(jf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:c},{trigger:we(({hide:f,disabled:p})=>[ye(St,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:we(()=>[ye(gt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=tt(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({hide:f})=>[ye(oM,jt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:u,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0,p)),onCancel:f}),null,16,["ids","onCancel"])]),default:we(()=>[h[3]||(h[3]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),Kf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],GQ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),pl=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let u=Kf.indexOf(l);const c=i?-1:1;for(const d of Kf){u=(u+c+Kf.length)%Kf.length;const h=Kf[u],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(GQ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},UQ=["aria-label"],WQ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],zQ={style:{flex:"1"}},jQ=_t(ot({__name:"MainCalendar",props:QD({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},hasWarning:{type:Boolean,default:!0},disabledTooltip:{default:"This date is disabled"},parentConfig:{}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:QD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Kt,s=$(null),r=e,i=X(()=>r.startDate&&r.endDate),a=az(e,"tracingCase"),l=n,u=$(r.year),c=$(r.month),d=X(()=>{var xe,ue,K;const A=Y=>Y==null?void 0:Y.toFormat("yyyy-MM-dd"),j=(xe=r.parentConfig)==null?void 0:xe.parentName,ne=(ue=r.parentConfig)==null?void 0:ue.parentStartDate,ge=(K=r.parentConfig)==null?void 0:K.parentDueDate;return{smaller:`Before the ${j} start date (${A(ne)})`,larger:`After the ${j} due date (${A(ge)})`,none:""}});Qe(()=>[r.year,r.month],([A,j])=>{u.value=A,c.value=j});const h=X(()=>lt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),f=X(()=>lt.now().setZone(r.timezone)),p=X(()=>r.startDate?lt.fromJSDate(r.startDate,{zone:r.timezone}):null),g=X(()=>r.endDate?lt.fromJSDate(r.endDate,{zone:r.timezone}):null),v=$(p.value),w=$(g.value),S=$(p.value),b=$(g.value);Qe([p,g],()=>{r.requireConfirm||(v.value=p.value,w.value=g.value,S.value=p.value,b.value=g.value)},{immediate:!0});const y=X(()=>r.requireConfirm?v.value:p.value),E=X(()=>r.requireConfirm?w.value:g.value);Qe(()=>r.activeField,A=>{const j=A==="start"?y.value:E.value;j&&(u.value=j.year,c.value=j.month)}),Qe(()=>{var A,j;return[(A=y.value)==null?void 0:A.toISODate(),(j=E.value)==null?void 0:j.toISODate(),r.activeField]},()=>{const A=r.activeField==="start"?y.value:E.value;A&&(A.year!==u.value||A.month!==c.value)&&(u.value=A.year,c.value=A.month)});function _(A){return A.setZone("utc")}const I=$("");function T(A){I.value=A.toISODate()||"",ht(()=>{const j=document.querySelector(`.arbo-calendar-day[data-date="${I.value}"]`);j==null||j.focus()})}Qe(()=>{var A,j;return[u.value,c.value,r.activeField,(A=y.value)==null?void 0:A.toISODate(),(j=E.value)==null?void 0:j.toISODate()]},()=>{const A=r.activeField==="start"?y.value:E.value;let j;A&&A.year===u.value&&A.month===c.value?j=A:y.value&&y.value.year===u.value&&y.value.month===c.value?j=y.value:j=f.value,T(j)});function F(A){return A.toFormat("d")}const L=X(()=>{var G,J,ce,Ee,Ce,Ne,pe,H;const A=lt.fromObject({year:u.value,month:c.value,day:1},{zone:r.timezone}),j=A.weekday,ne=r.weekStart===1?(j+6)%7:j%7;let ge=A.minus({days:ne});const xe=[],ue=rd.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),K=dm(),Y=(J=(G=r.parentConfig)==null?void 0:G.parentStartDate)==null?void 0:J.startOf("day").toMillis(),re=(Ee=(ce=r.parentConfig)==null?void 0:ce.parentDueDate)==null?void 0:Ee.endOf("day").toMillis();console.log("calculating classes for cursor:",{cursor:ge.toISODate(),parentStartMs:Y,parentDueMs:re,parentConfig:r.parentConfig});for(let W=0;W<42;W++){const be=[];ge.month!==c.value&&be.push(K["is-outside"]),ge.hasSame(f.value,"day")&&be.push(K["is-today"]),y.value&&ge.hasSame(y.value,"day")&&be.push(K["is-selected-start"]),E.value&&ge.hasSame(E.value,"day")&&be.push(K["is-selected-end"]),y.value&&E.value&&ge>y.value&&ge<E.value&&be.push(K["is-in-range"]);const Ae=F(ge),He=ue[ge.weekday-1]||"";let Te="none";const Xe=ge.startOf("day").toMillis();Y!==void 0&&Xe<Y?Te="smaller":re!==void 0&&Xe>re&&(Te="larger"),console.log("dayMs:",ge.startOf("day").toFormat("yyyy-MM-dd"),"parentStartMs:",(Ne=(Ce=r.parentConfig)==null?void 0:Ce.parentStartDate)==null?void 0:Ne.toFormat("yyyy-MM-dd"),"parentDueMs:",(H=(pe=r.parentConfig)==null?void 0:pe.parentDueDate)==null?void 0:H.toFormat("yyyy-MM-dd"),"resulting warning:",Te),xe.push({dt:ge,iso:ge.toISODate()||"",label:ge.toFormat("d"),displayLabel:Ae,weekdayLabel:He,aria:ge.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),warning:Te,classes:be}),ge=ge.plus({days:1})}const R=[];for(let W=0;W<6;W++)R.push(xe.slice(W*7,W*7+7));return console.log("cells:",R),R}),x=X(()=>{const A=rd.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?A:[A[6],...A.slice(0,6)]});function P(A,j,ne){const ge=A==="start"?j.startOf("day"):j.endOf("day"),xe=_(ge),ue={year:ge.year,month:ge.month,day:ge.day,utc:xe.toISO()||""};A==="start"?(l("select-start",ue,ne??!0),l("select-start-utc",ue.utc)):(l("select-end",ue),l("select-end-utc",ue.utc))}function k(A){let j=u.value,ne=c.value+A;for(;ne<1;)ne+=12,j-=1;for(;ne>12;)ne-=12,j+=1;u.value=j,c.value=ne,l("update:year",j),l("update:month",ne)}function M(A){const ne=(I.value?lt.fromISO(I.value,{zone:r.timezone}):f.value).plus({days:A});ne.month===c.value&&ne.year===u.value&&T(ne)}function N(A=!1){const ne=(I.value?lt.fromISO(I.value,{zone:r.timezone}):f.value).weekday%7,ge=A?6-ne:-ne;M(ge)}const B=A=>{z(A)};function z(A){switch(A.preventDefault(),A.stopPropagation(),A.key){case"ArrowLeft":A.preventDefault(),M(-1);break;case"ArrowRight":A.preventDefault(),M(1);break;case"ArrowUp":A.preventDefault(),M(-7);break;case"ArrowDown":A.preventDefault(),M(7);break;case"Home":A.preventDefault(),N(!1);break;case"End":A.preventDefault(),N(!0);break;case"PageUp":A.preventDefault(),k(A.shiftKey?-12:-1);break;case"PageDown":A.preventDefault(),k(A.shiftKey?12:1);break;case"Enter":case" ":{A.preventDefault();const j=I.value?lt.fromISO(I.value,{zone:r.timezone}):f.value,ne=L.value.flat().find(ge=>ge.iso===j.toISODate());ne&&ie(ne);break}}}const oe=A=>{const j=lt.now().setZone(r.timezone);u.value=j.year,c.value=j.month,l("update:year",j.year),l("update:month",j.month),T(j),l("gotoToday")};function ie(A){var Ee,Ce;const j=!!p.value,ne=!!g.value,ge=r.activeField,xe=((Ee=p.value)==null?void 0:Ee.toISODate())||"null",ue=((Ce=g.value)==null?void 0:Ce.toISODate())||"null",K=A.dt.toISODate()||"",Y=(Ne,pe)=>{a.value={case:Ne,behavior:pe}},re=()=>`Selected start ${K} > existing end ${ue} -> reset both to ${K}`,R=()=>`Selected end ${K} < existing start ${xe} -> reset both to ${K}`,G=()=>{P("start",A.dt,!0),P("end",A.dt),l("update:activeField","end")},J=(Ne=!1)=>{P("start",A.dt,Ne),Ne&&l("update:activeField","end")},ce=(Ne=!1)=>{P("end",A.dt),Ne&&l("close")};if(j&&ne){ge==="start"?g.value&&A.dt>g.value?(G(),Y("INVERT_RANGE_FROM_START",re())):(J(!1),Y("UPDATE_START_IN_RANGE",`Updated start from ${xe} to ${K}; end remains ${ue}`)):p.value&&A.dt<p.value?(G(),Y("INVERT_RANGE_FROM_END",R())):(ce(!1),Y("UPDATE_END_IN_RANGE",`Updated end from ${ue} to ${K}; start remains ${xe}`));return}if(!j&&ne&&ge==="start"&&g.value&&A.dt>g.value){G(),Y("CREATE_RANGE_FROM_LATE_START",re());return}if(j&&!ne&&ge==="end"&&p.value&&A.dt<p.value){G(),Y("CREATE_RANGE_FROM_EARLY_END",R());return}if(!j&&!ne){if(ge==="start"){J(!0),Y("INIT_START",`Picked start ${K}; awaiting end selection`);return}ce(r.immediatelyUpdate),Y("INIT_END",`Picked end ${K}; awaiting start selection`);return}if(!j&&ne){if(ge==="start"){J(!0),Y("FILL_MISSING_START",`Inserted start ${K}; existing end ${ue}`);return}ce(!1),Y("STRICT_UPDATE_END_ONLY",`Updated end to ${K}; start still null`);return}if(j&&!ne){if(ge==="start"){J(!0),Y("RESELECT_START_BEFORE_END",`Replaced start with ${K}; end still null, switching to end`);return}ce(r.immediatelyUpdate),Y("FILL_MISSING_END",`Picked end ${K}; start ${xe}`);return}}function te(){S.value=v.value,b.value=w.value,l("confirm")}function se(){v.value=S.value,w.value=b.value,l("cancel")}function Z(){ht(()=>{var A;(A=s.value)==null||A.focus()})}return Xt(()=>{Z()}),t({focus:Z}),(A,j)=>(q(),de("div",{ref_key:"calendarRef",ref:s,class:le([A.$style["arbo-calendar"],{[A.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":h.value,tabindex:"0"},[Se("div",{class:le([A.$style["arbo-calendar-header"],A.$style["arbo-calendar-week"]]),role:"row"},[(q(!0),de(Pt,null,xn(x.value,ne=>(q(),de("div",{key:ne,class:le(A.$style["arbo-calendar-weekday"]),role:"columnheader"},at(ne),3))),128))],2),Se("div",{class:le(A.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:j[0]||(j[0]=Ht(ne=>V(pl)(ne,B),["prevent","stop"]))},[(q(!0),de(Pt,null,xn(L.value,(ne,ge)=>(q(),de("div",{key:ge,class:le(A.$style["arbo-calendar-week"])},[(q(!0),de(Pt,null,xn(ne,xe=>ze((q(),de("button",{key:xe.iso,class:le([A.$style["arbo-calendar-day"],xe.classes,{[A.$style["is-focused"]]:xe.iso===I.value},{[A.$style["is-warning"]]:xe.warning!=="none"}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":xe.aria,"data-date":xe.iso,"data-weekday":xe.weekdayLabel,tabindex:xe.iso===I.value?0:-1,onClick:ue=>ie(xe)},[tt(at(xe.displayLabel),1)],10,WQ)),[[V(o),{content:r.disabled||r.readOnly?r.disabledTooltip:d.value[xe.warning],bypassOverflowCheck:!0}]])),128))],2))),128))],34),r.hasWarning?(q(),de("div",{key:0,class:le(A.$style["warning-selection"])},[ye(gt,{src:"InfoCircle",size:"16",color:"var(--tessr-snackbar-fg-warning, #F7941D)"}),j[2]||(j[2]=tt(" Outside the parent folder's date range. You can still confirm. ",-1))],2)):Ye("",!0),r.readOnly?Ye("",!0):(q(),de("div",{key:1,class:le(A.$style["arbo-calendar-actions"])},[Se("div",zQ,[ze((q(),je(St,{variant:"secondary",size:"medium",onClick:j[1]||(j[1]=ne=>oe()),onKeydown:V(pl),"data-index":"today-btn"},{prefix:we(()=>[ye(gt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[V(o),"Today"]])]),ye(St,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:V(pl),variant:"secondary",size:"medium",onClick:se,"data-index":"cancel-btn"},{default:we(()=>[tt(at(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ye(St,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:V(pl),onClick:te},{default:we(()=>[tt(at(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,UQ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_wwtcu_1","arbo-calendar-week":"_arbo-calendar-week_wwtcu_2","arbo-calendar-day":"_arbo-calendar-day_wwtcu_3","arbo-calendar":"_arbo-calendar_wwtcu_2","arbo-calendar-nav":"_arbo-calendar-nav_wwtcu_36","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_wwtcu_44","arbo-calendar-nav-label":"_arbo-calendar-nav-label_wwtcu_51","arbo-calendar-weekday":"_arbo-calendar-weekday_wwtcu_56","arbo-calendar-weeks":"_arbo-calendar-weeks_wwtcu_61","is-today":"_is-today_wwtcu_94","is-selected-start":"_is-selected-start_wwtcu_99","is-selected-end":"_is-selected-end_wwtcu_107","is-outside":"_is-outside_wwtcu_127","is-focused":"_is-focused_wwtcu_130","is-in-range":"_is-in-range_wwtcu_135","is-warning":"_is-warning_wwtcu_140","arbo-calendar-actions":"_arbo-calendar-actions_wwtcu_153","warning-selection":"_warning-selection_wwtcu_161","arbo-calendar-btn":"_arbo-calendar-btn_wwtcu_178",cancel:"_cancel_wwtcu_187",confirm:"_confirm_wwtcu_192"}}]]),KQ=["onClick"],qQ=["variant","onClick"],YQ=_t(ot({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=X(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const k=o.locale||"en-US",M=o.monthLabelStyle||"short",N=new Intl.DateTimeFormat(k,{month:M,timeZone:"UTC"});return Array.from({length:12},(z,oe)=>N.format(new Date(Date.UTC(2020,oe,1))))}),r=n,i=$(o.year),a=$(o.month),l=$(o.year);Qe(()=>o.year,k=>{k!==i.value&&(i.value=k,l.value=k)}),Qe(()=>o.month,k=>{k!==a.value&&(a.value=k)});const u=$("days");function c(k){u.value!==k&&(u.value=k,r("mode-change",k))}const d=X(()=>o.minYear),h=X(()=>o.maxYear),f=X(()=>{const k=o.yearSpan;return l.value-l.value%k}),p=X(()=>f.value+o.yearSpan-1);function g(){const k=o.yearSpan,M=f.value-k;M>=d.value&&(l.value=M)}function v(){const k=o.yearSpan,M=f.value+k;M<=h.value&&(l.value=M)}const w=X(()=>f.value-o.yearSpan<d.value),S=X(()=>p.value+o.yearSpan>h.value),b=X(()=>{const k=o.yearSpan;return Math.ceil(k/3)});function y(k){const N=f.value+(k-1)*3;return Array.from({length:3},(B,z)=>N+z).filter(B=>B<=p.value)}function E(){u.value==="months"?c("days"):c("months")}function _(){u.value==="years"?c("days"):c("years")}function I(k){i.value=k,l.value=k,r("update:year",k),r("year-selected",k),c("months")}function T(k){a.value=k,r("update:month",k),r("month-selected",k),c("days")}function F(){if(u.value==="days"){let k=i.value,M=a.value-1;if(M<1&&(M=12,k--),k<d.value)return;i.value=k,a.value=M,r("update:year",k),r("update:month",M)}else if(u.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else u.value==="years"&&g()}function L(){if(u.value==="days"){let k=i.value,M=a.value+1;if(M>12&&(M=1,k++),k>h.value)return;i.value=k,a.value=M,r("update:year",k),r("update:month",M)}else if(u.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else u.value==="years"&&v()}const x=X(()=>u.value==="days"?i.value===d.value&&a.value===1:u.value==="months"?i.value-1<d.value:w.value),P=X(()=>u.value==="days"?i.value===h.value&&a.value===12:u.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(k,M)=>{i.value=k,a.value=M}}),(k,M)=>(q(),de("div",{class:le([k.$style["cal-nav-wrapper"]])},[kt(k.$slots,"selection"),u.value==="days"?(q(),de("div",{key:0,class:le(k.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ye(St,{variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Previous",disabled:x.value,label:"",onClick:F,"data-index":"prev-btn",onKeydownCapture:po(Ht(F,["prevent","stop"]),["enter"]),onKeydown:V(pl)},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),Se("div",{class:le(k.$style["cal-nav-center"])},[ye(St,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:V(pl)},{default:we(()=>[tt(at(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ye(St,{variant:"secondary",onClick:_,"data-index":"year-btn",onKeydown:V(pl)},{default:we(()=>[tt(at(i.value),1)]),_:1},8,["onKeydown"])],2),ye(St,{"data-index":"next-btn",variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:P.value,label:"",onClick:L,onKeydownCapture:po(Ht(L,["prevent","stop"]),["enter"]),onKeydown:V(pl)},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ye("",!0),u.value==="years"?(q(),de("div",{key:1,class:le(k.$style["year-grid"])},[Se("div",{class:le(k.$style["year-grid-header"])},[ye(St,{variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),Se("div",{class:le(k.$style["range-label"])},at(f.value)+" - "+at(p.value),3),ye(St,{variant:"tertiary",class:le([k.$style["cal-nav-btn"],k.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:we(({hovered:N})=>[ye(gt,{src:"AnglesRight",source:"remote",color:N?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),Se("div",{class:le(k.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(q(!0),de(Pt,null,xn(b.value,N=>(q(),de("div",{key:"yr-row-"+N,class:le(k.$style["year-grid-row"])},[(q(!0),de(Pt,null,xn(y(N),B=>(q(),de("a",{key:B,tabindex:"0",class:le([k.$style["year-cell"],{[k.$style.selected]:B===i.value}]),onClick:z=>I(B)},at(B),11,KQ))),128))],2))),128))],2)],2)):u.value==="months"?(q(),de("div",{key:2,class:le(k.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[Se("div",{class:le(k.$style.months)},[(q(!0),de(Pt,null,xn(s.value,(N,B)=>(q(),de("a",{tabindex:"0",key:N,variant:B+1===a.value?"primary":"text",class:le([k.$style["month-cell"],{[k.$style.selected]:B+1===a.value}]),onClick:z=>T(B+1)},at(N),11,qQ))),128))],2)],2)):(q(),de("div",{key:3,class:le(k.$style["days-slot"])},[kt(k.$slots,"default",{year:i.value,month:a.value,mode:u.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_1hrlu_1","cal-nav-bar":"_cal-nav-bar_1hrlu_10","cal-nav-btn":"_cal-nav-btn_1hrlu_18",prev:"_prev_1hrlu_31","year-grid-header":"_year-grid-header_1hrlu_35","cal-nav-center":"_cal-nav-center_1hrlu_44","cal-nav-label":"_cal-nav-label_1hrlu_50","month-grid":"_month-grid_1hrlu_64","year-grid":"_year-grid_1hrlu_35",months:"_months_1hrlu_73","month-cell":"_month-cell_1hrlu_80","year-cell":"_year-cell_1hrlu_81","pg-btn":"_pg-btn_1hrlu_103","year-grid-body":"_year-grid-body_1hrlu_116","year-grid-row":"_year-grid-row_1hrlu_123",selected:"_selected_1hrlu_129","days-slot":"_days-slot_1hrlu_135","range-label":"_range-label_1hrlu_139"}}]]);function XQ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=$(""),i=X(()=>{const g=lt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=X(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const w=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return w<S?-1:w>S?1:0},u=X(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),c=X(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&u.value),d=X(()=>r.value.length===t.length&&c.value);return{inputValue:r,isValid:c,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=lt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>c.value?i.value:null}}const ZQ={key:0,style:{marginLeft:"8px"}},JQ=["disabled","readonly","placeholder"],sM=_t(ot({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=n,i=$(null),a=$(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:h,getDate:f}=XQ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=X(()=>s.active),g=X(()=>({disabled:s.disabled,error:!l.value&&c.value.length>0,readOnly:s.readOnly,isEmpty:c.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:S}=xo(g),b=T=>{var L;const F=(L=T.clipboardData)==null?void 0:L.getData("text/plain");F&&(c.value=F.trim())},y=T=>{if(T.key==="Escape"){r("blur"),T.target.blur(),T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation();return}else T.key==="Tab"&&I(T)},E=()=>{d(),r("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var T;return(T=i.value)==null?void 0:T.focus()}}),Qe(()=>s.modelValue,T=>{T?h(T):d()},{immediate:!0}),Qe([()=>u.value,()=>c.value],()=>{if(c.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&u.value){const T=f();(T||c.value.length===0)&&r("complete",T)}}),Qe(()=>l.value,T=>{T||r("invalid","")});const _=X(()=>!!s.isMultipleDate),I=T=>{T.preventDefault(),T.stopImmediatePropagation(),T.stopPropagation(),r("tab",T)};return(T,F)=>(q(),je(No,jt(V(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:we(()=>[Se("div",{class:le([T.$style["date-input-wrapper"]])},[_.value?(q(),de("span",ZQ," Multiple ")):ze((q(),de("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":F[0]||(F[0]=L=>mn(c)?c.value=L:null),onPaste:Ht(b,["prevent"]),placeholder:s.placeholder,class:le([T.$style["date-input"]]),onKeydown:y},null,42,JQ)),[[hI,V(c)]]),kt(T.$slots,"clear",{handleClear:E},()=>[(V(c).length>0||_.value)&&!s.readOnly&&!s.disabled&&(V(w)||V(S))?ze((q(),je(St,{key:0,variant:["icon","primary"],onClick:Ht(E,["stop"]),size:16,rounded:!0},{default:we(()=>[ye(gt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[V(o),"Clear"]]):(q(),je(gt,{key:1,src:"Calendar",source:"remote",class:le(T.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),rM=(e,t)=>{if(e==null||e==="")return null;let n;return lt.isDateTime(e)?n=e.setZone(t):e instanceof Date?n=lt.fromJSDate(e,{zone:t}):typeof e=="number"?n=lt.fromMillis(e,{zone:t}):n=lt.fromISO(e,{zone:t}),n.isValid?n:null},QQ=ot({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:lE()},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},parent_name:{},parentConfig:{}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=$({case:"",behavior:""}),s=e,r=$(null),i=n,a=async(R,G)=>{i("start-update"),await R(),i("finish-update"),ht(()=>{var J,ce;G(),(ce=(J=s.params)==null?void 0:J.api)==null||ce.stopEditing()})},l=(R,G)=>{R(),ht(()=>{var J,ce;G(),(ce=(J=s.params)==null?void 0:J.api)==null||ce.stopEditing()})},u=()=>{var G;const R=lt.now().setZone(s.timezone);A.value=R.year,j.value=R.month,(G=Z.value)==null||G.setNavigation(R.year,R.month)},c=Fo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:w,beginInteraction:S,clearStart:b,clearDue:y}=bJ(s,i),E=X(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Qe(()=>s.multipleStartDates,R=>{h.value=!!R},{immediate:!0}),Qe(()=>s.multipleDueDates,R=>{f.value=!!R},{immediate:!0});const _=$(null),I=$(null),T=R=>{R.preventDefault(),R.stopImmediatePropagation(),R.stopPropagation(),ie()},F=()=>{var R;(R=I.value)==null||R.focus()},L=R=>{if(!R){c.start=!1,b();return}const G=d.endDate?lt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(G&&x(R,G)>0){const ce={year:R.year,month:R.month,day:R.day};c.start=!1,w(ce,!1),p(ce),ht(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const J={year:R.year,month:R.month,day:R.day};c.start=!1,w(J,!0)},x=(R,G)=>{const J=R.startOf("day"),ce=G.startOf("day");return J<ce?-1:J>ce?1:0},P=R=>{var G;R.preventDefault(),R.stopImmediatePropagation(),R.stopPropagation(),(G=document.querySelector('[data-index="prev-btn"]'))==null||G.focus()},k=R=>{if(!R){c.end=!1,y();return}const G=d.startDate?lt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(G&&x(R,G)<0){const ce={year:R.year,month:R.month,day:R.day};c.end=!1,w(ce),p(ce),ht(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const J={year:R.year,month:R.month,day:R.day};c.end=!1,p(J)},M=()=>{h.value=!1,b()},N=()=>{f.value=!1,y()},B=()=>{te()},z=X(()=>d.isSelectingStart||d.isSelectingEnd);function oe(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,ht(()=>{var R;(R=r.value)==null||R.focus()}))}function ie(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,ht(()=>{var R;(R=_.value)==null||R.focus()}))}function te(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function se(R){R.key==="Escape"?(R.stopPropagation(),te()):R.key=="Tab"&&i("tab",R)}const Z=$(null),A=$(new Date().getFullYear()),j=$(new Date().getMonth()+1);Qe(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(A.value=d.startDate.getFullYear(),j.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(A.value=d.endDate.getFullYear(),j.value=d.endDate.getMonth()+1)},{immediate:!0});const ne=$(null);function ge(){if(Array.isArray(s.value)){const[G,J]=s.value;d.startDate=G||null,d.endDate=J||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const R=d.startDate||d.endDate||new Date;A.value=R.getFullYear(),j.value=R.getMonth()+1}Qe(()=>{var R,G,J,ce,Ee,Ce,Ne,pe;return[((J=(G=(R=s.value)==null?void 0:R[0])==null?void 0:G.getTime)==null?void 0:J.call(G))||((ce=s.value)==null?void 0:ce[0]),((Ne=(Ce=(Ee=s.value)==null?void 0:Ee[1])==null?void 0:Ce.getTime)==null?void 0:Ne.call(Ce))||((pe=s.value)==null?void 0:pe[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{ge()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ge,openStart:oe,openEnd:ie,closePicker:te,clearAll:B,isOpen:z,drpRef:ne,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?oe():ie():oe()}});const ue=$(null);Qe(()=>z.value,R=>{if(s.disabled||s.readOnly)return;const G=ue.value;G&&(R?G.show():G.hide())},{immediate:!0});const K=R=>lt.fromJSDate(R,{zone:s.timezone}),Y=X(()=>{var R,G,J;return{start:rM((R=s.parentConfig)==null?void 0:R.parentStartDate,s.timezone),due:rM((G=s.parentConfig)==null?void 0:G.parentDueDate,s.timezone),name:(J=s.parentConfig)==null?void 0:J.parentName}}),re=X(()=>{const{startDate:R,endDate:G}=d,J=Y.value.start,ce=Y.value.due,Ee=Ne=>!!(Ne&&J&&K(Ne).startOf("day")<J.startOf("day")),Ce=Ne=>!!(Ne&&ce&&K(Ne).startOf("day")>ce.startOf("day"));return Ee(R)||Ee(G)||Ce(R)||Ce(G)});return(R,G)=>(q(),de("div",{class:le(R.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:I,onKeydown:se,tabindex:"1","data-index":"calendar-wrapper"},[ye(YQ,{year:A.value,"onUpdate:year":G[6]||(G[6]=J=>A.value=J),month:j.value,"onUpdate:month":G[7]||(G[7]=J=>j.value=J),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:Z},{selection:we(()=>[Se("div",{class:le(R.$style["calendar-input-section"])},[ye(sM,{ref_key:"starDateRef",ref:r,"model-value":V(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:V(d).isSelectingStart,onClick:oe,onClear:M,onComplete:L,onInvalid:G[0]||(G[0]=J=>c.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:F,onTab:T},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ye(sM,{ref_key:"endDateRef",ref:_,"model-value":V(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:V(d).isSelectingEnd,onClick:ie,onClear:N,disabled:s.disabled,onComplete:k,onInvalid:G[1]||(G[1]=J=>c.end=!0),readOnly:s.readOnly,isMultipleDate:V(f),onTab:P},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:we(({year:J,month:ce})=>[ye(jQ,{disabled:s.disabled,"has-warning":re.value,disableConfirm:c.end||c.start,readOnly:s.readOnly,ref_key:"drpRef",ref:ne,"tracing-case":o.value,"onUpdate:tracingCase":G[2]||(G[2]=Ee=>o.value=Ee),year:J,month:ce,"start-date":V(d).startDate,"end-date":V(d).endDate,"active-field":E.value,timezone:s.timezone,parentConfig:s.parentConfig,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:V(w),onSelectEnd:V(p),onGotoToday:u,onConfirm:G[3]||(G[3]=()=>{a(V(v),te)}),onCancel:G[4]||(G[4]=Ee=>l(V(g),te)),onClose:G[5]||(G[5]=Ee=>a(V(v),te))},null,8,["disabled","has-warning","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","parentConfig","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),Nv=_t(QQ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_5tolc_1","calendar-input-section":"_calendar-input-section_5tolc_11","display-wrapper":"_display-wrapper_5tolc_19","calendar-actions":"_calendar-actions_5tolc_23","clear-all-btn":"_clear-all-btn_5tolc_29"}}]]),Lv=Ja("entity",()=>{const e=$(null);function t(i){e.value=i}const n=X(()=>{var i;return((i=e.value)==null?void 0:i.name)??""}),o=X(()=>{var i;return((i=e.value)==null?void 0:i.start_date)??""}),s=X(()=>{var i;return((i=e.value)==null?void 0:i.due_date)??""}),r=X(()=>{const i=e.value;return{parentName:(i==null?void 0:i.name)??null,parentStartDate:i!=null&&i.start_date?lt.fromJSDate(new Date(i==null?void 0:i.start_date)):null,parentDueDate:i!=null&&i.due_date?lt.fromJSDate(new Date(i==null?void 0:i.due_date)):null}});return{entityData:e,setEntityData:t,entityName:n,entityStartDate:o,entityEndDate:s,parentConfig:r}}),eee=ot({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=Dn("isSelectAll",$(!1)),r=Dn("bulkUpdate",$(!1)),i=X(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=so(!r.value,o),l=Dn("filterParams",null),u=$(null),c=async L=>{var x,P,k,M;try{y.value=!0,n("update-start");let N={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in L&&(N.startDate=L.start?Tv(L.start):null),"end"in L&&(N.dueDate=L.end?Tv(L.end):null),i.value?(N.itemIds=void 0,N.entityId=o.entityId):N.entityId=void 0;const B=await((P=(x=a.value)==null?void 0:x.changeDate)==null?void 0:P.call(x,N));n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:N}),n("update-completed",B),(k=u.value)==null||k.hide()}catch(N){console.error("Failed to update dates:",N),ht(()=>{ht(()=>{var B;n("update-failed"),(B=u.value)==null||B.open()})})}finally{(M=S.value)==null||M.resetCalendarLogic(),y.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{w.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const x=o.rowSelected[0].dateRange;b.value=[(x==null?void 0:x[0])??null,(x==null?void 0:x[1])??null],w.value=!1,v.value=!1},p=()=>{var x,P;if(o.rowSelected.some(k=>k.dateRange&&(k.dateRange[0]!==null||k.dateRange[1]!==null))){const k=g(0),M=g(1);if(v.value=k,w.value=M,k)b.value[0]=null;else{const N=((x=o.rowSelected[0].dateRange)==null?void 0:x[0])??null;b.value[0]=N}if(M)b.value[1]=null;else{const N=((P=o.rowSelected[0].dateRange)==null?void 0:P[1])??null;b.value[1]=N}}else v.value=!1,w.value=!1,b.value=[null,null]},g=L=>{const x=o.rowSelected.map(k=>{var M;return(M=k.dateRange)==null?void 0:M[L]});return x.length===0?!1:new Set(x.map(k=>{var M;return(M=k==null?void 0:k.getTime)==null?void 0:M.call(k)})).size>1},v=$(!1),w=$(!1),S=$(null),b=$([null,null]);Qe([()=>o.ids,()=>o.rowSelected],L=>{d(),ht(()=>{var x;(x=S.value)==null||x.focus()})},{immediate:!0,deep:!0});const y=$(!1),E=()=>{y.value=!0},_=()=>{ht(()=>{setTimeout(()=>{y.value=!1},500)})},I=(L,x)=>{L&&ht(()=>{var P;(P=S.value)==null||P.focus()})},T=Lv(),{parentConfig:F}=go(T);return(L,x)=>(q(),je(jf,{ref_key:"wrapperRef",ref:u,isUpdating:y.value,disabled:o.disabled||y.value,onOnVisibleChange:I},{trigger:we(({hide:P,disabled:k})=>[ye(St,{variant:o.variant,loading:y.value,disabled:k,onEscape:P},{default:we(()=>[ye(gt,{src:"Calendar"}),x[0]||(x[0]=tt(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({isVisible:P,hide:k})=>[P?(q(),je(Nv,{key:0,"parent-config":V(F),immediatelyUpdate:!1,value:b.value,onConfirmed:c,ref_key:"calendarRef",ref:S,onClosed:k,onStartUpdate:E,onFinishUpdate:_,multipleDueDates:w.value,multipleStartDates:v.value},null,8,["parent-config","value","onClosed","multipleDueDates","multipleStartDates"])):Ye("",!0)]),default:we(()=>[x[1]||(x[1]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tee=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"},iM=Ja("metricStore",()=>{const e=$();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return tee(o)}}}),nee=["onKeydown"],oee=["width","height","viewBox"],see=["d"],ree="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",aM=ot({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(o.modelValue??0),i=$(null),a=X(()=>{var x;return((x=o.params)==null?void 0:x.size)??24}),l=X(()=>{var x;return((x=o.params)==null?void 0:x.iconViewBox)??"0 0 24 24"}),u=X(()=>{var x;return((x=o.params)==null?void 0:x.iconPath)??ree}),c=X(()=>{var x;return((x=o.params)==null?void 0:x.wrapperTag)??"span"}),d=X(()=>{var x;return o.disabled||((x=o.params)==null?void 0:x.disabled)||!1}),h=X(()=>{var x;return o.readOnly||((x=o.params)==null?void 0:x.readOnly)||!1}),f=X(()=>!d.value&&!h.value),p=X(()=>d.value?"not-allowed":h.value?"default":"pointer");Qe(()=>o.modelValue,x=>{typeof x=="number"&&x!==r.value&&(r.value=x)});const g=x=>{var P;return((P=o.params)==null?void 0:P.maxRating)-x+1<=r.value&&!v.value},v=$(!1),w=()=>{v.value=!0},S=()=>{v.value=!1},b=x=>{f.value&&y(x)},y=x=>{var k,M;if(!f.value)return;let P=((k=o.params)==null?void 0:k.maxRating)-x+1;P===r.value&&(P=0),r.value=P,s("update:modelValue",P),s("update",P),s("change",P),(M=o.params)!=null&&M.onUpdate&&o.params.onUpdate(P)},E=x=>{var P;x!==r.value&&(r.value=x,s("update:modelValue",x),s("update",x),s("change",x),(P=o.params)!=null&&P.onUpdate&&o.params.onUpdate(x),_.value=x)},_=$(r.value),I=x=>{x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation(),r.value=_.value,s("cancel")},T=x=>{x.preventDefault(),E(r.value),s("handleEnter",r.value)},F=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),E(r.value))},L=()=>{f.value&&(r.value=Math.max(r.value-1,0),E(r.value))};return t({focus:()=>{var x;(x=i.value)==null||x.focus()}}),(x,P)=>(q(),de("div",{class:le(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:hn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[po(Ht(L,["prevent"]),["left"]),po(Ht(F,["prevent"]),["right"]),po(Ht(L,["prevent"]),["down"]),po(Ht(F,["prevent"]),["up"]),po(Ht(T,["prevent"]),["enter"]),po(Ht(T,["prevent"]),["tab"]),po(Ht(I,["prevent"]),["escape"])]},[(q(!0),de(Pt,null,xn(e.params.maxRating,k=>(q(),je(OC(c.value),{key:k,class:le(["rating-item",{filled:g(k),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:hn({cursor:p.value,order:e.params.maxRating-k,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(k),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-k+1,tabindex:-1,onClick:Ht(M=>b(k),["prevent","stop"]),onMouseenter:w,onMouseleave:S},{default:we(()=>[kt(x.$slots,"icon",{index:k,filled:g(k),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:k},()=>[(q(),de("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[Se("path",{d:u.value},null,8,see)],8,oee))]),kt(x.$slots,"overlay",{index:k,filled:g(k),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,nee))}}),iee={style:{maxWidth:"180px",lineHeight:"15px"}},aee=["innerHTML"],lM=ot({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var w;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(y=>({label:y.name,value:y.name,id:y.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((w=v.restricted_value)==null?void 0:w.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},u=X(()=>l(s.config)),c=$(s.modelValue),d=v=>{c.value=v,r("update:modelValue",v),r("change",v||null)},h=$(u.value),f=$(!1),p=v=>{f.value=!0,v?h.value=u.value.filter(w=>w.label.toLowerCase().includes(v.toLowerCase())):h.value=u.value,setTimeout(()=>{f.value=!1},300)},g=$(null);return Xt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,w)=>(q(),je(ya,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:w[0]||(w[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:we(({item:S,getHighlightedLabel:b,selectedIndex:y,index:E})=>[ye(fl,{hover:y==E,selected:S.value===e.modelValue,label:S.label,onSelect:_=>d(S.value||null),onClick:_=>d(S.value||null)},{label:we(()=>[Se("div",iee,[ze(Se("span",{innerHTML:b(S.label)},null,8,aee),[[V(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":we(()=>[...w[1]||(w[1]=[tt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),lee={class:"metric-input-wrapper"},uee={key:0,class:"error-text input-2"},uM=ot({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=$(s.modelValue),i=$(s.modelValue),a=$(!1),l=$(!0),u=$(""),c=X(()=>{var N;const M=Number.parseInt(String((N=s.config)==null?void 0:N.format_value)||"2",10);return Number.isFinite(M)&&M>=0?M:2}),d=M=>{if(!M)return M;const N=String(M).split(".");return N.length>1&&N[1].length>c.value?c.value===0?N[0]:`${N[0]}.${N[1].slice(0,c.value)}`:String(M)},h=M=>{const N=d(M);N!==M&&b.value?r.value=N:r.value=M},f=M=>{const N=M.target;if(!N)return;const B=N.value||"",z=B.indexOf(".");if(M.key==="."&&c.value===0){M.preventDefault();return}z!==-1&&/[0-9]/.test(M.key)&&B.slice(z+1).length>=c.value&&M.preventDefault()},p=X(()=>l.value||s.showInlineError?{content:""}:{content:u.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var se;const M=s.config.restricted_type.trim(),N=((se=s.config.restricted_value)==null?void 0:se.split(",").map(Number))||[],[B,z]=N,ie={range:`Enter a value between ${B} and ${z}`,not:`These values are not allowed: ${N.join(", ")}`,exact:"Value is not allowed"}[M];return l.value?"":ie},v=X(()=>{var N;let M="";return Number((N=s.config)==null?void 0:N.format_value)&&(M+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${M}`});Qe(()=>s.modelValue,M=>{r.value=M,i.value=M});const w=M=>bv(s.config,M),S=n,b=$(null),y=M=>{const N=M===""?null:M,B=i.value===""?null:i.value;return N!==B},E=M=>{const N=d(M);if(!y(N))return!1;const B=N===""?null:N;return r.value=B,i.value=B,S("update:modelValue",B),S("handleChange",B),!0},_=()=>{r.value=i.value,S("update:modelValue",i.value)},I=(M,N)=>{E(M),S("enter")},T=(M,N)=>{if(a.value){a.value=!1;return}s.saveOnBlur?E(M):_()},F=M=>{if(M===null||M===""){l.value=!0;return}l.value=bv(s.config,Number(M)),u.value=l.value?"":g()},L=(M,N)=>{a.value=!0,s.saveOnEscape?E(M):_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},x=M=>{F(M),S("onValidation",M)},P=()=>{a.value=!0,_(),S("cancel"),setTimeout(()=>{a.value=!1},100)},k=()=>{var M;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(M=b.value)==null||M.focus()};return t({focus:()=>{var M;return(M=b.value)==null?void 0:M.focus()},blur:()=>{var M;return(M=b.value)==null?void 0:M.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>E(r.value),revert:_}),Xt(()=>{var M;(M=b.value)==null||M.focus()}),(M,N)=>ze((q(),de("div",lee,[ye(hl,{maxDecimalChar:c.value,modelValue:r.value,"onUpdate:modelValue":N[0]||(N[0]=B=>r.value=B),placeholder:v.value,validatorFnc:w,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:I,onBlur:T,onClear:k,onEscape:L,onCancel:P,onOnValidation:x,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(q(),de("span",uee,at(u.value),1)):Ye("",!0)])),[[V(o),p.value]])}}),cee={key:2},dee={class:"wrapper-suffix"},hee={key:3},fee=_t(ot({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=$(null),i=$(0),a=$(null),l=$(null),u=X(()=>TO(s.config)),c=$(!1),d=X(()=>!!ne.value),h=n,f=()=>{c.value=!1,j(),h("cancel")},p=$(!0),g=ue=>{if(ue===null||ue===""){p.value=!0;return}if(u.value!=="number"){p.value=!0;return}p.value=bv(s.config,Number(ue)),w.value=S()},v=()=>{c.value=!0,z()},w=$(""),S=()=>{var ce;const ue=s.config.restricted_type.trim(),K=((ce=s.config.restricted_value)==null?void 0:ce.split(",").map(Number))||[],[Y,re]=K,G={range:`Enter a value between ${Y} and ${re}`,not:`These values are not allowed: ${K.join(", ")}`,exact:"Value is not allowed"}[ue];return p.value?"":G},b=X(()=>{var K;const ue=Number.parseInt(String((K=s.config)==null?void 0:K.format_value)||"2",10);return Number.isFinite(ue)&&ue>=0?ue:2}),y=ue=>{c.value=!0,r.value=ue},E=()=>{c.value=!0,j(),z()},_=ue=>{i.value=ue,c.value=!0,z()},I=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(K=>K.charAt(0).toUpperCase()+K.slice(1)).join("").replace(/Outline|Solid/g,""),T=$(null),F=$(!0),L=X(()=>{var ue;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((ue=r.value)==null?void 0:ue.length)===0,wrapperRef:Z,active:d,focus:s.focus,bordered:!0}}),x=$(null),P=X(()=>F.value),k=X(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:x,active:P,focus:F.value,bordered:!0})),{argsMain:M}=xo(k),{argsMain:N}=xo(L),B=$(null),z=()=>{ht(()=>{var ue;(ue=B.value)==null||ue.focus()})},oe=ue=>{var K;if(ue.format_type==="dropdown"&&ue.format_value)try{const Y=JSON.parse(ue.format_value);if(Array.isArray(Y))return Y.map(re=>({label:re.name,value:re.name,id:re.name}))}catch(Y){console.error("Failed to parse dropdown options",Y)}return ue.format_type=="number"&&ue.restricted_type=="exact"?((K=ue.restricted_value)==null?void 0:K.split(",").map(re=>({label:ue.mapping[`!${re}`]||re,value:re,id:re})))||[]:[]},ie=X(()=>oe(s.config)),te=X(()=>{var ue;return((ue=ie.value.find(K=>K.value===r.value))==null?void 0:ue.label)||r.value||"-"}),se=()=>{var ue;if(u.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(u.value=="number"){const K=(ue=l.value)==null?void 0:ue.getValue();h("updateMetric",K||null)}else h("updateMetric",r.value||null);c.value=!1,j()},{triggerRef:Z,popupRef:A,hide:j,isVisible:ne,show:ge}=vo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),xe=()=>{switch(u.value){case"number":ht(()=>{var ue;(ue=l.value)==null||ue.focus()});break;case"dropdown":ge(),ht(()=>{var ue;(ue=T.value)==null||ue.focus()});break;case"rating":F.value=!0,ht(()=>{var ue;(ue=a.value)==null||ue.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,c.value=!1},focus:xe,hasChanges:()=>c.value}),Xt(()=>{ht(()=>{setTimeout(()=>{xe()},300)})}),(ue,K)=>(q(),de("div",{class:le(ue.$style["metric-editor"])},[u.value=="number"?(q(),je(uM,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>r.value=Y),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:y,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):u.value=="rating"?(q(),je(No,jt({key:1,"tab-index":1},V(M),{ref_key:"triggerRef2",ref:x,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:we(()=>[ye(aM,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":K[1]||(K[1]=Y=>i.value=Y),onHandleEnter:_,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:we(()=>[ye(gt,{source:"rating",src:I()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):u.value=="dropdown"?(q(),de("div",cee,[ye(No,jt(V(N),{ref_key:"triggerRef",ref:Z,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:we(({})=>[Se("div",dee,[ye(gt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:we(()=>[ze((q(),de("span",null,[tt(at(te.value||""),1)])),[[V(o),{content:te.value}]])]),_:1},16),Se("div",{ref_key:"popupRef",ref:A},[V(ne)?(q(),je(lM,{key:0,ref_key:"metricEditorDropdownRef",ref:T,config:s.config,modelValue:r.value,"onUpdate:modelValue":K[2]||(K[2]=Y=>r.value=Y),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ye("",!0)],512)])):(q(),de("span",hee,"Formular")),ze((q(),je(St,{ref_key:"confirmButtonRef",ref:B,onHandleClick:se,"tab-index":"1",onKeypress:[po(Ht(xe,["shift","prevent"]),["tab"]),po(Ht(f,["prevent"]),["escape"])],disabled:!p.value},{default:we(()=>[ye(gt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[V(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),pee=_t(ot({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=n,i=$(!1),a=$(null),l=$(null),u=()=>{i.value=!i.value},c=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await ht(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const w={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&c()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];w&&w()};return Qe(i,g=>{g&&r("open")}),t({hide:c,show:d}),(g,v)=>(q(),de("div",{class:le([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[Se("div",{class:le(g.$style["metric-label"]),onClick:Ht(u,["stop"])},[kt(g.$slots,"default",{open:i.value},()=>[ze((q(),de("span",{class:le(g.$style["metric-name"])},[tt(at(e.label),1)],2)),[[V(o),{content:e.label}]]),e.morpheme&&i.value?(q(),de("small",{key:0,class:le(g.$style["metric-morpheme"])}," ("+at(e.morpheme)+") ",3)):Ye("",!0)])],2),ye(Xz,{mode:"out-in",name:"slide"},{default:we(()=>[i.value?(q(),je(fee,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Ye("",!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"}}]]);function cM(e,t){return function(){return e.apply(t,arguments)}}const{toString:gee}=Object.prototype,{getPrototypeOf:wa}=Object,{iterator:qf,toStringTag:dM}=Symbol,Ca=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),hM=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),Vv=(e,t,n)=>e===Object.prototype||!n&&t===null,mee=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(n=>{if(hM(n))return!1;const o=Object.getOwnPropertyDescriptor(e,n);return!!o&&o.configurable&&o.writable===!0})},DE=(e,t)=>{let n=e;const o=[];for(;n!=null;){if(o.indexOf(n)!==-1)return!1;o.push(n);const s=wa(n);if(Vv(n,s,n===e))return!1;if(Ca(n,t))return!0;n=s}return!1},vee=(e,t)=>e!=null&&DE(e,t)?e[t]:void 0,yee=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=wa(e);if(t===null&&mee(e))return e;const n=Object.create(null),o=Object.create(null),s=[];let r=e;for(;r!=null&&s.indexOf(r)===-1;){s.push(r);const i=r===e?t:wa(r);if(Vv(r,i,r===e))break;const a=Object.getOwnPropertyNames(r);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(r));for(const l of a)hM(l)||Ca(o,l)||(n[l]=e[l],o[l]=!0);r=i}return n},IE=(e=>t=>{const n=gee.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),_r=e=>(e=e.toLowerCase(),t=>IE(t)===e),Bv=e=>t=>typeof t===e,{isArray:xu}=Array,Au=Bv("undefined");function pd(e){return e!==null&&!Au(e)&&e.constructor!==null&&!Au(e.constructor)&&Ts(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fM=_r("ArrayBuffer");function wee(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fM(e.buffer),t}const Cee=Bv("string"),Ts=Bv("function"),bee=Bv("number"),gd=e=>e!==null&&typeof e=="object",See=e=>e===!0||e===!1,$v=e=>{if(!gd(e))return!1;const t=wa(e);return(t===null||t===Object.prototype||wa(t)===null)&&(Vv(e,t,!0)||!Ca(e,dM)&&!Ca(e,qf))},Eee=e=>{if(!gd(e)||pd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},_ee=_r("Date"),Ree=_r("File"),Tee=e=>!!(e&&typeof e.uri<"u"),Dee=e=>e&&typeof e.getParts<"u",Iee=_r("Blob"),xee=_r("FileList"),Aee=_r("Set"),Pee=e=>gd(e)&&Ts(e.pipe);function kee(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const pM=kee(),gM=typeof pM.FormData<"u"?pM.FormData:void 0,Fee=e=>{if(!e)return!1;if(gM&&e instanceof gM)return!0;const t=wa(e);if(!t||t===Object.prototype||!Ts(e.append))return!1;const n=IE(e);return n==="formdata"||n==="object"&&Ts(e.toString)&&e.toString()==="[object FormData]"},Oee=_r("URLSearchParams"),[Mee,Nee,Lee,Vee]=["ReadableStream","Request","Response","Headers"].map(_r),Bee=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),xu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(pd(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function $ee(e,t){if(pd(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const Pu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mM=e=>!Au(e)&&e!==Pu;function xE(...e){const{caseless:t,skipUndefined:n}=mM(this)&&this||{},o={},s=t?Object.create(null):null,r=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;let l=a;if(s&&typeof a=="string"){const c=a.toLowerCase(),d=s[c];d!==void 0&&Ca(o,d)?l=d:s[c]=a}const u=Ca(o,l)?o[l]:void 0;$v(u)&&$v(i)?o[l]=xE(u,i):$v(i)?o[l]=xE({},i):xu(i)?o[l]=i.slice():(!n||!Au(i))&&(o[l]=i)};for(let i=0,a=e.length;i<a;i++){const l=e[i];if(!l||pd(l)||(Yf(l,r),typeof l!="object"||xu(l)||!Object.getOwnPropertySymbols))continue;const u=Object.getOwnPropertySymbols(l);for(let c=0;c<u.length;c++){const d=u[c];Jee.call(l,d)&&r(l[d],d)}}return o}const Hee=(e,t,n,{allOwnKeys:o}={})=>(Yf(t,(s,r)=>{n&&Ts(s)?Object.defineProperty(e,r,{__proto__:null,value:cM(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),Gee=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uee=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Wee=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&wa(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zee=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},jee=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,o=new Set;let s=e;for(;s!=null&&n.size<t;){if(o.has(s))return null;o.add(s);const i=wa(s);if(Vv(s,i,s===e))break;Object.getOwnPropertyNames(s).forEach(a=>{const l=+a;Number.isInteger(l)&&l>=0&&l<t&&String(l)===a&&Ca(s,a)&&n.add(l)}),s=i}if(n.size!==t)return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Kee=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&wa(Uint8Array)),qee=(e,t)=>{const o=(e&&e[qf]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},Yee=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},Xee=_r("HTMLFormElement"),Zee=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),{propertyIsEnumerable:Jee}=Object.prototype,Qee=_r("RegExp"),vM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Yf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},ete=e=>{vM(e,(t,n)=>{if(Ts(e)&&["arguments","caller","callee"].includes(n))return!1;const o=e[n];if(Ts(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},tte=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return xu(e)?o(e):o(String(e).split(t)),n},nte=()=>{},ote=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ste(e){return!!(e&&Ts(e.append)&&e[dM]==="FormData"&&e[qf])}const rte=e=>{const t=new WeakSet,n=o=>{if(gd(o)){if(t.has(o))return;if(pd(o))return o;if(!("toJSON"in o)){t.add(o);let s;if(Aee(o)){s=[];for(const r of o){const i=n(r);!Au(i)&&s.push(i)}}else s=xu(o)?[]:{},Yf(o,(r,i)=>{const a=n(r);!Au(a)&&(s[i]=a)});return t.delete(o),s}}return o};return n(e)},ite=_r("AsyncFunction"),ate=e=>e&&(gd(e)||Ts(e))&&Ts(e.then)&&Ts(e.catch),yM=((e,t)=>e?setImmediate:t?((n,o)=>(Pu.addEventListener("message",({source:s,data:r})=>{s===Pu&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),Pu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ts(Pu.postMessage)),lte=typeof queueMicrotask<"u"?queueMicrotask.bind(Pu):typeof ee<"u"&&ee.nextTick||yM,wM=e=>e!=null&&Ts(e[qf]),he={isArray:xu,isArrayBuffer:fM,isBuffer:pd,isFormData:Fee,isArrayBufferView:wee,isString:Cee,isNumber:bee,isBoolean:See,isObject:gd,isPlainObject:$v,isEmptyObject:Eee,isReadableStream:Mee,isRequest:Nee,isResponse:Lee,isHeaders:Vee,isUndefined:Au,isDate:_ee,isFile:Ree,isReactNativeBlob:Tee,isReactNative:Dee,isBlob:Iee,isRegExp:Qee,isFunction:Ts,isStream:Pee,isURLSearchParams:Oee,isTypedArray:Kee,isFileList:xee,forEach:Yf,merge:xE,extend:Hee,trim:Bee,stripBOM:Gee,inherits:Uee,toFlatObject:Wee,kindOf:IE,kindOfTest:_r,endsWith:zee,toArray:jee,forEachEntry:qee,matchAll:Yee,isHTMLForm:Xee,hasOwnProperty:Ca,hasOwnProp:Ca,hasOwnInPrototypeChain:DE,getSafeProp:vee,toSafeFlatObject:yee,reduceDescriptors:vM,freezeMethods:ete,toObjectSet:tte,toCamelCase:Zee,noop:nte,toFiniteNumber:ote,findKey:$ee,global:Pu,isContextDefined:mM,isSpecCompliantForm:ste,toJSONObject:rte,isAsyncFn:ite,isThenable:ate,setImmediate:yM,asap:lte,isIterable:wM,isSafeIterable:e=>e!=null&&DE(e,qf)&&wM(e)},ute=he.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"]),cte=e=>{const t=Object.create(null);let n,o,s;return e&&e.split(`
148
148
  `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),o=i.substring(s+1).trim();const a=he.hasOwnProp(t,n);!n||a&&he.hasOwnProp(ute,n)||(n==="set-cookie"?a?t[n].push(o):t[n]=[o]:t[n]=a?t[n]+", "+o:o)}),t};function dte(e){let t=0,n=e.length;for(;t<n;){const o=e.charCodeAt(t);if(o!==9&&o!==32)break;t+=1}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==9&&o!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const hte=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),fte=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function AE(e,t){return he.isArray(e)?e.map(n=>AE(n,t)):dte(String(e).replace(t,""))}const pte=e=>AE(e,hte),gte=e=>AE(e,fte);function CM(e){const t=Object.create(null);return he.forEach(e.toJSON(),(n,o)=>{t[o]=gte(n)}),t}const bM=Symbol("internals");function Xf(e){return e&&String(e).trim().toLowerCase()}function Hv(e){return e===!1||e==null?e:he.isArray(e)?e.map(Hv):pte(String(e))}function mte(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const vte=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function PE(e){let t=0,n=e.length;for(;t<n;){const o=e.charCodeAt(t);if(o!==9&&o!==32)break;t+=1}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==9&&o!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function yte(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let o=1;o<t;o++){const s=e.charCodeAt(o);if(s===34||s===92&&(o+=1,o>=t))return e;n+=e[o]}return n}function wte(e){const t=Object.create(null),n=String(e);let o=0,s=!1,r=!1;function i(a){const l=PE(n.slice(o,a)),u=l.indexOf("=");if(u<1)return;const c=PE(l.slice(0,u));if(!vte.test(c))return;const d=c.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=PE(l.slice(u+1));t[d]=yte(h)}for(let a=0;a<n.length;a++){const l=n.charCodeAt(a);s?r?r=!1:l===92?r=!0:l===34&&(s=!1):l===34?s=!0:(l===44||l===59)&&(i(a),o=a+1)}return i(n.length),t}const Cte=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),bte="__Proto__",SM=e=>e==="__proto__"?bte:e;function kE(e,t,n,o,s){if(he.isFunction(o))return o.call(e,t,n);if(s&&(t=n),!!he.isString(t)){if(he.isString(o))return t.indexOf(o)!==-1;if(he.isRegExp(o))return o.test(t)}}function Ste(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function Ete(e,t){const n=he.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{__proto__:null,value:function(s,r,i){return this[o].call(this,t,s,r,i)},configurable:!0})})}let Ao=class{constructor(t){t&&this.set(t)}set(t,n,o){const s=this;function r(a,l,u){const c=Xf(l);if(!c)return;const d=he.findKey(s,c);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[SM(d||l)]=Hv(a))}const i=(a,l)=>he.forEach(a,(u,c)=>r(u,c,l));if(he.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(he.isString(t)&&(t=t.trim())&&!Cte(t))i(cte(t),n);else if(he.isObject(t)&&he.isSafeIterable(t)){let a=Object.create(null),l,u;for(const c of t){if(!he.isArray(c))throw new TypeError("Object iterator must return a key-value pair");u=c[0],he.hasOwnProp(a,u)?(l=a[u],a[u]=he.isArray(l)?[...l,c[1]]:[l,c[1]]):a[u]=c[1]}i(a,n)}else t!=null&&r(n,t,o);return this}get(t,n){if(t=Xf(t),t){const o=he.findKey(this,t);if(o){const s=this[o];if(!n)return s;if(n===!0)return mte(s);if(he.isFunction(n))return n.call(this,s,o);if(he.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Xf(t),t){const o=he.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||kE(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let s=!1;function r(i){if(i=Xf(i),i){const a=he.findKey(o,i);a&&(!n||kE(o,o[a],a,n))&&(delete o[a],s=!0)}}return he.isArray(t)?t.forEach(r):r(t),s}clear(t){const n=Object.keys(this);let o=n.length,s=!1;for(;o--;){const r=n[o];(!t||kE(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const n=this,o=Object.create(null);return he.forEach(this,(s,r)=>{const i=he.findKey(o,r);if(i){n[i]=Hv(s),delete n[r];return}const a=SM(t?Ste(r):String(r).trim());a!==r&&delete n[r],n[a]=Hv(s),o[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return he.forEach(this,(o,s)=>{o!=null&&o!==!1&&(n[s]=t&&he.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
149
149
  `)}getSetCookie(){const t=this.get("set-cookie");return he.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return wte(t)}static concat(t,...n){const o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[bM]=this[bM]={accessors:{}}).accessors,s=this.prototype;function r(i){const a=Xf(i);o[a]||(Ete(s,i),o[a]=!0)}return he.isArray(t)?t.forEach(r):r(t),this}};Ao.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),he.reduceDescriptors(Ao.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),he.freezeMethods(Ao);const Gv="[REDACTED ****]";function _te(e){if(he.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(he.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Rte(e,t){const n=new Set(t.map(r=>String(r).toLowerCase())),o=[],s=r=>{if(r===null||typeof r!="object"||he.isBuffer(r))return r;if(o.indexOf(r)!==-1)return;r instanceof Ao&&(r=r.toJSON()),o.push(r);let i;if(he.isArray(r))i=[],r.forEach((a,l)=>{const u=s(a);he.isUndefined(u)||(i[l]=u)});else{if(!he.isPlainObject(r)&&_te(r))return o.pop(),r;i=Object.create(null);for(const[a,l]of Object.entries(r)){const u=n.has(a.toLowerCase())?Gv:s(l);he.isUndefined(u)||(i[a]=u)}}return o.pop(),i};return s(e)}function EM(e){try{return String(e)}catch{return""}}function Tte(e){return e.errors.map(n=>{try{return n&&n.message?EM(n.message):EM(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}const Dte=`
150
150
  Caused by: `,FE=Symbol("causeStack");function Ite(e,t){const n=he.hasOwnProp(e,FE)&&e[FE];return n&&t.endsWith(n)?t.length-n.length:-1}function xte(e,t){try{const n=t&&t.stack;if(typeof n!="string"||!n)return;const o=e.stack;if(typeof o!="string"||!o)return;const s=Dte+n;e.stack=o+s,Object.defineProperty(e,FE,{__proto__:null,value:s})}catch{}}let it=class hU extends Error{static from(t,n,o,s,r,i){let a=t.message;!a&&he.isArray(t.errors)&&t.errors.length&&(a=Tte(t));const l=new hU(a,n||t.code,o,s,r);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,xte(l,t),t.status!=null&&l.status==null&&(l.status=t.status),i&&Object.assign(l,i),l}constructor(t,n,o,s,r){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),o&&(this.config=o),s&&(this.request=s),r&&(this.response=r,this.status=r.status)}toJSON(){const t=this.config,n=t&&he.hasOwnProp(t,"redact")?t.redact:void 0,o=he.isArray(n)&&n.length>0?Rte(t,n):he.toJSONObject(t);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:o,code:this.code,status:this.status}}};it.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",it.ERR_BAD_OPTION="ERR_BAD_OPTION",it.ECONNABORTED="ECONNABORTED",it.ETIMEDOUT="ETIMEDOUT",it.ECONNREFUSED="ECONNREFUSED",it.ERR_NETWORK="ERR_NETWORK",it.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",it.ERR_DEPRECATED="ERR_DEPRECATED",it.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",it.ERR_BAD_REQUEST="ERR_BAD_REQUEST",it.ERR_CANCELED="ERR_CANCELED",it.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",it.ERR_INVALID_URL="ERR_INVALID_URL",it.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ate=null,_M=100;function OE(e){return he.isPlainObject(e)||he.isArray(e)}function RM(e){return he.endsWith(e,"[]")?e.slice(0,-2):e}function ME(e,t,n){return e?e.concat(t).map(function(s,r){return s=RM(s),!n&&r?"["+s+"]":s}).join(n?".":""):t}function Pte(e){return he.isArray(e)&&!e.some(OE)}const kte=he.toFlatObject(he,{},null,function(t){return/^is[A-Z]/.test(t)});function Uv(e,t,n){if(!he.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(S,b)=>{const y=he.getSafeProp(n,S);return he.isUndefined(y)?b:y},s=o("metaTokens",!0),r=o("visitor")||g,i=o("dots",!1),a=o("indexes",!1),l=o("Blob")||typeof Blob<"u"&&Blob,u=o("maxDepth",_M),c=l&&he.isSpecCompliantForm(t),d=[];if(!he.isFunction(r))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(he.isDate(S))return S.toISOString();if(he.isBoolean(S))return S.toString();if(!c&&he.isBlob(S))throw new it("Blob is not supported. Use a Buffer instead.");if(he.isArrayBuffer(S)||he.isTypedArray(S)){if(c&&typeof l=="function")return new l([S]);throw new it("Blob is not supported. Use a Buffer instead.",it.ERR_NOT_SUPPORT)}return S}function f(S){if(S>u)throw new it("Object is too deeply nested ("+S+" levels). Max depth: "+u,it.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(S,b){if(u===1/0)return JSON.stringify(S);const y=[];return JSON.stringify(S,function(_,I){if(!he.isObject(I))return I;for(;y.length&&y[y.length-1]!==this;)y.pop();return y.push(I),f(b+y.length-1),I})}function g(S,b,y){let E=S;if(he.isReactNative(t)&&he.isReactNativeBlob(S))return t.append(ME(y,b,i),h(S)),!1;if(S&&!y&&typeof S=="object"){if(he.endsWith(b,"{}"))b=s?b:b.slice(0,-2),S=p(S,1);else if(he.isArray(S)&&Pte(S)||(he.isFileList(S)||he.endsWith(b,"[]"))&&(E=he.toArray(S)))return b=RM(b),E.forEach(function(I,T){!(he.isUndefined(I)||I===null)&&t.append(a===!0?ME([b],T,i):a===null?b:b+"[]",h(I))}),!1}return OE(S)?!0:(t.append(ME(y,b,i),h(S)),!1)}const v=Object.assign(kte,{defaultVisitor:g,convertValue:h,isVisitable:OE});function w(S,b,y=0){if(!he.isUndefined(S)){if(f(y),d.indexOf(S)!==-1)throw new Error("Circular reference detected in "+b.join("."));d.push(S),he.forEach(S,function(_,I){(!(he.isUndefined(_)||_===null)&&r.call(t,_,he.isString(I)?I.trim():I,b,v))===!0&&w(_,b?b.concat(I):[I],y+1)}),d.pop()}}if(!he.isObject(e))throw new TypeError("data must be an object");return w(e),t}function TM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(o){return t[o]})}function NE(e,t){this._pairs=[],e&&Uv(e,this,t)}const DM=NE.prototype;DM.append=function(t,n){this._pairs.push([t,n])},DM.toString=function(t){const n=t?o=>t.call(this,o,TM):TM;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Fte(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function IM(e,t,n){if(!t)return e;e=e||"";const o=he.isFunction(n)?{serialize:n}:n,s=he.getSafeProp(o,"encode")||Fte,r=he.getSafeProp(o,"serialize");let i;if(r?i=r(t,o):i=he.isURLSearchParams(t)?t.toString():new NE(t,o).toString(s),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}const Zf=Symbol("internals");function xM(e){return e?e.length:0}function AM(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function Ote(e){return typeof e=="string"&&e!==""&&String(Number(e))===e?Number(e):e}function Jf(e,t){const n=e.handlers,o=xM(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):o!==t.handlersLength&&(o?t.handlerEntries.forEach(function(r,i){n[r.index]!==r.handler&&t.handlerEntries.delete(i)}):t.handlerEntries.clear()),t.handlersLength=o}class PM{constructor(){this.handlers=[],this[Zf]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,n,o){const s={fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null},r=this[Zf];this.handlers==null&&(this.handlers=[]),Jf(this,r);const i=r.nextId++;return this.handlers.push(s),r.handlerEntries.set(i,{handler:s,index:this.handlers.length-1}),r.handlersLength=this.handlers.length,i}eject(t){const n=this[Zf];Jf(this,n);const o=Ote(t),s=n.handlerEntries.get(o);if(s){if(n.handlerEntries.delete(o),this.handlers[s.index]!==s.handler)return;this.handlers[s.index]=null,n.iterationDepth||(AM(this.handlers),n.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Jf(this,this[Zf]))}forEach(t){const n=this[Zf];Jf(this,n),n.iterationDepth++;try{he.forEach(this.handlers,function(s){s!==null&&t(s)})}finally{--n.iterationDepth||(Jf(this,n),AM(this.handlers),n.handlersLength=xM(this.handlers))}}}const LE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Mte={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:NE,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},VE=typeof window<"u"&&typeof document<"u",BE=typeof navigator=="object"&&navigator||void 0,Nte=VE&&(!BE||["ReactNative","NativeScript","NS"].indexOf(BE.product)<0),Lte=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vte=VE&&window.location.href||"http://localhost",yo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:VE,hasStandardBrowserEnv:Nte,hasStandardBrowserWebWorkerEnv:Lte,navigator:BE,origin:Vte},Symbol.toStringTag,{value:"Module"})),...Mte};function Bte(e,t){return Uv(e,new yo.classes.URLSearchParams,{visitor:function(n,o,s,r){return yo.isNode&&he.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}const kM=_M;function FM(e){if(e>kM)throw new it("FormData field is too deeply nested ("+e+" levels). Max depth: "+kM,it.ERR_FORM_DATA_DEPTH_EXCEEDED)}function $te(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let o;for(;(o=n.exec(e))!==null;)FM(t.length),t.push(o[0]==="[]"?"":o[1]||o[0]);return t}function OM(e){const t={},n=Object.keys(e);let o;const s=n.length;let r;for(o=0;o<s;o++)r=n[o],t[r]=e[r];return t}function MM(e){if(!he.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some((n,o)=>n!==String(o))?OM(e):e}function Hte(e){const t=[e];for(;t.length;){const n=t.pop();Object.keys(n).forEach(o=>{const s=n[o]=MM(n[o]);(he.isArray(s)||he.isPlainObject(s))&&t.push(s)})}return e}function NM(e){function t(n,o,s,r){FM(r);let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&he.isArray(s)?s.length:i,l?(he.hasOwnProp(s,i)?(s[i]=MM(s[i]),s[i]=he.isArray(s[i])?s[i].concat(o):[s[i],o]):s[i]=o,!a):((!he.hasOwnProp(s,i)||!he.isObject(s[i]))&&(s[i]=[]),t(n,o,s[i],r)&&he.isArray(s[i])&&(s[i]=OM(s[i])),!a)}if(he.isFormData(e)&&he.isFunction(e.entries)){const n={};return he.forEachEntry(e,(o,s)=>{t($te(o),s,n,0)}),Hte(n)}return null}const LM=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),md=(e,t)=>e!=null&&he.hasOwnProp(e,t)?e[t]:void 0;function Gte(e,t,n){if(he.isString(e))try{return(t||JSON.parse)(e),he.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Qf={transitional:LE,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,r=he.isObject(t);if(r&&he.isHTMLForm(t)&&(t=new FormData(t)),he.isFormData(t))return s?JSON.stringify(NM(t)):t;if(he.isArrayBuffer(t)||he.isBuffer(t)||he.isStream(t)||he.isFile(t)||he.isBlob(t)||he.isReadableStream(t))return t;if(he.isArrayBufferView(t))return t.buffer;if(he.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){const l=md(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return Bte(t,l).toString();if((a=he.isFileList(t))||o.indexOf("multipart/form-data")>-1){const u=md(this,"env"),c=u&&u.FormData;return Uv(a?{"files[]":t}:t,c&&new c,l)}}return r||s?(n.setContentType("application/json",!1),Gte(t)):t}],transformResponse:[function(t){const n=md(this,"transitional")||Qf.transitional,o=n&&n.forcedJSONParsing,s=md(this,"responseType"),r=s==="json";if(he.isResponse(t)||he.isReadableStream(t))return t;if(t&&he.isString(t)&&(o&&!s||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,md(this,"parseReviver"))}catch(l){if(a)throw l.name==="SyntaxError"?it.from(l,it.ERR_BAD_RESPONSE,this,null,md(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yo.classes.FormData,Blob:yo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(LM,e=>{Qf.headers[e]={}});function $E(e,t){const n=this||Qf,o=t||n,s=Ao.from(o.headers);let r=o.data;return he.forEach(e,function(a){r=a.call(n,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function VM(e){return!!(e&&e.__CANCEL__)}let ep=class extends it{constructor(t,n,o){super(t??"canceled",it.ERR_CANCELED,n,o),this.name="CanceledError",this.__CANCEL__=!0}};function BM(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new it("Request failed with status code "+n.status,n.status>=400&&n.status<500?it.ERR_BAD_REQUEST:it.ERR_BAD_RESPONSE,n.config,n.request,n))}const Ute=/[\t\n\r]/g;function $M(e){if(typeof e!="string")return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Ute,"")}function HE(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const HM=e=>{try{return decodeURIComponent(e)}catch{return e}},GM=yo.hasStandardBrowserEnv?{write(e,t,n,o,s,r,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];he.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),he.isString(o)&&a.push(`path=${o}`),he.isString(s)&&a.push(`domain=${s}`),r===!0&&a.push("secure"),he.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let o=0;o<n.length;o++){const s=n[o].replace(/^\s+/,""),r=s.indexOf("=");if(r!==-1&&s.slice(0,r)===e)return HM(s.slice(r+1))}return null},async readAsync(e){try{const t=typeof window<"u"&&window.cookieStore;if(t&&he.isFunction(t.get)){const n=await t.get(e);return n?HM(n.value):null}}catch{}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},async readAsync(){return null},remove(){}};function Wte(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,r=0,i;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=o[r];i||(i=u),n[s]=l,o[s]=u;let d=r,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===r&&(r=(r+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(h*1e3/f):void 0}}function zte(e,t){let n=0,o=1e3/t,s,r;const i=(c,d=Date.now())=>{n=d,s=null,r&&(clearTimeout(r),r=null),e(...c)};return[(...c)=>{const d=Date.now(),h=d-n;h>=o?i(c,d):(s=c,r||(r=setTimeout(()=>{r=null,i(s)},o-h)))},()=>s&&i(s),(...c)=>i(c)]}const Wv=(e,t,n=3)=>{let o=0;const s=Wte(50,250);return zte(r=>{if(!r||!he.isNumber(r.loaded))return;const i=r.loaded,a=r.lengthComputable?r.total:void 0,l=Math.max(0,a!=null?Math.min(i,a):i),u=Math.max(0,l-o),c=s(u);o=Math.max(o,l);const d={loaded:l,total:a,progress:a?l/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a?(a-l)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},UM=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},WM=(e,t=he.asap)=>(...n)=>t(()=>e(...n)),jte=yo.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||yo.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(yo.origin)):()=>!0;function Kte(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qte(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const Yte=/^https?:(?!\/\/)/i;function Xte(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,o="")=>`${n}${o}${Gv}`)}function Zte(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Gv}@`),n=t.indexOf("#"),s=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Gv}`);return n===-1?s:`${s}#${Xte(t.slice(n+1))}`}function zM(e,t){if(typeof e=="string"){const n=$M(e);if(Yte.test(n))throw new it(`Invalid URL ${JSON.stringify(Zte(n))}: missing "//" after protocol`,it.ERR_INVALID_URL,t)}}function jM(e,t,n,o){zM(t,o);let s=!Kte(t);return e&&(s||n===!1)?(zM(e,o),qte(e,t)):t}function Jte(e){const t=[{value:e}],n=new WeakSet,o=new WeakSet;for(;t.length;){const{value:s,done:r}=t.pop();if(!he.isPlainObject(s)&&!he.isArray(s))continue;if(r){n.delete(s);continue}if(n.has(s))throw new it("Circular reference detected in params",it.ERR_BAD_OPTION_VALUE);if(o.has(s))continue;o.add(s),n.add(s),t.push({value:s,done:!0});const i=Object.keys(s);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(s).forEach(a=>{const l=Object.getOwnPropertyDescriptor(s,a);l&&l.enumerable&&i.push(a)}),i.forEach(a=>{if(a==="__proto__"||a==="constructor"||a==="prototype"){const l=Object.getOwnPropertyDescriptor(s,a);l&&he.hasOwnProp(l,"value")&&t.push({value:l.value})}else t.push({value:s[a]})})}}const KM=e=>e instanceof Ao?{...e}:e,GE=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function Qte(e,t){const n=[],o=new WeakMap,s={};function r(a,l){if(!he.isPlainObject(l))return he.isArray(l)?l.slice():l;const u=he.isPlainObject(a)?a:s;let c=o.get(l);if(c||(c=new WeakMap,o.set(l,c)),c.has(u))return c.get(u);const d={};return c.set(u,d),n.push({base:u,source:l,result:d}),d}const i=he.isUndefined(t)?r(void 0,e):r(e,t);for(;n.length;){const{base:a,source:l,result:u}=n.pop(),c=new Set(GE(a)),d=new Set(GE(l));new Set([...c,...d]).forEach(f=>{if(f==="__proto__"||f==="constructor"||f==="prototype")return;const p=d.has(f),g=p?l[f]:void 0,v=(!p||he.isPlainObject(g))&&c.has(f)?a[f]:void 0;u[f]=p?r(v,g):r(void 0,v)})}return Jte(i),i}function gl(e,t,n,o){return he.isPlainObject(e)&&he.isPlainObject(t)?he.merge.call({caseless:o},e,t):he.isPlainObject(t)?he.merge({},t):he.isArray(t)?t.slice():t}function qM(e,t,n,o){if(he.isUndefined(t)){if(!he.isUndefined(e))return gl(void 0,e,n,o)}else return gl(e,t,n,o)}function UE(e,t){if(!he.isUndefined(t))return gl(void 0,t)}function Hn(e,t){if(he.isUndefined(t)){if(!he.isUndefined(e))return gl(void 0,e)}else return gl(void 0,t)}function ene(e,t,n){const o=he.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!he.isUndefined(o))if(he.isPlainObject(o)){if(he.hasOwnProp(o,n))return o[n]}else return;const s=he.hasOwnProp(e,"transitional")?e.transitional:void 0;if(he.isPlainObject(s)&&he.hasOwnProp(s,n))return s[n]}function WE(e,t,n,o,s){if(he.hasOwnProp(s,n))return gl(e,t);if(he.hasOwnProp(o,n))return gl(void 0,e)}function tne(e,t,n){return qM(KM(e),KM(t),n,!0)}const nne=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),YM={url:UE,method:UE,data:UE,baseURL:Hn,transformRequest:Hn,transformResponse:Hn,params:Qte,paramsSerializer:Hn,timeout:Hn,timeoutErrorMessage:Hn,withCredentials:Hn,withXSRFToken:Hn,adapter:Hn,responseType:Hn,xsrfCookieName:Hn,xsrfHeaderName:Hn,onUploadProgress:Hn,onDownloadProgress:Hn,decompress:Hn,maxContentLength:Hn,maxBodyLength:Hn,beforeRedirect:Hn,transport:Hn,httpAgent:Hn,httpsAgent:Hn,cancelToken:Hn,socketPath:Hn,allowedSocketPaths:Hn,responseEncoding:Hn,validateStatus:WE,headers:tne};function ku(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",nne);const o=GE({...e,...t});for(let s=0,r=o.length;s<r;s++){const i=o[s];if(i==="__proto__"||i==="constructor"||i==="prototype")continue;const a=he.hasOwnProp(YM,i)?YM[i]:qM,l=he.hasOwnProp(e,i)?e[i]:void 0,u=he.hasOwnProp(t,i)?t[i]:void 0,c=a===WE?a(l,u,i,e,t):a(l,u,i);he.isUndefined(c)&&a!==WE||(n[i]=c)}return he.hasOwnProp(t,"validateStatus")&&he.isUndefined(t.validateStatus)&&ene(e,t,"validateStatusUndefinedResolves")===!1&&(he.hasOwnProp(e,"validateStatus")?n.validateStatus=gl(void 0,e.validateStatus):delete n.validateStatus),n}const one=["content-type","content-length"];function sne(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([o,s])=>{one.includes(o.toLowerCase())&&e.set(o,s)})}const XM=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),rne=e=>GM.read(e);function ZM(e,t=rne){const n=ku({},e),o=f=>he.hasOwnProp(n,f)?n[f]:void 0,s=o("data");let r=o("withXSRFToken");const i=o("xsrfHeaderName"),a=o("xsrfCookieName");let l=o("headers");const u=o("auth"),c=o("baseURL"),d=o("allowAbsoluteUrls"),h=o("url");if(n.headers=l=Ao.from(l),n.url=IM(jM(c,h,d,n),o("params"),o("paramsSerializer")),u){const f=he.getSafeProp(u,"username")||"",p=he.getSafeProp(u,"password")||"",g=o("transitional"),v=g&&he.hasOwnProp(g,"encodeBasicAuthUsername")&&g.encodeBasicAuthUsername===!0;try{l.set("Authorization","Basic "+btoa((v?XM(f):f)+":"+(p?XM(p):"")))}catch(w){throw it.from(w,it.ERR_BAD_OPTION_VALUE,e)}}if(he.isFormData(s)){const f=he.getSafeProp(s,"getHeaders");yo.hasStandardBrowserEnv||yo.hasStandardBrowserWebWorkerEnv||he.isReactNative(s)?l.setContentType(void 0):he.isFunction(f)&&sne(l,f.call(s),o("formDataHeaderPolicy"))}if(yo.hasStandardBrowserEnv&&(he.isFunction(r)&&(r=r(n)),r===!0||r==null&&jte(n.url))){const p=i&&a&&t(a);p&&l.set(i,p)}return n}const ine=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){let s;try{const T=yo.hasStandardBrowserEnv&&typeof window<"u"&&window.cookieStore;s=T&&he.isFunction(T.get)}catch{}let r;const i=ZM(e,s?T=>(r=T,null):void 0);let a=i.data;const l=Ao.from(i.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:d}=i,h,f,p,g,v,w,S;function b(){clearTimeout(f);try{v&&v()}catch(T){setTimeout(()=>{throw T})}try{w&&w()}catch(T){setTimeout(()=>{throw T})}y&&(g&&y.removeEventListener("progress",g),y.upload&&(p&&y.upload.removeEventListener("progress",p),v&&y.upload.removeEventListener("loadend",v))),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function E(T){if(!y)return;if(y.status===0&&(HE($M(i.url))||HE(yo.origin))!=="file"&&!(y.responseURL&&y.responseURL.startsWith("file:"))){o(new it("Request aborted",it.ECONNABORTED,e,y)),b(),y=null;return}try{T?S&&S(T):w&&w()}catch(P){setTimeout(()=>{throw P})}if(!y)return;const F=Ao.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!u||u==="text"||u==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:F,config:e,request:y};BM(function(k){n(k),b()},function(k){o(k),b()},x),y=null}if("onloadend"in y?y.onloadend=E:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(E)},y.onabort=function(){y&&(o(new it("Request aborted",it.ECONNABORTED,e,y)),b(),y=null)},y.onerror=function(F){const L=F&&F.message?F.message:"Network Error",x=new it(L,it.ERR_NETWORK,e,y);x.event=F||null,o(x),b(),y=null},y.ontimeout=function(){if(!y)return;let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const L=i.transitional||LE;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),o(new it(F,L.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,e,y)),b(),y=null},a===void 0&&l.setContentType(null),he.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),u&&u!=="json"&&(y.responseType=i.responseType),d&&([g,w,S]=Wv(d,!0),y.addEventListener("progress",g)),c&&y.upload&&([p,v]=Wv(c),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",v)),i.cancelToken||i.signal){if(h=T=>{if(!y)return;o(!T||T.type?new ep(null,e,y):T);const F=y;b(),y=null,F.abort()},i.cancelToken&&i.cancelToken.subscribe(h),!y)return;i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h))}if(!y)return;const _=HE(i.url);if(_&&!yo.protocols.includes(_)){o(new it("Unsupported protocol "+_+":",it.ERR_BAD_REQUEST,e)),b();return}const I=()=>{y&&("setRequestHeader"in y&&he.forEach(CM(l),function(F,L){y.setRequestHeader(L,F)}),y.send(a||null))};if(r){const T=typeof performance<"u"&&he.isFunction(performance.now)?()=>performance.now():Date.now,F=y.timeout>0?T()+Number(y.timeout):void 0,L=()=>{if(!y)return;const x=y;x.ontimeout(),x.abort()};if(F!==void 0){const x=()=>{const P=F-T();P>0?f=setTimeout(x,Math.min(P,2147483647)):L()};x()}GM.readAsync(r).then(x=>{if(y){if(F!==void 0&&T()>=F){L();return}if(x){const P=he.hasOwnProp(i,"xsrfHeaderName")&&i.xsrfHeaderName;l.set(P,x)}I()}}).catch(x=>{y&&(o(it.from(x,null,e,y)),b(),y=null)})}else I()})},ane=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let o=!1;const s=function(l){if(!o){o=!0,i();const u=l instanceof Error?l:this.reason;n.abort(u instanceof it?u:new ep(u instanceof Error?u.message:u))}};let r=t&&setTimeout(()=>{r=null,s(new it(`timeout of ${t}ms exceeded`,it.ETIMEDOUT))},t);const i=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(l=>{const u=he.getSafeProp(l,"unsubscribe");he.isFunction(u)?u.call(l,s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>{if(!o){if(l.aborted){s.call(l);return}l.addEventListener("abort",s,{once:!0})}});const{signal:a}=n;return a.unsubscribe=()=>he.asap(i),a},lne=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,s;for(;o<n;)s=o+t,yield e.slice(o,s),o=s},une=async function*(e,t){for await(const n of cne(e))yield*lne(n,t)},cne=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},JM=(e,t,n,o)=>{const s=une(e,t);let r=0,i,a=l=>{i||(i=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await s.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},ml=`\r
@@ -253,4 +253,4 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
253
253
  `,d_e=class extends $be{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,TG),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=TG),this.isFirstLine=!1}},h_e=class extends Bbe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Ot(this.gos,{})):t.fileName;Hbe(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u,suppressQuotes:c,columnSeparator:d}=e;return new d_e({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function f_e(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function p_e(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var g_e={moduleName:"CsvExport",version:ct,beans:[h_e],apiFunctions:{getDataAsCsv:f_e,exportDataAsCsv:p_e},dependsOn:[c_e]},m_e=class extends qe{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new Nl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Gn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Ot(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new Nl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},v_e=2,y_e=class extends qe{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new m_e(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()&&(Al(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=v_e-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,u=o?a>=s:!1;if(l||u){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(u=>{const c=u===e||u===t;(s||c)&&n.push(u),c&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},w_e=class extends qe{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 Nl(e);this.rootNode=t,t.level=-1,this.rowHeight=qu(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=qu(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Dp(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;zd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:qu(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new y_e(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function C_e(e){var t;(t=Fw(e))==null||t.refreshCache()}function b_e(e){var t;(t=Fw(e))==null||t.purgeCache()}function S_e(e){var t;return(t=Fw(e))==null?void 0:t.getRowCount()}var E_e=class extends qe{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=hde(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Yo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){ti(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){Al(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){Al(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},__e={moduleName:"InfiniteRowModelCore",version:ct,rowModels:["infinite"],beans:[w_e,E_e]},R_e={moduleName:"InfiniteRowModel",version:ct,apiFunctions:{refreshInfiniteCache:C_e,purgeInfiniteCache:b_e,getInfiniteRowCount:S_e},dependsOn:[__e,V0e]},T_e="↑",D_e="↓",I_e={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},x_e=class extends Cn{constructor(){super(I_e),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=T_e+s:i.textContent=D_e+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),qo(this.eDelta)}refresh(e,t=!1){var u;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:qo(s),(u=i.filterManager)!=null&&u.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},A_e=".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}",P_e={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},k_e=class extends Cn{constructor(){super(P_e),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(A_e)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=lo({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Gn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:qo(o),!0}},F_e=class extends qe{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const u=`ag-cell-${t}`,c=`${u}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(u,!0),d.toggleCss(c,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:u,fadeEndTime:c}=a,d=l==="flash"?u:c;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${c-u}ms`,p.transitionDelay=`${u-e}ms`,t=Math.min(c,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=kme(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 O_e(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var M_e={moduleName:"HighlightChanges",version:ct,beans:[F_e],userComponents:{agAnimateShowChangeCellRenderer:x_e,agAnimateSlideCellRenderer:k_e},apiFunctions:{flashCells:O_e}};function N_e(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function L_e(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function DG(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=V_e(e)),e.version=ct,e}function V_e(e){return e.cellSelection=B_e(e,"rangeSelection"),e}function B_e(e,t){if(e&&typeof e=="object")return e[t]}var $_e=class extends qe{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Yo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Yo(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=Yo(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=io(e);const o=DG(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:u})=>{u==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=DG(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(c,d)=>!(n!=null&&n.has(c))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const u=this.updateCachedState.bind(this);u("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(u("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),u("rowGroupExpansion",void 0)):(u("rowGroupExpansion",this.getRowGroupExpansionState()),u("ssrmRowGroupExpansion",void 0)),u("rowSelection",this.getRowSelectionState()),u("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const u=this.updateCachedState.bind(this);u("sideBar",this.getSideBarState()),u("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();u("rangeSelection",c),u("cellSelection",c),u("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Nbe(nw(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(x,P)=>{const k=!(o!=null&&o.has(x))&&!!(P||t==="api");return h||(h=k),k},p={},g=x=>{let P=p[x];return P||(P={colId:x},p[x]=P,P)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:x,sort:P},k)=>{const M=g(x);M.sort=P,M.sortIndex=k})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((x,P)=>{const k=g(x);k.rowGroup=!0,k.rowGroupIndex=P})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:x,aggFunc:P})=>{g(x).aggFunc=P})),(b||!n)&&(v.aggFunc=null);const y=f("pivot",a);y&&(a==null||a.pivotColIds.forEach((x,P)=>{const k=g(x);k.pivot=!0,k.pivotIndex=P}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(y||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const x of(l==null?void 0:l.leftColIds)??[])g(x).pinned="left";for(const x of(l==null?void 0:l.rightColIds)??[])g(x).pinned="right"}(E||!n)&&(v.pinned=null);const _=f("columnVisibility",u);if(_)for(const x of(u==null?void 0:u.hiddenColIds)??[])g(x).hide=!0;(_||!n)&&(v.hide=null);const I=f("columnSizing",c);if(I)for(const{colId:x,flex:P,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const M=g(x);M.flex=P??null,M.width=k}(I||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,F=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),L=F?T.map(x=>g(x)):Object.values(p);(L.length||h)&&(this.columnStates=L,ni(this.beans,{state:L,applyOrder:F,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);ni(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Lbe(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const u=s.has(l);return u&&s.delete(l),{groupId:l,open:u}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(u=>u.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!Aa(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of i.colIds){const c=o.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const u=s.allCols,c=new Set(a);l=u.find(d=>c.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Dp(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Dp(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")}},H_e={moduleName:"GridState",version:ct,beans:[$_e],apiFunctions:{getState:N_e,setState:L_e}};function G_e(e){return e.rowModel.isLastRowIndexKnown()}function U_e(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function W_e(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function z_e(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function j_e(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function K_e(e){var t;(t=e.pagination)==null||t.goToNextPage()}function q_e(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Y_e(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function X_e(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Z_e(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var J_e=class extends qe{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(qu(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Yo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},ug="paginationPageSizeSelector",Q_e={tag:"span",cls:"ag-paging-page-size"},eRe=class extends Cn{constructor(){super(Q_e),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(ug,()=>{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(){qo(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(ug)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(ug)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:ug}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(Fl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Z_).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(ug);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},tRe={selector:"AG-PAGE-SIZE-SELECTOR",component:eRe},nRe=".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}",oRe=class extends V${constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(nRe)}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(),[tRe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",kr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",kr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",kr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",kr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Jpe(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Ve.ENTER||o.key===Ve.SPACE)&&(o.preventDefault(),n())}})}Zpe(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}):Vbe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){fce(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,u=!e&&n<l,c=this.formatNumber(i);this.lbFirstRowOnPage.textContent=c;let d;const h=this.getLocaleTextFunc();u?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(c,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${i} ${o} ${l} ${s}`;u!==this.ariaRowStatus&&(this.ariaRowStatus=u,(d=this.ariaAnnounce)==null||d.announceValue(u,"paginationRow")),c!==this.ariaPageStatus&&(this.ariaPageStatus=c,(h=this.ariaAnnounce)==null||h.announceValue(c,"paginationPage"))}},sRe={selector:"AG-PAGINATION",component:oRe},rRe=class extends qe{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 sRe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},iRe={moduleName:"Pagination",version:ct,beans:[rRe,J_e],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:G_e,paginationGetPageSize:U_e,paginationGetCurrentPage:W_e,paginationGetTotalPages:z_e,paginationGetRowCount:j_e,paginationGoToNextPage:K_e,paginationGoToPreviousPage:q_e,paginationGoToFirstPage:Y_e,paginationGoToLastPage:X_e,paginationGoToPage:Z_e},dependsOn:[Ow]};function aRe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function IG(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&IG(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function lRe(e,t){return e.rowModel.getRowNode(t)}function uRe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function cRe(e){return e.rowRenderer.getRenderedNodes()}function dRe(e,t,n){e.rowModel.forEachNode(t,n)}function hRe(e){return e.rowRenderer.firstRenderedRow}function fRe(e){return e.rowRenderer.lastRenderedRow}function pRe(e,t){return e.rowModel.getRow(t)}function gRe(e){return e.rowModel.getRowCount()}var mRe={moduleName:"RowApi",version:ct,apiFunctions:{redrawRows:aRe,setRowNodeExpanded:IG,getRowNode:lRe,addRenderedRowListener:uRe,getRenderedNodes:cRe,forEachNode:dRe,getFirstDisplayedRowIndex:hRe,getLastDisplayedRowIndex:fRe,getDisplayedRowAtIndex:pRe,getDisplayedRowCount:gRe}},vRe={moduleName:"ScrollApi",version:ct,apiFunctions:{getVerticalPixelRange:AEe,getHorizontalPixelRange:PEe,ensureColumnVisible:uG,ensureIndexVisible:cG,ensureNodeVisible:kEe}};function yRe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function wRe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function CRe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function bRe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function SRe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function ERe(e){return{rowHeight:qu(e),headerHeight:Xp(e)}}function _Re(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(Kp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=qR(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!YR(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&o.push(Kp(u))}}return[...o,...n]}var RRe={moduleName:"RenderApi",version:ct,apiFunctions:{setGridAriaProperty:yRe,refreshCells:wRe,refreshHeader:CRe,isAnimationFrameQueueEmpty:bRe,flushAllAnimationFrames:SRe,getSizesForCurrentTheme:ERe,getCellRendererInstances:_Re}};function TRe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function xG({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function DRe(e,t){var n;t&&typeof t=="object"?xG(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var IRe=class extends qe{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&io(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var u;const s=c=>qd(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=AG(this.beans),i=c=>n.leftCols.some(d=>Wp(d,c)),a=c=>n.rightCols.some(d=>Wp(d,c)),l=e.colKeys.filter(c=>!ka(c)&&!Fa(c)&&!i(c)&&!a(c));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(u=e.columnLimits)==null?void 0:u.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:u=[],source:c="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(u.map(({colId:E,..._})=>[E,_])),b=s??this.gos.get("skipHeaderOnAutoSize"),y=r??b;for(;w!==0;){w=0;const E=[];for(const _ of o){if(!_||Rde(_))continue;const I=f.getCol(_);if(!I||v.has(I))continue;const T=p.getPreferredWidthForColumn(I,b);if(T>0){const F=S[I.colId]??{};F.minWidth??(F.minWidth=l),F.maxWidth??(F.maxWidth=a);const L=xRe(I,T,F);I.setActualWidth(L,c),v.add(I),w++}E.push(I)}E.length&&g.refresh(c)}y||this.autoSizeColumnGroupsByColumns(o,c,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let u=l.getParent();for(;u&&u!=n;)u.isPadding()||r.add(u),u=u.getParent()}let a;for(const l of r){for(const u of s.getHeaderRowContainerCtrls())if(a=u.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new sc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=AG(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=Pa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),y=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),E=w.getActualWidth();return(b==null||E>=b)&&(y==null||E<=y)}))return;const l=[],u=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>Wp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{ti(l,v),u.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),y=v.getActualWidth();typeof S=="number"&&y<S?v.setActualWidth(S,t,!0):typeof b=="number"&&y>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-Pa(u);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/Pa(l);let S=v;for(let b=l.length-1;b>=0;b--){const y=l[b],E=s==null?void 0:s[y.getId()],_=(E==null?void 0:E.minWidth)??(o==null?void 0:o.defaultMinWidth),I=(E==null?void 0:E.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=y.getMinWidth(),F=y.getMaxWidth(),L=typeof _=="number"&&_>T?_:T,x=typeof I=="number"&&I<F?I:F;let P=Math.round(y.getActualWidth()*w);P<L?(P=L,h(y),d=!1):P>x?(P=x,h(y),d=!1):b===0&&(P=S),y.setActualWidth(P,t,!0),S-=P}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&qd(this.eventSvc,c,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function xRe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function AG({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return kp(n.eGridBody)-s}var ARe={moduleName:"ColumnAutoSize",version:ct,beans:[IRe],apiFunctions:{sizeColumnsToFit:TRe,autoSizeColumns:xG,autoSizeAllColumns:DRe},dependsOn:[tH]},PRe=".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 kRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function FRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function ORe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function MRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function NRe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var LRe={moduleName:"PinnedRow",version:ct,beans:[Oge],css:[PRe],apiFunctions:{getPinnedTopRowCount:kRe,getPinnedBottomRowCount:FRe,getPinnedTopRow:ORe,getPinnedBottomRow:MRe,forEachPinnedRow:NRe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},VRe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},BRe=class extends qe{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),u=new Map,c=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(y,E)=>{p=y,g=null,v=E},S=y=>{const E=!y.isExpandable()&&!y.group&&!y.detail&&(c?!c({rowNode:y}):!0);if(y.rowIndex==null||!E){w(null,null);return}if(p==null||y.level!==p.level||y.footer||g&&y.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(y,r.getValue(t,y));return}const _=r.getValue(t,y);if(f){const I=Ot(n,{valueA:v,nodeA:p,valueB:_,nodeB:y,column:t,colDef:a});if(!h(I)){w(y,_);return}}else if(d?!d(v,_):v!==_){w(y,_);return}if(!g){const I=l==null?void 0:l.get(p);(I==null?void 0:I.firstNode)===p?(I.reset(),g=I):g=new VRe(t,p),u.set(p,g)}g.addSpannedNode(y),u.set(y,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,y=>{(!i||i.isRowInPage(y.rowIndex))&&S(y)}),this.centerValueNodeMap=u;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=u;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},$Re=class extends qe{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Yo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Yo(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 BRe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},HRe=class extends ih{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Ny(e,t.rowIndex)}setAriaRowSpan(){yce(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(Sw(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}},GRe=class extends kw{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new HRe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},URe=class extends qe{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(u,c)=>{if(r.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){r.set(c.firstNode,d),n.delete(c.firstNode);return}i=!0;const h=new GRe(c.firstNode,this.beans,!1,!1,!1);r.set(c.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},WRe={moduleName:"CellSpan",version:ct,beans:[$Re,URe]},zRe=class extends qe{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);jR(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Ot(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},jRe=class extends qe{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){jR(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new zRe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},KRe={moduleName:"CellStyle",version:ct,beans:[jRe]},qRe={moduleName:"RowStyle",version:ct,beans:[OCe]};function YRe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var XRe=class extends qe{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const u of this.destroyManagedListeners)u();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},ZRe="ag-column-hover",JRe=class extends qe{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(ZRe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new XRe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},QRe={moduleName:"ColumnHover",version:ct,beans:[JRe],apiFunctions:{isColumnHovered:YRe}},eTe=class extends qe{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!xw.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{xw.has(i)&&t(i,a)},o=(i,a)=>{xw.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function tTe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function nTe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function oTe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function sTe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var rTe={moduleName:"EventApi",version:ct,apiFunctions:{addEventListener:tTe,addGlobalListener:oTe,removeEventListener:nTe,removeGlobalListener:sTe},beans:[eTe]},iTe={moduleName:"Locale",version:ct,beans:[Mbe]},aTe=class extends qe{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Yo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,u,c;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=Pl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(u=t.forEachDisplayedNode)==null||u.call(t,i),r&&((c=t.onRowHeightChanged)==null||c.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=c=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=ju(o),g=d+h+f+p,w=t.offsetHeight+g;if(c<5){const b=$o(i),y=!(b!=null&&b.contains(t)),E=w==0;if(y||E){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const u=Il(i,t,l);return n.addDestroyFunc(()=>{u(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},lTe={moduleName:"RowAutoHeight",version:ct,beans:[aTe]},uTe={moduleName:"AllCommunity",version:ct,dependsOn:[RG,g_e,R_e,Qbe,u0e,c0e,d0e,h0e,f0e,p0e,g0e,l0e,tEe,nEe,oEe,eEe,rEe,iEe,H_e,$0e,iRe,rH,mRe,vRe,RRe,ARe,qme,LRe,A0e,mbe,KRe,QRe,qRe,rTe,wbe,M_e,iG,iTe,lTe,Kme,l_e,WRe]};let PG=!1;PG||(tde.registerModules([uTe,RG]),PG=!0);class cTe{constructor(t,n){Rn(this,"gridApi",null);Rn(this,"container");Rn(this,"config");Rn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=Pbe(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const dTe=dH.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"),hTe=ot({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null);_E(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=$(null),a=X(()=>({width:"100%",height:o.height||"500px"})),l=X(()=>({...o,theme:dTe}));function u(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new cTe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),c()}function c(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return Qe(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),Vn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Xt(()=>{u()}),Vn(()=>{h()}),(g,v)=>(q(),de("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:le(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function lc(e){return uB(e)}const fTe=()=>[...[{headerName:"Thumbnail",field:"thumbnail",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,suppressMovable:!0,headerComponent:lc(Sl),width:86,resizable:!1},{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,headerComponent:lc(Sl),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:lc(Sl)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:lc(Sl)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:lc(Sl)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:lc(Sl),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:lc(Sl),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Tp.fromType(n))],$w={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},pTe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:$w.WIDTH,minWidth:$w.WIDTH,maxWidth:$w.WIDTH,cellClass:"ag-checkbox-cell",headerClass:$w.HEADER_CLASS,headerComponent:My(zse),suppressMovable:!0}),kG="blank",gTe=[kG,"__checkboxSelection","options"],mTe=["uiColumnResized","uiColumnMoved","api"],vTe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},FG=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,yTe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=bf({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=$([]),a=pTe();let l=0;const u=async d=>{const h=++l,f=await r();if(h!==l)return;const p=new Map(f==null?void 0:f.map(k=>[k.field,k])),g=fTe(),v=Tp.fromType(vTe),w=!!f,b=((d==null?void 0:d.map(k=>{var M;return{headerName:k.name,field:`metric_${k.id}`,editable:((M=k==null?void 0:k.auth_permission)==null?void 0:M.permission)==2,sortable:!0,filter:!1,flex:1,context:{...k},hide:w?!p.has(`metric_${k.id}`):!(k.is_primary||k.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:My(Sl),headerComponentParams:()=>({headerType:k.metric_type.code=="number"||k.metric_type.code=="formula"?"number":"default"})}}))||[]).map(k=>Tp.fromType(k)),y=[a,...g,...b,v],E=[],_=[],I=[];for(const k of y)k.pinned==="left"?E.push(k):k.pinned==="right"||k.field===kG?_.push(k):I.push(k);if(!f||f.length===0){i.value=y;return}const T=new Map(I.map(k=>[k.field,k])),F=[];for(const k of f)if(k.field&&T.has(k.field)){const M=T.get(k.field);F.push({...FG(M,k),hide:k.hide}),T.delete(k.field)}const L=Array.from(T.values()),x=[...F,...L].map(k=>({...k,lockPinned:!0})),P=k=>{const M=p.get(k.field),N=FG(k,M);return M&&M.hide!==void 0?{...N,hide:M.hide}:N};i.value=[...E.map(P),...x,..._.map(P)]};Qe(e,d=>u(d),{immediate:!0});const c=Cr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!mTe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!gTe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},Si);return nD(()=>c.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},wTe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},CTe=e=>{var P,k,M;const{showMessage:t,showErrorNetMessage:n}=Rs(),o=oo(),s={domainApi:wTe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(k=(P=o==null?void 0:o.appContext)==null?void 0:P.config)==null?void 0:k.globalProperties)==null?void 0:M.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new ON(r,s);i.on("call-api",N=>{N.success?t(N.apiCode,"success"):n(N)});const a=Fo({}),l=$([]),u=$(!1),c=$(null),d=$(null),h=$(1),f=$(20);let p=Promise.resolve();const{setCachedUsers:g}=RJ(),v=N=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:N}),w=50,S=async(N,B,z)=>{if(!N.length)return[];const oe=B9(N,B);return(await Promise.all(oe.map(z))).flat()},b=async N=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:N})).data.map(z=>[z==null?void 0:z.id,z.permission])}catch(B){return console.error("Failed to fetch item permissions chunk:",B),[]}},y=async(N,B)=>{try{const z=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:N,per_page:N.length*B.length,metric_ids:B}),oe=z.data.map(te=>{const se=new Map(te.item_metrics.map(A=>[A.metric_id,{value:A.value,auth_permission:A==null?void 0:A.auth_permission}])),Z=Object.fromEntries(B.map(A=>[A,se.get(A)??null]));return[te==null?void 0:te.id,Z]}),ie=new Set(z.data.map(te=>te==null?void 0:te.id));for(const te of N)if(!ie.has(te)){const se=Object.fromEntries(B.map(Z=>[Z,{value:null,auth_permission:void 0}]));oe.push([te,se])}return oe}catch(z){return console.error("Failed to fetch a chunk of metric values:",z),N.map(ie=>[ie,Object.fromEntries(B.map(te=>[te,void 0]))])}},E=async N=>{try{const B=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:N,per_page:N.length}),z=B.data.flatMap(oe=>oe.assignees);return g(z),B.data.map(oe=>[oe==null?void 0:oe.id,oe==null?void 0:oe.assignees])}catch(B){return console.error("Failed to fetch a chunk of assigned users:",B),[]}},_=async N=>{if(!N.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const B=await S(N,w,b);return Object.fromEntries(B)}catch(B){return console.error("Failed to fetch item permissions:",B),{}}},I=async(N,B)=>!N.length||!B.length?{}:(p=p.then(async()=>{try{const ie=[];let te=0;for(let Z=0;Z<B.length;Z+=5){te++;const A=B.slice(Z,Z+5),j=[];for(let ge=0;ge<A.length;ge++){const xe=A[ge],ue=await S(N,w,K=>y(K,[xe]));j.push(ue),await new Promise(K=>setTimeout(K,500))}ie.push(...j);const ne=Z+5>=B.length}const se={};for(const Z of ie.flat()){const[A,j]=Z;se[A]||(se[A]={}),Object.assign(se[A],j)}return se}catch(z){return console.error("Failed to fetch metric values:",z),{}}}),p),T=async N=>{if(!N.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const B=await S(N,w,E);return Object.fromEntries(B)}catch(B){return console.error("Failed to fetch assigned users:",B),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async N=>{const{cursor:B,offset:z,size:oe,searchQuery:ie}=N;let te=[];u.value=!0,c.value=null;try{const se=await i.getAllItem_cursor({...N,cursor:B||void 0,offset:z||void 0,pageSize:oe||f.value,...v(ie),sortBy:N.sort_by});return l.value=se.data,d.value=se.meta,h.value=se.meta.current_page||0,te=se.data.map(Z=>Z==null?void 0:Z.id),se}catch(se){throw c.value=se,console.error("Failed to fetch items (cursor):",se),se}finally{const se=async()=>{try{const[Z,A]=await Promise.all([T(te),_(te)]);e.value.updateItemData({assignees:Z,permission:A},te);const j=await I(te,e.value.metricIds);e.value.setMetricValues(j,new Set(te),e.value.metricIds)}catch(Z){console.error("Post-fetch processing failed:",Z)}};u.value=!1,setTimeout(se)}},getAssignableStatus:async N=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:N})}catch(B){throw console.error("Failed to fetch assignable status:",B),B}},getMetricList:async N=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:N})}catch(B){throw console.error("Failed to fetch metric list:",B),B}},getMetricValues:I,getAssignedUsers:T}};function bTe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);s.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(r.push(c),o.assignees){const h=hJ((o.assignees[u]||[]).map(bO));c.data.assignees=h,i.add("assignees")}o.permission&&(c.data.permissions=o.permission[u]),l.forEach(h=>{c.data[h]=c.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(u=>[u,new Map(r.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([u,c])=>{const d=i.getRowNode(u);return d!=null&&d.data?(c.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(u=>`metric_${u}`),force:!0})}}}function STe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,c),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function ETe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=$(!0),a=$(!0),l=$(!1),u=()=>{n.value=!n.value},c=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=STe(r,e.perPage,()=>o.value,y=>{i.value=y},y=>{a.value=y});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=Cr(v=>{d(v)},Si);return{isLoading:i,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:()=>{s.value},isSelectAll:$(!1)}}const _Te={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."]}}},RTe=e=>{var t;return(t=Object.entries(_Te.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},TTe={class:"visual-btn-visual"},DTe={class:"visual-btn--label"},ITe={key:0,class:"visual-btn--description"},xTe={key:1,class:"visual-btn--description"},Hw=_t(ot({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(q(),de("div",{class:le(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[Se("div",TTe,[kt(r.$slots,"visual",{},()=>[i[0]||(i[0]=Mz('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c2003bd7><g clip-path="url(#clip0_4824_13082)" data-v-c2003bd7><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-c2003bd7></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-c2003bd7></path></g><defs data-v-c2003bd7><clipPath id="clip0_4824_13082" data-v-c2003bd7><rect width="41.1429" height="36" fill="white" data-v-c2003bd7></rect></clipPath></defs></svg>',1))],!0)]),Se("div",DTe,at(n.label),1),n.disabled?(q(),de("div",ITe," Coming soon ")):(q(),de("div",xTe,at(n.description),1))],2))}}),[["__scopeId","data-v-c2003bd7"]]),OG="xlsx_toolbox",MG="feedback_lockup_toolbox",ATe="TOOLBOX_EXPORT_DATA",PTe="https://app.arbocollab.com",kTe=1e3,NG=()=>sessionStorage.getItem("BASE_URL"),LG=(e,t="xlsx-mapping")=>{const n=Dn("switchInstance",void 0),o=`${t}:load`,s=`${t}:edit`,r=new Set;let i;const a=()=>{const h=t==="xlsx-mapping"?OG:MG,f={showLoad:!1};n?n(h,"",f):window.appManager.switchInstance(h,"",f)},l=(h,f)=>{const p=setTimeout(()=>{r.delete(p),window.postMessage({type:h,payload:f},`${NG()}`)},kTe);r.add(p)},u=h=>{if(!h)throw new Error("Payload is missing");a(),l(o,h)},c=(h,f)=>{if(!h)throw new Error("Error file is missing");a(),l(s,{file:h})},d=h=>{if((h==null?void 0:h.type)!==ATe)return;const{file:f,fileName:p}=h.payload;e({channel:t,file:new File([f],p,{type:f.type}),fileName:p});const g=t==="xlsx-mapping"?OG:MG;g=="xlsx_toolbox"&&window.appManager.hide(g)};return Xt(()=>{i=zne({target:window,allowedOrigins:[NG()||PTe],onMessage:d,onInvalidMessage:(h,f,p)=>{console.warn("Rejected postMessage:",f,p.origin)}})}),Vn(()=>{i==null||i(),r.forEach(clearTimeout),r.clear()}),{openToolbox:u,sendBackErrorFile:c}},FTe={class:"header-name"},OTe={class:"description"},MTe={key:0,class:"error-message"},NTe={class:"dynamic"},LTe={key:1,class:"choose-method-container"},VTe={key:3,class:"select-status-container"},BTe={key:4,class:"result-container"},$Te={key:5,class:"result-container"},HTe={key:0},GTe={key:3},VG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",UTe=20,WTe=_t(ot({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=X(()=>[1,2,6].includes(b.value)),r=X(()=>Sv()),i=X(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},6:{title:`Create ${r.value} by count`,description:""},7:{title:"Creation in progress",description:"Work will be created in the background. Refresh to see updates."},8:{title:"Create failed",description:""}})),a=["csv","xlsx","xls"],l=$({segments:[],count:0}),u=({data:R,count:G,template_flow_status_id:J})=>{console.log("handleChangeCreateWithCount called with data:",R,"count:",G,"template_flow_status_id:",J),l.value={segments:R,count:G,template_flow_status_id:J}},c=$(!1),d=async()=>{var R;if(!((R=v.value)!=null&&R.bulkCreate)){console.error("API services not available");return}c.value=!0;try{(await v.value.bulkCreate({workspaceId:f.workspaceId,entityId:f.entityId,payload:{...l.value,entity_id:f.entityId},filter:{}})).status===fs.ACCEPTED&&(b.value=7,g("import-success"))}catch(G){B(G),b.value=8}finally{c.value=!1}},h={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},f=e,p=X(()=>Sv()),g=n,{apiServices:v}=so(!1,f),w=1,S=$(),b=$(w),y=$(null),E=$(null),_=$(null),I=$(void 0),T=$(null),F=X(()=>i.value[b.value]),L=$(),x=()=>{var R;y.value=null,b.value=w,E.value=null,_.value=null,M.value=null,T.value=null,(R=L.value)==null||R.clear(),I.value=void 0,l.value={segments:[],count:0}},P=()=>{b.value=6},k=()=>{var R;x(),(R=S.value)==null||R.hide()};Qe([E,_],([R,G])=>{b.value===1&&R&&G&&(b.value=2)});const M=$(null),N=R=>Rs().getErrorMessageFromResponse(R),B=R=>{if(console.error(R),typeof R=="string"){M.value=R;return}const G=R.response,J=G==null?void 0:G.data,ce=N(J);M.value=ce??R.message},z=async(R,G)=>{var ce;if(!v.value||!f.workspaceId||!f.entityId){console.error("API services not available");return}K.value=!0;const J=new FormData;J.append("file",R),J.append("format",((ce=G??R.name)==null?void 0:ce.split(".").pop())??R.name.split(".").pop()??""),J.append("entity_id",f.entityId),J.append("template_flow_status_id",y.value??"");try{await v.value.addNewSceneViaImportFile(f.workspaceId,f.entityId,J),b.value=3,g("import-success")}catch(Ee){console.error("Error uploading file:",Ee),B(Ee||"An unknown error occurred during file upload."),b.value=4}finally{K.value=!1}},{openToolbox:oe,sendBackErrorFile:ie}=LG(({file:R,fileName:G,channel:J})=>{J==="xlsx-mapping"&&(_.value=R,I.value=G??R.name,b.value=2)}),te=$(null),se=async()=>{var R,G;b.value=6,await ht(),(G=(R=te.value)==null?void 0:R.focus)==null||G.call(R)},Z=async()=>{try{const R=await j();oe({template:R})}catch(R){console.error("Error opening toolbox:",R),Rs().showErrorNetMessage("Failed to open toolbox.")}},A=$(!1),j=async()=>{A.value=!0;const R=f.workspaceId,G=f.entityId;if(!R||!G||!v.value)return A.value=!1,Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const J=await v.value.downloadTemplate(R,G,!1);if(!J)throw new Error("No response from downloadTemplate API");return J}catch(J){return console.error("Error downloading template:",J),Promise.reject(J)}finally{A.value=!1}},ne=R=>{var ce;const G=((ce=R.name.split(".").pop())==null?void 0:ce.toLowerCase())??"",J=VG.split(",").map(Ee=>Ee.trim()).includes(R.type)||a.includes(G);return J||(console.error("Invalid file type:",R.type),Rs().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),J},ge=async()=>{const R=document.createElement("input");R.type="file",R.accept=`${VG}, ${a.map(G=>`.${G}`).join(", ")}`,R.onchange=async()=>{var J;const G=(J=R.files)==null?void 0:J[0];if(G){if(!ne(G)){x();return}E.value=nv(G);try{const ce=await j();if(!ce){Rs().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}oe({source:G,template:ce})}catch(ce){console.error("Error opening toolbox:",ce),Rs().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},R.click()},xe=async R=>{var G;if(!((G=v.value)!=null&&G.getAssignableStatuses)){console.error("API services not available");return}return v.value.getAssignableStatuses(f.workspaceId,{entity_id:f.entityId,name_like:R.name_like,page:R.page,per_page:UTe})},ue=X(()=>{var R;return l.value.count==0||!((R=l.value.segments)!=null&&R.length)}),K=$(!1),Y=()=>{y.value=null,_.value&&I.value&&ie(_.value,I.value)},re=()=>{y.value&&_.value&&z(_.value,I.value)};return t({open:()=>{var R;return(R=S.value)==null?void 0:R.show()},close:()=>{var R;return(R=S.value)==null?void 0:R.hide()}}),(R,G)=>(q(),je(V(qN),jt({ref_key:"popupRef",ref:S,style:h,onHidden:x},{popupIndex:10,popupName:F.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Hh({header:we(()=>[Se("span",FTe,at(F.value.title),1)]),default:we(()=>[Se("div",{class:le(["modal-body",{"bulk-count":b.value===6,"choose-method":b.value===1}])},[Se("div",OTe,at(F.value.description),1),M.value&&b.value===4?(q(),de("div",MTe,[G[1]||(G[1]=tt(" Error code ",-1)),Se("span",NTe,at(M.value),1)])):Ye("",!0),b.value===1?(q(),de("div",LTe,[ye(Hw,{disabled:!1,label:"Create by count",description:"Enter how many to create.",onOnClick:se},{visual:we(()=>[ye(V(va),{src:"CreateByCount",size:65})]),_:1}),ye(Hw,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
254
254
  into a table.`,onOnClick:Z},{visual:we(()=>[ye(V(va),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ye(Hw,{label:"Import from file",description:`Create ${r.value} from a CSV or
255
255
  Excel file.`,onOnClick:ge},{visual:we(()=>[ye(V(va),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):Ye("",!0),b.value===6?(q(),je(V(jue),{key:2,ref_key:"bulkCreateCountRef",ref:te,"get-status-func":xe,"workspace-id":f.workspaceId,"take-name":p.value,onChanged:u,"entity-id":f.entityId},null,8,["workspace-id","take-name","entity-id"])):b.value===2?(q(),de("div",VTe,[ye(V(wL),{modelValue:y.value,"onUpdate:modelValue":G[0]||(G[0]=J=>y.value=J),"get-status-func":xe,"workspace-id":f.workspaceId,id:f.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:L},null,8,["modelValue","workspace-id","id"])])):b.value===3||b.value===7?(q(),de("div",BTe,[ye(V(va),{src:"Success",width:240,height:180,ratio:"unset"})])):b.value===4||b.value===8?(q(),de("div",$Te,[ye(V(va),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)],2)]),_:2},[b.value===2||b.value===4||b.value===3||b.value===6||b.value===7||b.value===8?{name:"footer",fn:we(()=>[b.value==6?ze((q(),de("div",HTe,[ye(V(St),{variant:"primary",loading:c.value,disabled:ue.value||c.value,onClick:d},{default:we(()=>[...G[2]||(G[2]=[tt(" Create ",-1)])]),_:1},8,["loading","disabled"])])),[[V(o),{content:ue.value?"Add a name or a counter first.":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),b.value===4||b.value===8?(q(),je(V(St),{key:1,variant:"secondary",onClick:k},{default:we(()=>[...G[3]||(G[3]=[tt(" Close ",-1)])]),_:1})):b.value===3?(q(),je(V(St),{key:2,variant:"secondary",onClick:k},{default:we(()=>[...G[4]||(G[4]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0),b.value===2?ze((q(),de("div",GTe,[ye(V(St),{loading:K.value,disabled:K.value||!y.value,onClick:re},{default:we(()=>[...G[5]||(G[5]=[tt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[V(o),{content:K.value||!y.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),b.value===4?(q(),je(V(St),{key:4,onClick:Y},{default:we(()=>[...G[6]||(G[6]=[tt(" Try Again ",-1)])]),_:1})):Ye("",!0),b.value===8?(q(),je(V(St),{key:5,onClick:P},{default:we(()=>[...G[7]||(G[7]=[tt("Try Again",-1)])]),_:1})):Ye("",!0),b.value===7?(q(),je(V(St),{key:6,onClick:k,variant:"secondary"},{default:we(()=>[...G[8]||(G[8]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-81f75cd1"]]),zTe={class:"header-name"},jTe={class:"modal-body"},KTe={class:"description"},qTe={key:0,class:"error-message"},YTe={class:"dynamic"},XTe={key:1,class:"choose-method-container"},ZTe={key:2,class:"result-container"},JTe={key:3,class:"result-container"},QTe={key:2},BG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",eDe=_t(ot({__name:"PopupBulkUpdate",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=X(()=>[1,2].includes(f.value)),r=X(()=>Sv()),i=X(()=>({1:{title:`Update ${r.value} in bulk`,description:""},2:{title:`Update ${r.value} in bulk`,description:""},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,u=n,{apiServices:c}=so(!1,l),d=1,h=$(),f=$(d),p=$(null),g=$(null),v=$(null),w=$(void 0),S=$(null),b=X(()=>i.value[f.value]),y=$(),E=()=>{var ie;p.value=null,f.value=d,g.value=null,v.value=null,_.value=null,S.value=null,(ie=y.value)==null||ie.clear(),w.value=void 0};Qe([g,v],([ie,te])=>{f.value===1&&ie&&te&&(f.value=2)});const _=$(null),I=ie=>Rs().getErrorMessageFromResponse(ie),T=ie=>{if(typeof ie=="string"){_.value=ie;return}const te=ie.response,se=te==null?void 0:te.data,Z=I(se);_.value=Z??ie.message,console.log("Error message set to:",{errorMsg:Z,message:ie})},F=async(ie,te)=>{var A;B.value=!0;const se=new FormData,Z=((A=ie.name.split(".").pop())==null?void 0:A.toString())||"";if(se.append("file",ie),se.append("format",Z),se.append("entity_id",l.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(l.workspaceId,l.entityId,se),f.value=3,u("import-success")}catch(j){console.error("Error uploading file:",j),T(j),f.value=4}finally{B.value=!1,window.appManager.hide("feedback_lockup_toolbox")}},{openToolbox:L,sendBackErrorFile:x}=LG(({file:ie,fileName:te,channel:se})=>{se==="feedback-merge"&&(v.value=ie,w.value=te??ie.name,F(ie))},"feedback-merge"),P=$(!1),k=async()=>{P.value=!0;const ie=l.workspaceId,te=l.entityId;if(!ie||!te||!c.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const se=await c.value.downloadExportedItemsFile(ie,te,!1);if(!se)throw new Error("No response from downloadTemplate API");return se}catch(se){return console.error("Error downloading template:",se),Promise.reject(se)}finally{P.value=!1}},M=ie=>{const te=BG.includes(ie.type);return te||(console.error("Invalid file type:",ie.type),Rs().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),te},N=async()=>{const ie=document.createElement("input");ie.type="file",ie.accept=BG,ie.onchange=async()=>{var se;const te=(se=ie.files)==null?void 0:se[0];if(te){if(!M(te)){E();return}g.value=nv(te);try{const Z=await k();if(!Z){Rs().addNotification({id:"failed-download-template",message:"Failed to download file.",type:"error"});return}L({exportFile:Z,feedbackFile:te})}catch(Z){console.error("Error opening toolbox:",Z),Rs().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},ie.click()},B=$(!1),z=()=>{p.value=null,v.value&&w.value&&x(v.value,w.value)},oe=()=>{p.value&&v.value&&(B.value=!0,F(v.value,w.value).finally(()=>{B.value=!1}))};return t({open:()=>{var ie;return(ie=h.value)==null?void 0:ie.show()},close:()=>{var ie;return(ie=h.value)==null?void 0:ie.hide()}}),(ie,te)=>(q(),je(V(qN),jt({ref_key:"popupRef",ref:h,style:a,onHidden:E},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Hh({header:we(()=>[Se("span",zTe,at(b.value.title),1)]),default:we(()=>[Se("div",jTe,[Se("div",KTe,at(b.value.description),1),_.value&&f.value===4?(q(),de("div",qTe,[te[2]||(te[2]=tt(" Error code ",-1)),Se("span",YTe,at(_.value),1)])):Ye("",!0),f.value===1?(q(),de("div",XTe,[ye(Hw,{disabled:!1,label:"Import from file",description:`Update ${r.value} from a CSV or Excel file.`,onOnClick:N,style:{width:"100%"}},{visual:we(()=>[ye(V(va),{src:"UploadFile",size:65})]),_:1},8,["description"])])):f.value===3?(q(),de("div",ZTe,[ye(V(va),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(q(),de("div",JTe,[ye(V(va),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)])]),_:2},[f.value===4||f.value===3?{name:"footer",fn:we(()=>[f.value===4?(q(),je(V(St),{key:0,variant:"secondary",onClick:te[0]||(te[0]=()=>{var se;E(),(se=h.value)==null||se.hide()})},{default:we(()=>[...te[3]||(te[3]=[tt(" Close ",-1)])]),_:1})):f.value===3?(q(),je(V(St),{key:1,variant:"secondary",onClick:te[1]||(te[1]=()=>{var se;E(),(se=h.value)==null||se.hide()})},{default:we(()=>[...te[4]||(te[4]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0),f.value===2?ze((q(),de("div",QTe,[ye(V(St),{loading:B.value,disabled:B.value||!p.value,onClick:oe},{default:we(()=>[...te[5]||(te[5]=[tt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[V(o),{content:B.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),f.value===4?(q(),je(V(St),{key:3,onClick:z},{default:we(()=>[...te[6]||(te[6]=[tt(" Try Again ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-9a73e40c"]]),tDe=_t(ot({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=$s,o=cE(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=go(o),a=Kt,l=Io,u=Lv(),{entityData:c}=go(u),d={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},h=$(""),f=X(()=>{var Ke;const Pe=((Ke=i.value)==null?void 0:Ke.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Pe},{label:"Update in bulk",value:"bulk_update",type:"text",hide:!Pe,id:"bulk_update_option"}]}),p=e;Tp.initialize({wrapVueCellRenderer:My,wrapVueCellEditor:uB});const g=fd(),{switchInstanceFunc:v}=go(g);Xt(()=>{const Pe=oo();v.value=Pe==null?void 0:Pe.appContext.config.globalProperties.switchInstance;const Ke=new BroadcastChannel("focusable_channel");ht(()=>{setTimeout(()=>{Ke.postMessage("Focusable elements updated")},7e3)})});const w=$(null),S=$([]),b=Gf(),{rowCount:y}=go(b),E=$(!1),_=$(""),I=$(),T=iM(),{metricList:F}=go(T),L=$(""),x=$(!1),P=$(new Set),k=$(new Map),{apiServices:M}=so(!1,p),{columnDefs:N,checkboxColumn:B,saveColumnConfig:z}=yTe(F,p.entityId,w),oe=$();Qe(()=>N,()=>{var Pe;(Pe=oe.value)==null||Pe.updateColumnDefs(N.value)},{deep:!0});const ie=(Pe,Ke)=>{z(Pe,Ke)},{updateRowData:te,setMetricValues:se}=bTe(w),Z=X(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(pe.value||{}).length==1&&Object.keys(pe.value)[0]=="preflight_status")&&Object.keys(pe.value||{}).length>0})),A=X(Cv),j=X(()=>N.value.filter(Pe=>{var Ke;return((Ke=Pe.field)==null?void 0:Ke.startsWith("metric_"))&&!Pe.hide}).map(Pe=>{var Ke;return((Ke=Pe.field)==null?void 0:Ke.replace("metric_",""))||""}));ci("timezone",A);const ne=X(()=>({autoFetch:!1,workspaceId:p.workspaceId,entityId:p.entityId,metricIds:j.value,updateItemData:te,setMetricValues:se})),{fetchItems:ge,getMetricList:xe,cusorMap:ue,getMetricValues:K}=CTe(ne),Y=X(()=>{if(!w.value)return!1;const Pe=w.value.getSelectedRows().length;return Pe>0&&Pe>=y.value.total}),re=X(()=>{var Pe;return((Pe=c.value)==null?void 0:Pe.name)||"Items"}),R=Pe=>{setTimeout(()=>{ht(()=>{var Ke,Mt;w.value&&(Pe?(Ke=w.value)==null||Ke.showNoRowsOverlay():(Mt=w.value)==null||Mt.hideOverlay())})},500)},G=(Pe,Ke)=>{var Mt;y.value.total=Pe.meta.total??0,(Mt=Pe.meta.next)!=null&&Mt.cursor&&(ue[Ke+1]=Pe.meta.next.cursor),L.value=Pe.meta["X-Tsr-signature"]||"",Pe.meta.total===0?R(!0):R(!1)},J=vE(),{setDefaultSort:ce}=J,Ee=$(null),{sortingAPIConfiguration:Ce,isSortingRunning:Ne}=go(J),pe=$({preflight_status:"1"}),H=X(()=>({...pe.value,search:_.value}));ci("filterParams",H);const W=$([]),be=X(()=>{var Pe;return((Pe=c.value)==null?void 0:Pe.name)||"Items"}),Ae=async({page:Pe,pageSize:Ke,filterText:Mt})=>{var uo,Zo,Os;(uo=w.value)==null||uo.hideOverlay();const Lt=ue[Pe],So=!Lt&&Pe>1?(Pe-1)*Ke:void 0,Xn=Ce.value;Xn.length>0&&(Ne.value=!0);try{const dc={cursor:Lt,size:Ke,searchQuery:Mt,offset:So,sort_by:Xn,...pe.value},Wl=await ge(dc);if(!Wl)return{rows:[],total:0};const Xi=(Os=(Zo=Wl.meta)==null?void 0:Zo.extra)==null?void 0:Os.default_sort;Xi&&ce(Xi);const gh=(Gw=>{const sn=Gw.data.map(hc=>EO(hc,A.value,be.value));return sn.forEach(hc=>{P.value.add(String(hc.id)),k.value.set(String(hc.id),{})}),sn})(Wl);return G(Wl,Pe),{rows:gh,total:y.value.total}}catch(dc){return console.error("Failed to fetch items:",dc),{rows:[],total:0}}finally{Ne.value=!1}},{isLoading:He,toggleSidebar:Te,onGridReady:Xe,handleUnSelect:ve,handleSelectAll:Be,onSearch:wt,firstLoad:Dt}=ETe({selectRowData:$([]),isSidebarOpen:E,quickFilterText:_,gridApi:w,perPage:d.ROWS_PER_PAGE,fetcher:Ae}),tn=$([]),en=Cr(()=>{var Xn;const Pe=((Xn=w.value)==null?void 0:Xn.getSelectedRows())||[],Ke=new Map(Pe.map(uo=>[uo.id,uo])),So=Pe.map(uo=>uo.id).map(uo=>{var Zo,Os;return[uo,(Os=(Zo=w.value)==null?void 0:Zo.getRowNode(uo))==null?void 0:Os.rowIndex]}).sort((uo,Zo)=>(uo[1]??0)-(Zo[1]??0)).map(([uo])=>Ke.get(uo));tn.value=So.filter(uo=>uo!==void 0)}),bn=Fo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Le=X(()=>({blockLoadDebounceMillis:1e3,columnDefs:N.value,rowModelType:"infinite",cacheBlockSize:d.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:d.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:d.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ge,noRowsOverlayComponent:My(zre),noRowsOverlayComponentParams:()=>Z.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Pe=>Pe.data.id,rowClassRules:{"row-deleted":Pe=>{var Ke;return(Ke=Pe.data)==null?void 0:Ke.isDeleted},"row-locked":Pe=>{var Ke;return(Ke=Pe.data)==null?void 0:Ke.isLocked},"row-archived":Pe=>{var Ke;return(Ke=Pe.data)==null?void 0:Ke.isArchived},"row-process-locked":Pe=>{var Ke,Mt;return((Mt=(Ke=Pe.data)==null?void 0:Ke.isProcessing)==null?void 0:Mt.state)==0},"row-inactive":Pe=>{var Ke;return!((Ke=Pe.data)!=null&&Ke.id)},"row-empty":Pe=>!Pe.data},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:p.workspaceId,entityId:p.entityId,apiServices:M.value,sorting:Ne.value},onCellKeyDown:Pe=>{var Ke,Mt,Lt;if(Pe.data.isDeleted)return!1;if(((Ke=Pe==null?void 0:Pe.event)==null?void 0:Ke.key)==="Enter"){const{api:So,node:Xn,column:uo}=Pe,Zo=So.getCellRendererInstances({rowNodes:[Xn],columns:[uo]});if(Zo.length>0){const Os=Zo[0];Os&&typeof((Mt=Os.componsenExposed)==null?void 0:Mt.focus)=="function"&&((Lt=Os.componsenExposed)==null||Lt.focus())}}},isRowSelectable:Pe=>{var Ke,Mt;return!Pe.group&&((Mt=(Ke=Pe.data)==null?void 0:Ke.isProcessing)==null?void 0:Mt.state)!=0},suppressKeyboardEvent:Pe=>{var Lt;if((Lt=Pe.data)!=null&&Lt.isDeleted)return!0;const Ke=Pe.event.key,Mt=Pe.editing;return Mt&&Ke==="Tab"?!0:Mt&&Ke==="Enter"?!1:Ke==="Enter"?(Pe.event.preventDefault(),Pe.event.stopPropagation(),!0):Ke==="ArrowUp"||Ke==="ArrowDown"||Ke==="ArrowLeft"||Ke==="ArrowRight"||Ke==="Tab"||Ke==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Pe=>{const Ke=Pe.api.getFirstDisplayedRowIndex(),Mt=Pe.api.getLastDisplayedRowIndex();bn.rowsDisplay.fromIndex=Ke,bn.rowsDisplay.toIndex=Mt,bn.columnsDisplay=Pe.api.getAllDisplayedVirtualColumns().map(Lt=>Lt.getColId())},onViewportChanged:Pe=>{bn.columnsDisplay=Pe.api.getAllDisplayedVirtualColumns().map(Ke=>Ke.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Pe){if(Pe.data.isDeleted&&Pe.api.stopEditing(),Pe.colDef.field=="options"){const Ke=Pe.api.getCellRendererInstances({rowNodes:[Pe.node],columns:[Pe.column]});Ke.length>0&&Ke[0].focusUi()}},tabToNextCell:Pe=>{let Ke=Pe.nextCellPosition;if(Ke&&Ke.column.getColId()==="ag-Grid-SelectionColumn"){const Mt=Pe.api.getAllDisplayedColumns(),Lt=Mt.indexOf(Ke.column),So=Pe.backwards?-1:1,Xn=Mt[Lt+So];if(Xn)return{rowIndex:Ke.rowIndex,column:Xn,rowPinned:Ke.rowPinned}}return Ke}}));function Ge(){if(!w.value)return;let Pe=0;w.value.forEachNode(Ke=>{Ke.data&&Pe++}),y.value.loaded=Math.min(Pe,y.value.total)}Qe(()=>Ce,()=>{w.value&&(L.value="",P.value.clear(),w.value.deselectAll(),Object.keys(ue).forEach(Pe=>delete ue[Number(Pe)]),w.value.purgeInfiniteCache(),w.value.ensureIndexVisible(0))},{deep:!0});const Rt=$(),Jt=$(),qt=()=>{is.showPopupOverwriteScenes=!0,ht(()=>{var Pe;(Pe=Jt.value)==null||Pe.open()})},nt=$(),Go=()=>{is.showPopupBulkUpdate=!0,ht(()=>{var Pe;(Pe=nt.value)==null||Pe.open()})},si=()=>{is.showPopupToolboxUploader=!0,ht(()=>{var Pe;(Pe=Rt.value)==null||Pe.open()})},tr=async()=>{Dt.value=!0,w.value&&(L.value="",P.value.clear(),Object.keys(ue).forEach(Pe=>delete ue[Number(Pe)]),await w.value.deselectAll(),await w.value.ensureIndexVisible(0,"top"),await w.value.purgeInfiniteCache(),await w.value.refreshInfiniteCache())},Mr=X(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Ui=$();X(()=>{var Pe;return(Pe=RTe(Mr.value))==null?void 0:Pe.map(Ke=>`<div>• ${Ke}</div>`).join(`
256
- `)});function Wi(Pe){var Ke;Pe==="new_scene"?(Ke=Ui.value)==null||Ke.show():Pe==="import_scenes"?si():Pe==="overwrite_scenes"?qt():Pe==="bulk_update"&&Go()}const zi=Pe=>{S.value=Pe.api.getSelectedRows().map(Ke=>Ke.id)},ji=Pe=>{const Ke=Xe(Pe);return Ke&&(Ke.addEventListener("modelUpdated",Ge),Ke.addEventListener("bodyScroll",()=>Ke.stopEditing()),Ke.addEventListener("selectionChanged",en),Ke.addEventListener("columnMoved",Lt=>ie(Lt,!0)),Ke.addEventListener("columnResized",Lt=>ie(Lt,!0)),Ke.addEventListener("firstDataRendered",()=>{Dt.value=!1}),!document.querySelector(".ag-body-viewport"))||Pe==null||Pe.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ke},Fs=()=>{var Pe;h.value=(((Pe=document.getElementById("item-table-layout-id"))==null?void 0:Pe.clientHeight)??0)-78+"px"};Xt(()=>{ht(()=>{Fs()}),window.addEventListener("resize",Fs);function Pe(){requestAnimationFrame(Pe)}Pe()}),Vn(()=>{window.removeEventListener("resize",Fs)});const Ki=async({code:Pe,name:Ke})=>{await wt(Pe),setTimeout(()=>{var Mt;(Mt=I.value)==null||Mt.setValue(Ke)},300)},dh=Pe=>{if(!w.value)return;const Ke=w.value.getRowNode(Pe);Ke?(w.value.ensureIndexVisible(Number(Ke.rowIndex),"middle"),w.value.flashCells({rowNodes:[Ke],flashDuration:3e3,fadeDuration:1e3})):w.value.ensureIndexVisible(y.value.total-1,"bottom")},Nn=Pe=>Pe.metric_type.code==="number"?"number":"default",bo=async()=>{if(p.entityId)try{const Pe=await xe(p.entityId);F.value=Pe.data.map(Ke=>({...Ke,sortType:Nn(Ke)}))}catch(Pe){console.error("Failed to initialize metric list:",Pe),F.value=[]}},fT=async()=>{if(M.value)try{const Pe=await M.value.getUserPermission(p.workspaceId);s(Pe)}catch(Pe){console.error("Failed to fetch user permissions:",Pe)}},hh=async()=>{if(M.value)try{const Pe=await M.value.getEntityDetail(p.workspaceId,p.entityId);r(Pe.permission),c.value=Pe}catch(Pe){console.error("Failed to fetch entity details:",Pe)}},cc=Ey(),{setUser:fh}=cc,pT=async()=>{if(M.value)try{const Pe=await M.value.getMe();return fh(Pe),Pe}catch(Pe){console.error("Failed to fetch user details:",Pe)}},qi=async()=>{var Pe;if(M.value)try{const Ke=await M.value.getWorkspaces(p.workspaceId),Mt=(Pe=Ke.data[0])==null?void 0:Pe.ws_user_role_id;return Mt&&cc.setUserRoleId(Mt),Ke}catch(Ke){console.error("Failed to fetch workspace details:",Ke)}};Qe(()=>[p.entityId,p.workspaceId],async([Pe,Ke])=>{!Pe||!Ke||(pT(),qi(),bo(),fT(),hh())},{immediate:!0,deep:!0}),Qe(j,(Pe,Ke)=>{const Mt=Pe.filter(Lt=>!(Ke!=null&&Ke.includes(Lt)));Mt.length>0&&K(Array.from(P.value),Mt).then(Lt=>{se(Lt,P.value,Mt)})},{immediate:!0,deep:!0}),Qe(L,(Pe,Ke)=>{x.value=!!(Ke&&Pe&&Ke!==Pe)}),t({refreshTable:tr});const Ul=Pe=>{pe.value=Pe,tr()},Yi=Pe=>{W.value=Pe,tr()},ph=Pe=>{N.value=Pe||[],ie({},!0)},gT=X(()=>{var Lt;const Pe=un.getInstance().getItem("ws.terminology"),Ke=Pe?JSON.parse(Pe):null;return`New ${((Lt=Ke==null?void 0:Ke.find(So=>So.code==="scene"))==null?void 0:Lt.name)||"Scene"}`}),is=Fo({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1}),cg=Pe=>{var So,Xn;const Ke=Pe.data,{action:Mt,type:Lt}=Ke;console.log("App loader close event received:",Ke),Mt=="APP_LOADER:HIDE"&&(Lt==="xlsx_toolbox"||Lt==="feedback_lockup_toolbox")&&((So=Rt.value)==null||So.close(),(Xn=nt.value)==null||Xn.close())};return Xt(()=>{window.addEventListener("message",cg)}),Vn(()=>{window.removeEventListener("message",cg)}),(Pe,Ke)=>(q(),je(V(Vse),{"is-sidebar-open":E.value,onCloseSidebar:V(Te),onSidebarClear:V(Te),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:V(Te)},{"header-left":we(()=>{var Mt;return[((Mt=V(i))==null?void 0:Mt.has_create_item_permission)==1?(q(),je(V(u0),{key:0,variant:["primary"],options:f.value,onSelect:Wi,onHandleClick:Ke[1]||(Ke[1]=Lt=>Wi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:we(()=>[ze(ye(V(St),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ke[0]||(Ke[0]=Lt=>Wi("new_scene")),label:gT.value},null,8,["label"]),[[V(l),1]])]),_:1},8,["options"])):Ye("",!0)]}),"header-actions":we(()=>[ye(V(Pie),{"onUpdate:assignees":Yi,onApplyFilter:Ul,loading:V(Dt),entityId:p.entityId},null,8,["loading","entityId"]),ze(ye(V(RE),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ke[2]||(Ke[2]=Mt=>_.value=Mt),onSearch:V(wt),class:le(Pe.$style.itemSearchBox),onClear:Ke[3]||(Ke[3]=Mt=>V(wt)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:I},null,8,["modelValue","onSearch","class"]),[[V(n),{isLoading:V(Dt),fullwidth:!0}]]),ze((q(),je(V(eM),{status:V(He)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:we(()=>[ze((q(),je(V(St),{variant:["secondary","icon"],disabled:V(He),onClick:tr},{default:we(()=>[ye(V(gt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[V(l),5],[V(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[V(n),{isLoading:V(Dt),fullwidth:!0}]]),ze(ye(V(Gre),{"model-value":V(N),onChange:Ke[4]||(Ke[4]=Mt=>ph(Mt)),id:"table_customization",gridApi:w.value,ref_key:"tableCustomizationRef",ref:oe,"checkbox-column":V(B),tableHeight:h.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[V(n),{isLoading:V(Dt),fullwidth:!0}]])]),grid:we(({availableHeight:Mt})=>[ye(V(hTe),jt({id:"item_table_main",ref_key:"agGrid",ref:Ee},Le.value,{height:Mt+"px",isSorting:V(Ne),onOnGridReady:ji,onSelectionChanged:zi}),null,16,["height","isSorting"])]),footer:we(()=>[Se("div",{class:le(Pe.$style.tableFooter),id:"table_footer"},[Se("span",null,[Ke[7]||(Ke[7]=tt(" Showing ",-1)),Se("b",null,at(V(y).loaded)+" of "+at(V(y).total),1)])],2)]),"new-row":we(()=>[ye(V(uie),{ref_key:"createNewSceneRef",ref:Ui,onSearchForCode:Ki,onFocusOnId:dh},null,512)]),"bulk-update-actions":we(()=>[!E.value&&S.value.length>0?ze((q(),je(V(Ase),{key:0,selectRowData:tn.value,"workspace-id":p.workspaceId,"entity-id":p.entityId,"grid-api":w.value,onUnselect:V(ve),onSelectAll:V(Be),"take-name":re.value,"selected-all":Y.value,"total-rows":V(y).total,"visible-rows":V(y).loaded,onUpdated:V(en),loading:V(He),onRefreshSelectedRow:V(en)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[dr,!E.value&&S.value.length>0]]):Ye("",!0)]),snackbar:we(()=>[ye(V(Zse))]),popup:we(()=>[is.showPopupToolboxUploader?(q(),je(WTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Rt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:tr,onHide:Ke[5]||(Ke[5]=Mt=>is.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0),is.showPopupBulkUpdate?(q(),je(eDe,{key:1,ref_key:"popupBulkUpdateRef",ref:nt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:tr,onHide:Ke[6]||(Ke[6]=Mt=>is.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0)]),_: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"}}]]),$G="0.1.241",nDe={key:0},oDe=_t(ot({__name:"app",setup(e){const t=X(()=>n.id.length===0||n.workspaceId.length===0),n=Fo({id:"",workspaceId:"",apiConfig:{}}),o=Rs(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=$(null),u=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Bh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",$G);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new ON(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Vn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=X(()=>n.id),d=X(()=>n.workspaceId);return ci("workspaceId",d),ci("entityId",c),(h,f)=>(q(),de("div",{class:le(h.$style.dashboardPluginWrapper)},[t.value?(q(),de("span",nDe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(q(),je(V(tDe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),hT=async(e={},t={})=>{const n=gI(oDe),o=n5();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${$G}`,"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",Kt),n.directive("focusable",Io);const i=await bue();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=hT),Ln.default=hT,Ln.initDashboard=hT,Object.defineProperties(Ln,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
256
+ `)});function Wi(Pe){var Ke;Pe==="new_scene"?(Ke=Ui.value)==null||Ke.show():Pe==="import_scenes"?si():Pe==="overwrite_scenes"?qt():Pe==="bulk_update"&&Go()}const zi=Pe=>{S.value=Pe.api.getSelectedRows().map(Ke=>Ke.id)},ji=Pe=>{const Ke=Xe(Pe);return Ke&&(Ke.addEventListener("modelUpdated",Ge),Ke.addEventListener("bodyScroll",()=>Ke.stopEditing()),Ke.addEventListener("selectionChanged",en),Ke.addEventListener("columnMoved",Lt=>ie(Lt,!0)),Ke.addEventListener("columnResized",Lt=>ie(Lt,!0)),Ke.addEventListener("firstDataRendered",()=>{Dt.value=!1}),!document.querySelector(".ag-body-viewport"))||Pe==null||Pe.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ke},Fs=()=>{var Pe;h.value=(((Pe=document.getElementById("item-table-layout-id"))==null?void 0:Pe.clientHeight)??0)-78+"px"};Xt(()=>{ht(()=>{Fs()}),window.addEventListener("resize",Fs);function Pe(){requestAnimationFrame(Pe)}Pe()}),Vn(()=>{window.removeEventListener("resize",Fs)});const Ki=async({code:Pe,name:Ke})=>{await wt(Pe),setTimeout(()=>{var Mt;(Mt=I.value)==null||Mt.setValue(Ke)},300)},dh=Pe=>{if(!w.value)return;const Ke=w.value.getRowNode(Pe);Ke?(w.value.ensureIndexVisible(Number(Ke.rowIndex),"middle"),w.value.flashCells({rowNodes:[Ke],flashDuration:3e3,fadeDuration:1e3})):w.value.ensureIndexVisible(y.value.total-1,"bottom")},Nn=Pe=>Pe.metric_type.code==="number"?"number":"default",bo=async()=>{if(p.entityId)try{const Pe=await xe(p.entityId);F.value=Pe.data.map(Ke=>({...Ke,sortType:Nn(Ke)}))}catch(Pe){console.error("Failed to initialize metric list:",Pe),F.value=[]}},fT=async()=>{if(M.value)try{const Pe=await M.value.getUserPermission(p.workspaceId);s(Pe)}catch(Pe){console.error("Failed to fetch user permissions:",Pe)}},hh=async()=>{if(M.value)try{const Pe=await M.value.getEntityDetail(p.workspaceId,p.entityId);r(Pe.permission),c.value=Pe}catch(Pe){console.error("Failed to fetch entity details:",Pe)}},cc=Ey(),{setUser:fh}=cc,pT=async()=>{if(M.value)try{const Pe=await M.value.getMe();return fh(Pe),Pe}catch(Pe){console.error("Failed to fetch user details:",Pe)}},qi=async()=>{var Pe;if(M.value)try{const Ke=await M.value.getWorkspaces(p.workspaceId),Mt=(Pe=Ke.data[0])==null?void 0:Pe.ws_user_role_id;return Mt&&cc.setUserRoleId(Mt),Ke}catch(Ke){console.error("Failed to fetch workspace details:",Ke)}};Qe(()=>[p.entityId,p.workspaceId],async([Pe,Ke])=>{!Pe||!Ke||(pT(),qi(),bo(),fT(),hh())},{immediate:!0,deep:!0}),Qe(j,(Pe,Ke)=>{const Mt=Pe.filter(Lt=>!(Ke!=null&&Ke.includes(Lt)));Mt.length>0&&K(Array.from(P.value),Mt).then(Lt=>{se(Lt,P.value,Mt)})},{immediate:!0,deep:!0}),Qe(L,(Pe,Ke)=>{x.value=!!(Ke&&Pe&&Ke!==Pe)}),t({refreshTable:tr});const Ul=Pe=>{pe.value=Pe,tr()},Yi=Pe=>{W.value=Pe,tr()},ph=Pe=>{N.value=Pe||[],ie({},!0)},gT=X(()=>{var Lt;const Pe=un.getInstance().getItem("ws.terminology"),Ke=Pe?JSON.parse(Pe):null;return`New ${((Lt=Ke==null?void 0:Ke.find(So=>So.code==="scene"))==null?void 0:Lt.name)||"Scene"}`}),is=Fo({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1}),cg=Pe=>{var So,Xn;const Ke=Pe.data,{action:Mt,type:Lt}=Ke;console.log("App loader close event received:",Ke),Mt=="APP_LOADER:HIDE"&&(Lt==="xlsx_toolbox"||Lt==="feedback_lockup_toolbox")&&((So=Rt.value)==null||So.close(),(Xn=nt.value)==null||Xn.close())};return Xt(()=>{window.addEventListener("message",cg)}),Vn(()=>{window.removeEventListener("message",cg)}),(Pe,Ke)=>(q(),je(V(Vse),{"is-sidebar-open":E.value,onCloseSidebar:V(Te),onSidebarClear:V(Te),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:V(Te)},{"header-left":we(()=>{var Mt;return[((Mt=V(i))==null?void 0:Mt.has_create_item_permission)==1?(q(),je(V(u0),{key:0,variant:["primary"],options:f.value,onSelect:Wi,onHandleClick:Ke[1]||(Ke[1]=Lt=>Wi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:we(()=>[ze(ye(V(St),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ke[0]||(Ke[0]=Lt=>Wi("new_scene")),label:gT.value},null,8,["label"]),[[V(l),1]])]),_:1},8,["options"])):Ye("",!0)]}),"header-actions":we(()=>[ye(V(Pie),{"onUpdate:assignees":Yi,onApplyFilter:Ul,loading:V(Dt),entityId:p.entityId},null,8,["loading","entityId"]),ze(ye(V(RE),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ke[2]||(Ke[2]=Mt=>_.value=Mt),onSearch:V(wt),class:le(Pe.$style.itemSearchBox),onClear:Ke[3]||(Ke[3]=Mt=>V(wt)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:I},null,8,["modelValue","onSearch","class"]),[[V(n),{isLoading:V(Dt),fullwidth:!0}]]),ze((q(),je(V(eM),{status:V(He)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:we(()=>[ze((q(),je(V(St),{variant:["secondary","icon"],disabled:V(He),onClick:tr},{default:we(()=>[ye(V(gt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[V(l),5],[V(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[V(n),{isLoading:V(Dt),fullwidth:!0}]]),ze(ye(V(Gre),{"model-value":V(N),onChange:Ke[4]||(Ke[4]=Mt=>ph(Mt)),id:"table_customization",gridApi:w.value,ref_key:"tableCustomizationRef",ref:oe,"checkbox-column":V(B),tableHeight:h.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[V(n),{isLoading:V(Dt),fullwidth:!0}]])]),grid:we(({availableHeight:Mt})=>[ye(V(hTe),jt({id:"item_table_main",ref_key:"agGrid",ref:Ee},Le.value,{height:Mt+"px",isSorting:V(Ne),onOnGridReady:ji,onSelectionChanged:zi}),null,16,["height","isSorting"])]),footer:we(()=>[Se("div",{class:le(Pe.$style.tableFooter),id:"table_footer"},[Se("span",null,[Ke[7]||(Ke[7]=tt(" Showing ",-1)),Se("b",null,at(V(y).loaded)+" of "+at(V(y).total),1)])],2)]),"new-row":we(()=>[ye(V(uie),{ref_key:"createNewSceneRef",ref:Ui,onSearchForCode:Ki,onFocusOnId:dh},null,512)]),"bulk-update-actions":we(()=>[!E.value&&S.value.length>0?ze((q(),je(V(Ase),{key:0,selectRowData:tn.value,"workspace-id":p.workspaceId,"entity-id":p.entityId,"grid-api":w.value,onUnselect:V(ve),onSelectAll:V(Be),"take-name":re.value,"selected-all":Y.value,"total-rows":V(y).total,"visible-rows":V(y).loaded,onUpdated:V(en),loading:V(He),onRefreshSelectedRow:V(en)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[dr,!E.value&&S.value.length>0]]):Ye("",!0)]),snackbar:we(()=>[ye(V(Zse))]),popup:we(()=>[is.showPopupToolboxUploader?(q(),je(WTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Rt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:tr,onHide:Ke[5]||(Ke[5]=Mt=>is.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0),is.showPopupBulkUpdate?(q(),je(eDe,{key:1,ref_key:"popupBulkUpdateRef",ref:nt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:tr,onHide:Ke[6]||(Ke[6]=Mt=>is.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0)]),_: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"}}]]),$G="0.1.242",nDe={key:0},oDe=_t(ot({__name:"app",setup(e){const t=X(()=>n.id.length===0||n.workspaceId.length===0),n=Fo({id:"",workspaceId:"",apiConfig:{}}),o=Rs(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=$(null),u=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Bh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",$G);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new ON(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Vn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=X(()=>n.id),d=X(()=>n.workspaceId);return ci("workspaceId",d),ci("entityId",c),(h,f)=>(q(),de("div",{class:le(h.$style.dashboardPluginWrapper)},[t.value?(q(),de("span",nDe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(q(),je(V(tDe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),hT=async(e={},t={})=>{const n=gI(oDe),o=n5();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${$G}`,"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",Kt),n.directive("focusable",Io);const i=await bue();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=hT),Ln.default=hT,Ln.initDashboard=hT,Object.defineProperties(Ln,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});